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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> 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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> This patch introduces the usb charger driver based on usb gadget that >>>> makes an enhancement to a power driver.

[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 <baolin.w...@linaro.

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>> Can't you just tie a charger to a UDC and avoid the charger

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> This patch introduces the usb charger driver based on usb gadget that >> makes an enhancement to a power driver. It works well in pr

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>> Baolin Wang <baolin.w...@linaro.org> writes: >>>&

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 <ba...@kernel.org> wrote: > > Hi Baolin, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> -Original Message- >>>> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- >>>&g

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

2016-06-21 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> Reviewed-by: Li Jun <jun...@nxp.com> Tested-by:

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

2016-06-21 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

[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 <baolin.w...@linaro.org> Reviewed-by: Li Ju

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

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

2016-06-23 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> Reviewed-by: Li Jun <jun...@nxp.com> Tested-by:

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

2016-06-23 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

[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 <baolin.w...@linaro.

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

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> For supporting the usb charger, it adds the usb_charger_init() and >> usb_charger_exit() functions for usb charger initializ

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

2016-06-17 Thread Baolin Wang
Hi Felipe, On 13 June 2016 at 23:13, Jun Li <jun...@nxp.com> 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

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>> Baolin Wang <baolin.w...@linaro.org> writes: >>>> For supporting the usb charger, it adds the usb_charger_i

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> For supporting the usb charger, it adds the usb_charger_init() and >>>>>> usb_char

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

2016-01-24 Thread Baolin Wang
On 25 January 2016 at 11:44, Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Jan 04, 2016 at 11:04:26AM +0800, Baolin Wang wrote: >> Currently the Linux kernel does not provide any standard integration of this >> feature that integrates the USB subsystem with the sy

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

2016-03-18 Thread Baolin Wang
On 16 March 2016 at 19:48, Felipe Balbi <ba...@kernel.org> wrote: > > Hi Baolin, > > Baolin Wang <baolin.w...@linaro.org> writes: >> [ text/plain ] >> Currently the Linux kernel does not provide any standard integration of this >> feature that integrat

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

2016-03-18 Thread Baolin Wang
On 16 March 2016 at 20:09, Oliver Neukum <oneu...@suse.com> wrote: > On Wed, 2016-03-16 at 19:46 +0800, Baolin Wang wrote: >> 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 >

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

2016-03-28 Thread Baolin Wang
On 29 March 2016 at 08:32, Peter Chen <peter.c...@nxp.com> wrote: > >> >> On 28 March 2016 at 15:13, Peter Chen <hzpeterc...@gmail.com> wrote: >> > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote: >> >> On 25 March 2016 at 15:09, Peter Ch

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 14:18, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> [ text/plain ] >> On 30 March 2016 at 19:24, Felipe Balbi <ba...@kernel.org> wrote: >>>>> >> >> >

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 18:58, Jun Li wrote: >> >> >> > Seems you don't want to guarantee charger type detection is done >> >> >> > before gadget connection(pullup DP), right? >> >> >> > I see you call usb_charger_detect_type() in each gadget usb >> >> >> > state >> >> >> changes. >>

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 19:24, Felipe Balbi wrote: >>> >> >> > >>> >> >> > Seems you don't want to guarantee charger type detection is done >>> >> >> > before gadget connection(pullup DP), right? >>> >> >> > I see you call usb_charger_detect_type() in each gadget usb >>> >> >> >

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

2016-03-31 Thread Baolin Wang
gt;> + return -EINVAL; >> + >> + device_unregister(>dev); >> + return 0; >> +} >> + >> +static void devm_uchger_dev_unreg(struct device *dev, void *res) >> +{ >> + usb_charger_unregister(*(struct usb_charger **)res); >> +} >>

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 14:12, Jun Li <jun...@nxp.com> wrote: > Hi > >> -Original Message----- >> From: Baolin Wang [mailto:baolin.w...@linaro.org] >> Sent: Thursday, March 31, 2016 1:23 PM >> To: Jun Li <jun...@nxp.com> >> Cc: Peter Chen <hzp

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 14:42, Felipe Balbi wrote: +#define DEFAULT_CUR_PROTECT (50) >>> >>> Where is this coming from ? Also, () are not necessary. >> >> Just want to protect the default current limitation. If that does not >> need, I'll remove it. > > It's your HW :-) You

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 16:18, Felipe Balbi <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >>>>> >>>>> According to

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 16:15, Felipe Balbi <ba...@kernel.org> wrote: > > Hi Baolin, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> >> Make sense. In our company's solution, charger detection can be done >>>> >> by hardware from PMIC a

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

[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 <baolin.w...@linaro.org> --- drivers/usb/gadg

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

2016-04-07 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

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

2016-04-07 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

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

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 <hzpeterc...@gmail.com> 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 *, >>

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) { >> +

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

2016-04-07 Thread Baolin Wang
...@gmail.com> writes: >>> > On Wed, Apr 06, 2016 at 11:05:26AM +0300, Felipe Balbi wrote: >>> >> Peter Chen <hzpeterc...@gmail.com> writes: >>> >> > On Wed, Apr 06, 2016 at 10:38:23AM +0300, Felipe Balbi wrote: >>> >> >> Peter C

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 <jun...@nxp.com> wrote: > > >> -Original Message----- >> From: Baolin Wang [mailto:baolin.w...@linaro.org] >> Sent: Friday, April 08, 2016 7:00 PM >> To: Jun Li <jun...@nxp.com> >> Cc: ba...@kernel.org; gre...@

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

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

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

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

2016-03-19 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger should get the type by the 'get_charger_type' callback which is implemented by the usb gadget operations, and get the usb charger pointer from struct 'usb_gadget'. Signed-off-by: Baolin Wang <baolin.w...@linaro.

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

2016-03-20 Thread Baolin Wang
On 16 March 2016 at 19:20, Mark Brown <broo...@kernel.org> wrote: > On Wed, Mar 16, 2016 at 01:05:27PM +0200, Felipe Balbi wrote: >> Mark Brown <broo...@kernel.org> writes: >> > On Mon, Feb 29, 2016 at 11:22:12PM +0900, Mark Brown wrote: >> >> On Mon, Jan

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

2016-03-20 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

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

2016-03-24 Thread Baolin Wang
will implemented by user for usb gadget operations to get the usb charger type. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/gadget/udc/udc-core.c | 11 +++ include/linux/usb/gadget.h| 11 +++ 2 files changed, 22 insertions(+) diff

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

2016-03-24 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger should get the type by the 'get_charger_type' callback which is implemented by the usb gadget operations, and get the usb charger pointer from struct 'usb_gadget'. Signed-off-by: Baolin Wang <baolin.w...@linaro.

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

2016-03-24 Thread Baolin Wang
detection. - Supply the notification mechanism to userspace when charger state is changed. - Integrate with the vbus staff in the gadget API. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with the usb gadget supporting

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

2016-03-24 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

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

2016-03-24 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

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

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 <hzpeterc...@gmail.com> 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) >> +{

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 <hzpeterc...@gmail.com> 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 <hzpeterc...@gmail.com> wrote: >> > >> > We are thinking

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 <hzpeterc...@gmail.com> wrote: > On Tue, Apr 05, 2016 at 05:34:02PM +0800, Baolin Wang wrote: >> On 5 April 2016 at 16:12, Peter Chen <hzpeterc...@gmail.com> wrote: >> > On Tue, Apr 05, 2016 at 03:54:31PM +0800, Bao

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 17:19, Peter Chen <hzpeterc...@gmail.com> wrote: > On Wed, Mar 30, 2016 at 04:40:31PM +0800, Baolin Wang wrote: >> >> > - Third, since composite driver covers 500mA (and more for CDP) after >> >> > set >> >> > config

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 16:07, Jun Li wrote: > Hi >> On 30 March 2016 at 10:54, Jun Li wrote: >> >> >> It is not for udc driver but for power users who want to negotiate >> >> >> with USB subsystem. >> >> >> >> >> > >> >> > Seems you don't want to guarantee charger

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 15:42, Peter Chen <hzpeterc...@gmail.com> wrote: > On Wed, Mar 30, 2016 at 03:07:49PM +0800, Baolin Wang wrote: >> On 30 March 2016 at 10:05, Peter Chen <hzpeterc...@gmail.com> wrote: >> > On Tue, Mar 29, 2016 at 10:23:14AM -0700, Mark Brown wro

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

2016-04-01 Thread Baolin Wang
. Baolin Wang (4): gadget: Introduce the usb charger framework gadget: Support for the usb charger framework gadget: Integrate with the usb gadget supporting for usb charger power: wm831x_power: Support USB charger current limit management drivers/power/wm831x_power.c | 69

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

2016-04-01 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

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

2016-04-01 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger should get the type by the 'get_charger_type' callback which is implemented by the usb gadget operations, and get the usb charger pointer from struct 'usb_gadget'. Signed-off-by: Baolin Wang <baolin.w...@linaro.

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

2016-04-01 Thread Baolin Wang
will implemented by user for usb gadget operations to get the usb charger type. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> --- drivers/usb/gadget/udc/udc-core.c | 11 +++ include/linux/usb/gadget.h| 15 +++ 2 files changed, 26 insertions(+) diff

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

2016-04-01 Thread Baolin Wang
-by: Mark Brown <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

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

2016-03-28 Thread Baolin Wang
On 25 March 2016 at 15:09, Peter Chen <hzpeterc...@gmail.com> wrote: > On Thu, Mar 24, 2016 at 08:35:53PM +0800, Baolin Wang wrote: >> Currently the Linux kernel does not provide any standard integration of this >> feature that integrates the USB subsystem with the sy

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

2016-03-28 Thread Baolin Wang
On 28 March 2016 at 15:13, Peter Chen <hzpeterc...@gmail.com> wrote: > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote: >> On 25 March 2016 at 15:09, Peter Chen <hzpeterc...@gmail.com> wrote: >> > On Thu, Mar 24, 2016 at 08:35:53PM +0800, Baolin Wang wr

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

2016-03-29 Thread Baolin Wang
On 29 March 2016 at 16:45, Jun Li <jun...@nxp.com> wrote: > > >> -Original Message- >> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- >> ow...@vger.kernel.org] On Behalf Of Baolin Wang >> Sent: Monday, March 28, 2016 2:52 PM >> To: Peter

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 10:54, Jun Li wrote: >> >> It is not for udc driver but for power users who want to negotiate >> >> with USB subsystem. >> >> >> > >> > Seems you don't want to guarantee charger type detection is done >> > before gadget connection(pullup DP), right? >> > I see

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

2016-03-30 Thread Baolin Wang
On 30 March 2016 at 10:05, Peter Chen <hzpeterc...@gmail.com> wrote: > On Tue, Mar 29, 2016 at 10:23:14AM -0700, Mark Brown wrote: >> On Mon, Mar 28, 2016 at 03:13:51PM +0800, Peter Chen wrote: >> > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote: >>

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 18:06, Felipe Balbi <ba...@kernel.org> wrote: > Baolin Wang <baolin.w...@linaro.org> writes: >> [ text/plain ] >> On 31 March 2016 at 16:18, Felipe Balbi <ba...@kernel.org> wrote: >>> >>> Hi, >>> >&g

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

[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

[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 <baolin.w...@linaro.org> --- 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 <baoli

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

2016-05-20 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>> >>>> Because when

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> Make sense. >>>>> >>>>> cool, if you wanna work on it, let me know and I can give some details

[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 <baolin.w...@linaro.org> --- drivers/usb/dwc3/gadget.c | 26 +-

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>> >>>> Because when the 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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >> Currently on some platforms, the gadget device can be power off to >> save power when the Vbus is off, which means no cable p

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>>> index 6254b2f..dada5c6 100644 >>>> ---

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

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 <baolin.w...@linaro.org> wrote: > On 17 May 2016 at 17:25, Felipe Balbi <ba...@kernel.org> wrote: >> >> Hi, >> >> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>> Make sense.

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>>>> @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget >>>>>> *g, >>>>>

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 >>>> *dwc, int is_on, int suspend)

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 <ba...@kernel.org> wrote: > > Hi, > > Baolin Wang <baolin.w...@linaro.org> writes: >>>> Baolin Wang <baolin.w...@linaro.org> writes: >>>>>>>>> Make sense. >>>>>>>> >

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

2016-05-02 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> --- drivers/usb/gadget/Kconfig |7 + drive

[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 <baolin.w...@linaro.org> --- 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 <broo...@kernel.org> Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Lee Jones <lee.jo...@linaro.org> Acked-by: Charles Keepax <ckee...@opensource.wolfsonmicro.com> Acked-by: Peter Chen <peter.c...@freescale.com> Acked-by: Seba

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

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

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 <baolin.w...@linaro.org> wrote: > Currently the Linux kernel does no

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,

Re: [PATCH 1/4] usb: gadget: f_midi: fixed endianness when using wMaxPacketSize

2016-07-25 Thread Baolin Wang
Hi, On 26 July 2016 at 07:15, Felipe F. Tonello wrote: > USB spec specifies wMaxPacketSize to be little endian (as other properties), > so when using this variable in the driver we should convert to the current > CPU endianness if necessary. > > Signed-off-by: Felipe F.

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

2016-07-26 Thread Baolin Wang
Hi Felipe, On 26 July 2016 at 19:06, Felipe Ferreri Tonello <e...@felipetonello.com> wrote: > Hi Baolin, > > Sorry for not replying for previous emails because for some reason these > emails were archived. :( > > On 12/07/16 10:01, Baolin Wang wrote: >> Some gadg

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

2016-07-12 Thread Baolin Wang
. Signed-off-by: Baolin Wang <baolin.w...@linaro.org> Acked-by: Michal Nazarewicz <min...@mina86.com> --- Changelog: v2: - Simplify the method to get buffer length. v1: - Remove the in_ep modification. - Remove max_t() function. drivers/usb/gadget/function/f_midi.c | 11 +++

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

2016-08-01 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 <baoli

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

2016-08-01 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 <baolin.w...@linaro.

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

2016-08-01 Thread Baolin Wang
or 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 <baolin.w...@linaro.org> Reviewed-by: Li Jun <jun...@nxp.com> Tested-by:

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

2016-08-01 Thread Baolin Wang
ic 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 drivers/power/wm831x_power.c

<    1   2   3   4   5   6   >