[PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
Currently on some platforms, the gadget device can be power off to save power when the Vbus is off, which means no cable plugging in now. In this situation we should defer starting the gadget until the gadget device is power on by connecting host. Signed-off-by: Baolin Wang --- drivers/usb/dwc3

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
Hi Felipe, On 13 May 2016 at 18:40, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Currently on some platforms, the gadget device can be power off to >> save power when the Vbus is off, which means no cable plugging in >> now. In this situation we should d

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
On 13 May 2016 at 20:09, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>>> index 6254b2f..dada5c6 100644 >>>> --- a/drivers/usb/dwc3/core.h >>>> +

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-14 Thread Baolin Wang
On 13 May 2016 at 20:46, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>> >>>> Because when the dwc3 Vbus is off (no cable pluging in now), >>>> espe

[PATCH] dwc3: gadget: Implement the suspend entry event handler

2016-05-16 Thread Baolin Wang
It had changed to be suspend event for BIT6 in DEVT register from version 2.30a and above. Thus this patch introduces one suspend event handler to handle the suspend event. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/gadget.c | 26 +- 1 file changed, 25 insertions

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
Hi Felipe, On 13 May 2016 at 20:46, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>> >>>> Because when the dwc3 Vbus is off (no cable pluging in now), >>

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
On 17 May 2016 at 16:00, Felipe Balbi wrote: > > Hi > > Baolin Wang writes: >> Hi Felipe, >> >> On 13 May 2016 at 20:46, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: >>>>>>> why does it need r

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
On 17 May 2016 at 17:25, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>>> Make sense. >>>>> >>>>> cool, if you wanna work on it, let me know and I can give some details >>>>> of what I have in mind. >

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi Felipe, On 17 May 2016 at 18:47, Baolin Wang wrote: > On 17 May 2016 at 17:25, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>>>>>> Make sense. >>>>>> >>>>>> cool, if you wanna work on it, let

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 18:12, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>> Baolin Wang writes: >>>>>>>>> Make sense. >>>>>>>> >>>>>>>> cool, if you wanna work on it, let me know and I can

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi, On 18 May 2016 at 18:22, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>> @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 >>>> *dwc, int is_on, int suspend) >>>> { >>>> u32

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 19:21, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>>> @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget >>>>>> *g, >>>>>> * even though host mode might be active. Don&#

[PATCH v11 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-05-20 Thread Baolin Wang
usb_charger_get_state() function to check charger state. - Remove the mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with

[PATCH v11 3/4] gadget: Integrate with the usb gadget supporting for usb charger

2016-05-20 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function and usb_charger_exit() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang --- drivers/usb/gadget/

[PATCH v11 2/4] gadget: Support for the usb charger framework

2016-05-20 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang --- drivers/usb

[PATCH v11 4/4] power: wm831x_power: Support USB charger current limit management

2016-05-20 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-05-20 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang --- drivers/usb/gadget/Kconfig |7 + drivers/usb/gadg

[PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-25 Thread Baolin Wang
] SyS_read+0x50/0xb0 Signed-off-by: Baolin Wang --- drivers/usb/dwc3/gadget.c | 95 ++--- 1 file changed, 72 insertions(+), 23 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8e4a1b1..5d095f2 100644 --- a/driver

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Baolin Wang
Hi Felipe, On 26 May 2016 at 14:22, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> When handling the endpoint interrupt handler, it maybe disable the endpoint >> from another core user to set the USB endpoint descriptor pointor to be NULL >> while issui

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Baolin Wang
Hi, On 26 May 2016 at 15:48, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Hi Felipe, >> >> On 26 May 2016 at 14:22, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: >>>> When handling the en

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Baolin Wang
On 26 May 2016 at 17:45, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: > > > >>> Also note that the usb_endpoint_xfer_isoc() call on line 2067 of >>> gadget.c (as in my testing/next from today) won't even get executed, so >>> we

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Baolin Wang
On 26 May 2016 at 18:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On 26 May 2016 at 17:45, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: >>> >>> >>> >>>>> Also note t

[PATCH] usb: dwc3: host: Set the dma_ops for xhci device

2016-06-03 Thread Baolin Wang
It will be failed when xhci device set the dma mask, if the xhci device dma_ops is dummy. Thus set the xhci device dma_ops from the parent device. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/host.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/host.c b/drivers

[PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device

2016-06-05 Thread Baolin Wang
ci device dma_ops is 'dummy_dma_ops'. Changes since v1: - Add CONFIG_ARM64 macro. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/host.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index c679f63..edb666d 100644 --- a/drivers

Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device

2016-06-06 Thread Baolin Wang
On 6 June 2016 at 22:59, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On ARM64 platform, it will set 'dummy_dma_ops' for device dma_ops if >> it did not call 'arch_setup_dma_ops' at device creation time, that will >> cause failure whe

Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device

2016-06-08 Thread Baolin Wang
Hi, On 6 June 2016 at 22:59, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On ARM64 platform, it will set 'dummy_dma_ops' for device dma_ops if >> it did not call 'arch_setup_dma_ops' at device creation time, that will >> cause failur

[RESEND PATCH v11 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-13 Thread Baolin Wang
From: Baolin Wang Currently the Linux kernel does not provide any standard integration of this feature that integrates the USB subsystem with the system power regulation provided by PMICs meaning that either vendors must add this in their kernels or USB gadget devices based on Linux (such as

[RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-13 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang --- drivers/usb/gadget/Kconfig |7 + drivers/usb/gadg

[RESEND PATCH v11 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-13 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-13 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang --- drivers/usb/gadget/Kconfig |7 + drivers/usb/gadg

[RESEND PATCH v11 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-13 Thread Baolin Wang
usb_charger_get_state() function to check charger state. - Remove the mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with

[RESEND PATCH v11 2/4] gadget: Support for the usb charger framework

2016-06-13 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang --- drivers/usb

[RESEND PATCH v11 3/4] gadget: Integrate with the usb gadget supporting for usb charger

2016-06-13 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function and usb_charger_exit() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang --- drivers/usb/gadget/

Re: [RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-16 Thread Baolin Wang
Hi Felipe, On 13 June 2016 at 23:13, Jun Li wrote: > Hi > >> -Original Message- >> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- >> ow...@vger.kernel.org] On Behalf Of Baolin Wang >> Sent: Monday, June 13, 2016 4:47 PM >> To: ba...@kerne

[PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget

2016-06-17 Thread Baolin Wang
It will be crash to stop gadget when the dwc3 device had been into suspend state, thus we need to check if the dwc3 device had been into suspend state when UDC try to stop gadget. By the way I have rebased on your 'testing/next' branch. Signed-off-by: Baolin Wang --- drivers/usb/dwc

Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget

2016-06-20 Thread Baolin Wang
On 20 June 2016 at 16:15, Felipe Balbi wrote: > Baolin Wang writes: > >> It will be crash to stop gadget when the dwc3 device had been into suspend >> state, thus we need to check if the dwc3 device had been into suspend state >> when UDC try to stop gadget. >> &

[PATCH v2] usb: dwc3: gadget: Add the suspend state checking when stopping gadget

2016-06-20 Thread Baolin Wang
It will be crash to stop gadget when the dwc3 device had been into suspend state, thus we need to check if the dwc3 device had been into suspend state when UDC try to stop gadget. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/gadget.c |3 +++ 1 file changed, 3 insertions(+) diff --git a

Re: [RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
Hi Felipe, On 21 June 2016 at 15:45, Felipe Balbi wrote: > > Hi Baolin, > > Baolin Wang writes: >>>> -Original Message- >>>> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- >>>> ow...@vger.kernel.org] On Behalf Of Baolin Wang >

[PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang Reviewed-by: Li Jun Tested-by: Li Jun --- drivers/usb

[PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[PATCH v12 3/4] gadget: Integrate with the usb gadget supporting for usb charger

2016-06-21 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function and usb_charger_exit() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang Reviewed-by: Li Jun Tested-by:

[PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang Reviewed-by: Li

[PATCH v12 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-21 Thread Baolin Wang
Li Jun. Changes since v10: - Introduce usb_charger_get_state() function to check charger state. - Remove the mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 18:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> For supporting the usb charger, it adds the usb_charger_init() and >> usb_charger_exit() functions for usb charger initialization and exit. >> >> It will report to the usb char

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:03, Mark Brown wrote: > On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: >> Baolin Wang writes: >> > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct platform_device >> > *pdev) >> > } >> >

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:53, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On 21 June 2016 at 19:03, Mark Brown wrote: >>> On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: >>>> Baolin Wang writes: >>>> > @@

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:49, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Can't you just tie a charger to a UDC and avoid the charger class >>> completely? >> >> Yeah, I also hope so. But we really want something to manage the >> char

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Baolin Wang writes: >>>>> Can't you just tie a charger to a UDC and avoid the charger class >>>>> completely? >>>> >>>> Yeah, I also

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:36, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Baolin Wang writes: >>>>> Baolin Wang writes: >>>>>>> Can't you just tie a charger to a UDC and avoid the charger class >>>>>>&

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 18:25, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> This patch introduces the usb charger driver based on usb gadget that >> makes an enhancement to a power driver. It works well in practice but >> that requires a system with suit

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:53, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>>>>>> Can't you just tie a charger to a UDC and avoid the charger class >>>>>>>>> completely? >>>>>>>> >>>>

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 22:50, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>> This patch introduces the usb charger driver based on usb gadget that >>>> makes an enhancement to a power driver. It works well in practice but >>>> that require

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-23 Thread Baolin Wang
Hi, On 21 June 2016 at 18:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> For supporting the usb charger, it adds the usb_charger_init() and >> usb_charger_exit() functions for usb charger initialization and exit. >> >> It will report to the

[PATCH v13 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-23 Thread Baolin Wang
mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): usb: gadget: Introduce the usb charger framework usb: gadget: Support for the usb charger framework usb: gadget: Integrate with the usb gadget supporting for usb charg

[PATCH v13 1/4] usb: gadget: Introduce the usb charger framework

2016-06-23 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang Reviewed-by: Li Jun Tested-by: Li Jun --- drivers/usb

[PATCH v13 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-23 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[PATCH v13 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-06-23 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function, usb_charger_exit() function and dev_to_uchger() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang Reviewe

[PATCH v13 2/4] usb: gadget: Support for the usb charger framework

2016-06-23 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang Reviewed-by: Li

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-29 Thread Baolin Wang
Hi Felipe, On 29 June 2016 at 16:20, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Baolin Wang writes: >>>> For supporting the usb charger, it adds the usb_charger_init() and >>>> usb_charger_exit() functions for usb charger initializat

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-29 Thread Baolin Wang
On 29 June 2016 at 16:34, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>>> For supporting the usb charger, it adds the usb_charger_init() and >>>>>> usb_charger_exit() functions for usb charger initialization and exit. >>>>

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-29 Thread Baolin Wang
Hi Felipe, On 29 June 2016 at 20:06, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>>>>> For supporting the usb charger, it adds the usb_charger_init() and >>>>>>>> usb_charger_exit() functions for usb charger initialization a

[PATCH v14 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-29 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[PATCH v14 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-29 Thread Baolin Wang
issued in atomic context. Baolin Wang (4): usb: gadget: Introduce the usb charger framework usb: gadget: Support for the usb charger framework usb: gadget: Integrate with the usb gadget supporting for usb charger power: wm831x_power: Support USB charger current limit management dri

[PATCH v14 2/4] usb: gadget: Support for the usb charger framework

2016-06-29 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang Reviewed-by: Li

[PATCH v14 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-06-29 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function, usb_charger_exit() function and dev_to_uchger() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang Reviewe

[PATCH v14 1/4] usb: gadget: Introduce the usb charger framework

2016-06-29 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang Reviewed-by: Li Jun Tested-by: Li Jun --- drivers/usb

[PATCH] usb: gadget: Add the gserial port checking in gs_start_tx()

2016-06-30 Thread Baolin Wang
on to avoid this situation. Signed-off-by: Baolin Wang --- drivers/usb/gadget/function/u_serial.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 3580f19..66a0910 100644 --- a/dr

Re: [PATCH v14 1/4] usb: gadget: Introduce the usb charger framework

2016-06-30 Thread Baolin Wang
Hi Felipe, On 30 June 2016 at 18:30, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> +static ssize_t charger_state_show(struct device *dev, >> + struct device_attribute *attr, >> + char *buf) >

[PATCH v15 2/4] usb: gadget: Support for the usb charger framework

2016-06-30 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang Reviewed-by: Li

[PATCH v15 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-30 Thread Baolin Wang
-by: Mark Brown Signed-off-by: Baolin Wang Acked-by: Lee Jones Acked-by: Charles Keepax Acked-by: Peter Chen Acked-by: Sebastian Reichel --- drivers/power/wm831x_power.c | 69 ++ include/linux/mfd/wm831x/pdata.h |3 ++ 2 files changed, 72

[PATCH v15 1/4] usb: gadget: Introduce the usb charger framework

2016-06-30 Thread Baolin Wang
usb gadget state. This patch doesn't yet integrate with the gadget code, so some functions which rely on the 'gadget' are not completed, that will be implemented in the following patches. Signed-off-by: Baolin Wang Reviewed-by: Li Jun Tested-by: Li Jun --- drivers/usb

[PATCH v15 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger

2016-06-30 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function, usb_charger_exit() function and dev_to_uchger() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang Reviewe

[PATCH v15 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-30 Thread Baolin Wang
n to check charger state. - Remove the mutex lock in usb_charger_set_cur_limit_by_type() function in case will be issued in atomic context. Baolin Wang (4): usb: gadget: Introduce the usb charger framework usb: gadget: Support for the usb charger framework usb: gadget: Integrate with the

[PATCH 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-18 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Signed-off-by: Baolin Wang --- drivers/usb/host/xhci-plat.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci

[PATCH 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-18 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/Kconfig |7 ++ drivers/usb/dwc3

Re: [PATCH 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161118-202029 > config: i386-allmodconfig (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: >

[PATCH v2 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-20 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Signed-off-by: Baolin Wang --- Changes since v1: - No updates. --- drivers/usb/host/xhci-plat.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/usb

[PATCH v2 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang --- Changes since v1: - Add pm_runtime.h head file to avoid

[PATCH v3 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-23 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang --- Changes since v2: - Remove pm_children_suspended() and

[PATCH v3 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-23 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call pm_runtime_get_noresume() in probe() function in case the parent device doesn't call suspend/resume callback by runtime PM now. Signed-off-by: Baolin Wang --- Changes since v2: - Add pm_runtime_get_noresume

[PATCH] usb: xhci: Remove unuseful 'return' statement

2016-11-24 Thread Baolin Wang
Since these 'return' statements are not generally useful in void function, remove them. Signed-off-by: Baolin Wang --- drivers/usb/host/xhci-hub.c |2 -- drivers/usb/host/xhci-mem.c |1 - drivers/usb/host/xhci-ring.c |4 drivers/usb/host/xhci.c |3 --

Re: [PATCH] usb: xhci: Remove unuseful 'return' statement

2016-11-24 Thread Baolin Wang
Hi, On 24 November 2016 at 17:30, Sergei Shtylyov wrote: > Hello. > > On 11/24/2016 11:13 AM, Baolin Wang wrote: > >> Since these 'return' statements are not generally useful in void function, >> remove them. >> >> Signed-off-by: Baolin Wang >

[PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-24 Thread Baolin Wang
Since these 'return' statements are not generally useful in void function, remove them. Also remove one unuseful 'break' statement in xhci_setup_addressable_virt_dev() function. Signed-off-by: Baolin Wang --- Changes since v1: - Add description of removing 'brea

Re: [PATCH v3 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-24 Thread Baolin Wang
> help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161124-012323 > config: x86_64-randconfig-x008-201647 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: &

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-27 Thread Baolin Wang
Hi Mathias, On 24 November 2016 at 19:16, Baolin Wang wrote: > Since these 'return' statements are not generally useful in void > function, remove them. Also remove one unuseful 'break' statement > in xhci_setup_addressable_virt_dev() function. > > Signed-o

[PATCH v4 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-27 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call pm_runtime_get_noresume() in probe() function in case the parent device doesn't call suspend/resume callback by runtime PM now. Signed-off-by: Baolin Wang --- Changes since v3: - Fix kbuild error. Changes

[PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-27 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this requirement. Signed-off-by: Baolin Wang --- Changes since v3: - No updates. Changes since v2

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-11-27 Thread Baolin Wang
On 25 November 2016 at 21:00, Mark Brown wrote: > On Tue, Nov 22, 2016 at 09:40:07AM +1100, NeilBrown wrote: > >> I agree that the question of where the responsibility for information >> aggregation lies is open for discussion. If fact all details on how >> things should work are always open for d

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-27 Thread Baolin Wang
On 28 November 2016 at 15:21, Greg KH wrote: > On Mon, Nov 28, 2016 at 02:29:25PM +0800, Baolin Wang wrote: >> Hi Mathias, >> >> On 24 November 2016 at 19:16, Baolin Wang wrote: >> > Since these 'return' statements are not generally useful in void >

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-28 Thread Baolin Wang
On 28 November 2016 at 23:14, Mathias Nyman wrote: > On 28.11.2016 09:41, Baolin Wang wrote: >> >> On 28 November 2016 at 15:21, Greg KH wrote: >>> >>> On Mon, Nov 28, 2016 at 02:29:25PM +0800, Baolin Wang wrote: >>>> >>>> Hi Mat

Re: [PATCH v2 1/4] usb: host: xhci: dynamically allocate devs array

2016-11-28 Thread Baolin Wang
i.h | 2 +- > 5 files changed, 20 insertions(+), 9 deletions(-) > > Changes since v1: > - accounted for invalid slot 0 which driver assumes to exist. Tested on my dwc3 platform, it can work well as host role. Tested-by: Baolin Wang -- Baolin.wang Best Regards -- To unsubs

[RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
nd queue before trying to halt the xHCI host in xhci_stop_endpoint_command_timeout() function. Signed-off-by: Baolin Wang --- drivers/usb/host/xhci-mem.c | 10 +-- drivers/usb/host/xhci-ring.c | 61 +- drivers/usb/host/xhci.c |8 +-

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 30 November 2016 at 22:09, Mathias Nyman wrote: > On 30.11.2016 11:02, Baolin Wang wrote: >> >> If the hardware never responds to the stop endpoint command, the >> URBs will never be completed, and we might hang the USB subsystem. >> The original watchdog timer i

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
Hi Baolu, On 1 December 2016 at 13:45, Lu Baolu wrote: > Hi, > > On 11/30/2016 05:02 PM, Baolin Wang wrote: >> If the hardware never responds to the stop endpoint command, the >> URBs will never be completed, and we might hang the USB subsystem. >> The original watchdo

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 1 December 2016 at 14:04, Baolin Wang wrote: > Hi Baolu, > > On 1 December 2016 at 13:45, Lu Baolu wrote: >> Hi, >> >> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>> If the hardware never responds to the stop endpoint command, the >>> URBs will

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Baolin Wang
On 1 December 2016 at 14:35, Lu Baolu wrote: > Hi, > > On 12/01/2016 02:04 PM, Baolin Wang wrote: >> Hi Baolu, >> >> On 1 December 2016 at 13:45, Lu Baolu wrote: >>> Hi, >>> >>> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>>>

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 1 December 2016 at 15:44, Lu Baolu wrote: > Hi, > > On 12/01/2016 03:35 PM, Baolin Wang wrote: >> On 1 December 2016 at 14:35, Lu Baolu wrote: >>> Hi, >>> >>> On 12/01/2016 02:04 PM, Baolin Wang wrote: >>>> Hi Baolu, >>&g

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 1 December 2016 at 21:28, Mathias Nyman wrote: > On 01.12.2016 06:54, Baolin Wang wrote: >> >> On 30 November 2016 at 22:09, Mathias Nyman >> wrote: >>> >>> On 30.11.2016 11:02, Baolin Wang wrote: >>>> >>>> >>>> If t

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Baolin Wang
On 2 December 2016 at 09:17, Lu Baolu wrote: > Hi, > > On 12/01/2016 04:03 PM, Baolin Wang wrote: >> On 1 December 2016 at 15:44, Lu Baolu wrote: >>> Hi, >>> >>> On 12/01/2016 03:35 PM, Baolin Wang wrote: >>>> On 1 December 2016 at 14:35, L

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Baolin Wang
grabs the lock and go ahead with checking and setting members > of xhci->current_cmd. > > Cc: # v3.16+ > Signed-off-by: Lu Baolu Nice catch. I was also curious where set xhci->current_cmd to be NULL when current command is freed. Tested-by: Baolin Wang > --- > driver

  1   2   3   4   5   6   >