Re: [PATCH] usb: gadget: f_midi: Add checking if it need align buffer's size to an ep's maxpacketsize

2016-07-10 Thread Baolin Wang
On 8 July 2016 at 21:21, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Some gadget device (such as dwc3 gadget) requires quirk_ep_out_aligned_size >> attribute, which means it need to align the request buffer's size to an ep's >> maxpacketsi

Re: [PATCH] usb: gadget: f_midi: Add checking if it need align buffer's size to an ep's maxpacketsize

2016-07-07 Thread Baolin Wang
On 7 July 2016 at 20:51, Michal Nazarewicz wrote: > On Thu, Jul 07 2016, Baolin Wang wrote: >> Some gadget device (such as dwc3 gadget) requires quirk_ep_out_aligned_size >> attribute, which means it need to align the request buffer's size to an ep's >> m

[PATCH] usb: gadget: f_midi: Add checking if it need align buffer's size to an ep's maxpacketsize

2016-07-07 Thread Baolin Wang
#x27;s maxpacketsize. Signed-off-by: Baolin Wang --- drivers/usb/gadget/function/f_midi.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 58fc199..2e3f11e 100644 --- a/drivers

[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 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

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] 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

[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 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 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

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

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 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

[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

[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 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 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

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

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-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 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: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 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 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 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 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 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

[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

[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 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 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 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

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 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: [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] 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: [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

[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/

[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 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

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

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

[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

[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

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

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
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
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

[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

[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 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 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 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

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&#

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 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 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-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-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
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), >>

[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-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

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-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

[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

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

2016-05-02 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/

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

2016-05-02 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 v10 4/4] power: wm831x_power: Support USB charger current limit management

2016-05-02 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 v10 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-05-02 Thread Baolin Wang
sysfs attributes. - Change the SDP charger default current if gadget is SS. - Remove the 'get_charger_type' callback in gadget->ops. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with the usb gadget s

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

2016-05-02 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

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

2016-04-23 Thread Baolin Wang
Hi Pavel, On 24 April 2016 at 03:53, Pavel Machek wrote: > Hi! > >> +/* >> + * Sysfs attributes: >> + * >> + * These sysfs attributes are used for showing and setting different type >> + * (SDP/DCP/CDP/ACA) chargers' current limitation. >> + */ >> +static ssize_t sdp_limit_show(struct device *dev

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

2016-04-18 Thread Baolin Wang
Hi Jun, On 18 April 2016 at 16:27, Jun Li wrote: >> >> >> >> But another issue is some users may need to get the charger type from >> >> power supply by "power_supply_get_property()" function, we need to >> >> integrate with the power supply things in the usb charger framework, >> >> not user to

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

2016-04-17 Thread Baolin Wang
Hi Felipe, What do you think of this version patchset? Could you review this patchset when you feel free? I really hope to move the usb charger forwards with suggestions. Thanks. On 7 April 2016 at 19:48, Baolin Wang wrote: > Currently the Linux kernel does not provide any standard integrat

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

2016-04-11 Thread Baolin Wang
Hi Jun, Sorry for late reply. >> >> >> >> +/* >> >> >> >> + * usb_charger_detect_type() - detect the charger type manually. >> >> >> >> + * @uchger - usb charger device >> >> >> >> + * >> >> >> >> + * Note: You should ensure you need to detect the charger type >> >> >> >> +manually on your >> >>

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

2016-04-08 Thread Baolin Wang
On 8 April 2016 at 19:27, Jun Li wrote: > > >> -Original Message----- >> From: Baolin Wang [mailto:baolin.w...@linaro.org] >> Sent: Friday, April 08, 2016 7:00 PM >> To: Jun Li >> Cc: ba...@kernel.org; gre...@linuxfoundation.org; s...@kernel.org; >>

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

2016-04-08 Thread Baolin Wang
Hi Jun, >> >> +/* >> >> + * usb_charger_detect_type() - detect the charger type manually. >> >> + * @uchger - usb charger device >> >> + * >> >> + * Note: You should ensure you need to detect the charger type >> >> +manually on your >> >> + * platform. >> >> + * You should call it at the right gad

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

2016-04-08 Thread Baolin Wang
Hi Jun, On 8 April 2016 at 16:04, Jun Li wrote: > Hi, Baolin > >> +/* >> + * usb_charger_detect_type() - detect the charger type manually. >> + * @uchger - usb charger device >> + * >> + * Note: You should ensure you need to detect the charger type manually >> +on your >> + * platform. >> + * You

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

2016-04-07 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 v10 3/4] gadget: Integrate with the usb gadget supporting for usb charger

2016-04-07 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 v10 4/4] power: wm831x_power: Support USB charger current limit management

2016-04-07 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 v10 1/4] gadget: Introduce the usb charger framework

2016-04-07 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 v10 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-04-07 Thread Baolin Wang
sysfs attributes. - Change the SDP charger default current if gadget is SS. - Remove the 'get_charger_type' callback in gadget->ops. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with the usb gadget s

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

2016-04-06 Thread Baolin Wang
00, Felipe Balbi wrote: >>> >> Peter Chen writes: >>> >> > On Wed, Apr 06, 2016 at 10:38:23AM +0300, Felipe Balbi wrote: >>> >> >> Peter Chen writes: >>> >> >> > On Fri, Apr 01, 2016 at 03:21:49PM +08

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

2016-04-06 Thread Baolin Wang
On 6 April 2016 at 16:26, Jun Li wrote: > Hi > >> + */ >> +static enum usb_charger_type >> +usb_charger_get_type_by_others(struct usb_charger *uchger) { >> + if (uchger->type != UNKNOWN_TYPE) >> + return uchger->type; >> + >> + if (uchger->psy) { >> + union power_su

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

2016-04-06 Thread Baolin Wang
On 6 April 2016 at 15:19, Peter Chen wrote: > On Fri, Apr 01, 2016 at 03:21:50PM +0800, Baolin Wang wrote: >> >> @@ -563,6 +564,8 @@ struct usb_gadget_ops { >> struct usb_ep *(*match_ep)(struct usb_gadget *, >> str

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

2016-04-05 Thread Baolin Wang
On 5 April 2016 at 17:43, Peter Chen wrote: > On Tue, Apr 05, 2016 at 05:34:02PM +0800, Baolin Wang wrote: >> On 5 April 2016 at 16:12, Peter Chen wrote: >> > On Tue, Apr 05, 2016 at 03:54:31PM +0800, Baolin Wang wrote: >> >> Hi Peter, >> >> >>

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

2016-04-05 Thread Baolin Wang
On 5 April 2016 at 15:56, Peter Chen wrote: > On Fri, Apr 01, 2016 at 03:21:49PM +0800, Baolin Wang wrote: >> + >> +int devm_usb_charger_register(struct device *dev, >> + struct usb_charger *uchger) >> +{ >> + struct us

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

2016-04-05 Thread Baolin Wang
On 5 April 2016 at 16:12, Peter Chen wrote: > On Tue, Apr 05, 2016 at 03:54:31PM +0800, Baolin Wang wrote: >> Hi Peter, >> >> On 5 April 2016 at 14:46, Peter Chen wrote: >> > >> > We are thinking USB charger framework for Freescale i.mx SoC series, >&g

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

2016-04-05 Thread Baolin Wang
Hi Peter, On 5 April 2016 at 14:46, Peter Chen wrote: > > We are thinking USB charger framework for Freescale i.mx SoC series, > since our internal framework is not good enough. > So I have more questions for your framework since there are many > different USB charger designs, and I hope it is un

<    1   2   3   4   5   6   >