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

2016-04-06 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> > In below change of usb_gadget_vbus_draw(), already can get charger >> >> > type via usb_charger_get_type(). >> >> > >> >> > static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, >> >> > unsigned mA) { >> >> > + enum

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

2016-04-06 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> > In below change of usb_gadget_vbus_draw(), already can get charger >> >> > type via usb_charger_get_type(). >> >> > >> >> > static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, >> >> > unsigned mA) { >> >> > + enum usb_charger_type type; >> >>

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

2016-04-06 Thread Peter Chen
On Wed, Apr 06, 2016 at 04:58:03PM +0300, Felipe Balbi wrote: > > Hi, > > Jun Li writes: > >> >> >> > Since we already have get_charger_type callback at usb_charger > >> >> >> > structure, why we still need this API at usb_gadget_ops? > >> >> >> > >> >> >> In case some users

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

2016-04-06 Thread Peter Chen
On Wed, Apr 06, 2016 at 04:58:03PM +0300, Felipe Balbi wrote: > > Hi, > > Jun Li writes: > >> >> >> > Since we already have get_charger_type callback at usb_charger > >> >> >> > structure, why we still need this API at usb_gadget_ops? > >> >> >> > >> >> >> In case some users want to get charger

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

2016-04-06 Thread Felipe Balbi
Hi, Jun Li writes: >> >> >> > Since we already have get_charger_type callback at usb_charger >> >> >> > structure, why we still need this API at usb_gadget_ops? >> >> >> >> >> >> In case some users want to get charger type at gadget level. >> >> >> >> >> > Why gadget needs to

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

2016-04-06 Thread Felipe Balbi
Hi, Jun Li writes: >> >> >> > Since we already have get_charger_type callback at usb_charger >> >> >> > structure, why we still need this API at usb_gadget_ops? >> >> >> >> >> >> In case some users want to get charger type at gadget level. >> >> >> >> >> > Why gadget needs to know charger type?

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

2016-04-06 Thread Jun Li
linux-...@vger.kernel.org>; > device-mainlin...@lists.linuxfoundation.org; LKML ker...@vger.kernel.org> > Subject: RE: [PATCH v9 2/4] gadget: Support for the usb charger framework > > > Hi, > > Jun Li <jun...@nxp.com> writes: > >> >> On 6 April 20

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

2016-04-06 Thread Jun Li
ern ; r.bald...@samsung.com; Yoshihiro > Shimoda ; Lee Jones > ; Mark Brown ; Charles Keepax > ; patc...@opensource.wolfsonmicro.com; > Linux PM list ; USB ; > device-mainlin...@lists.linuxfoundation.org; LKML ker...@vger.kernel.org> > Subject: RE: [PATCH v9 2/4] gadget:

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

2016-04-06 Thread Felipe Balbi
Hi, Jun Li writes: >> >> 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

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

2016-04-06 Thread Felipe Balbi
Hi, Jun Li writes: >> >> 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 *, >> >> >>

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

2016-04-06 Thread Jun Li
t; Stern <st...@rowland.harvard.edu>; r.bald...@samsung.com; Yoshihiro > >> Shimoda <yoshihiro.shimoda...@renesas.com>; Lee Jones > >> <lee.jo...@linaro.org>; Mark Brown <broo...@kernel.org>; Charles > >> Keepax <ckee...@opensource.wolfsonmicro.c

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

2016-04-06 Thread Jun Li
ern ; r.bald...@samsung.com; Yoshihiro > Shimoda ; Lee Jones > ; Mark Brown ; Charles Keepax > ; patc...@opensource.wolfsonmicro.com; > Linux PM list ; USB ; > device-mainlin...@lists.linuxfoundation.org; LKML ker...@vger.kernel.org> > Subject: RE: [PATCH v9 2/4] gadget:

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

2016-04-06 Thread Felipe Balbi
e.wolfsonmicro.com>; patc...@opensource.wolfsonmicro.com; >> Linux PM list <linux...@vger.kernel.org>; USB <linux-...@vger.kernel.org>; >> device-mainlin...@lists.linuxfoundation.org; LKML > ker...@vger.kernel.org> >> Subject: Re: [PATCH v9 2/4] gadget: Support

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

2016-04-06 Thread Felipe Balbi
USB ; >> device-mainlin...@lists.linuxfoundation.org; LKML > ker...@vger.kernel.org> >> Subject: Re: [PATCH v9 2/4] gadget: Support for the usb charger framework >> >> On 6 April 2016 at 15:19, Peter Chen wrote: >> > On Fri, Apr 01, 2016 at 03:21:50PM +080

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

2016-04-06 Thread Jun Li
;linux...@vger.kernel.org>; USB <linux-...@vger.kernel.org>; > device-mainlin...@lists.linuxfoundation.org; LKML ker...@vger.kernel.org> > Subject: Re: [PATCH v9 2/4] gadget: Support for the usb charger framework > > On 6 April 2016 at 15:19, Peter Chen <hzpeterc...@gmail.com&

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

2016-04-06 Thread Jun Li
v > ; David Woodhouse ; Peter Chen > ; Alan Stern ; > r.bald...@samsung.com; Yoshihiro Shimoda > ; Lee Jones ; Mark > Brown ; Charles Keepax > ; patc...@opensource.wolfsonmicro.com; > Linux PM list ; USB ; > device-mainlin...@lists.linuxfoundation.org; LKML ker...@vger.ker

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 *, >> struct usb_endpoint_descriptor *,

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 *, >> struct usb_endpoint_descriptor *, >>

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

2016-04-06 Thread Peter Chen
On Fri, Apr 01, 2016 at 03:21:50PM +0800, Baolin Wang wrote: > 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

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

2016-04-06 Thread Peter Chen
On Fri, Apr 01, 2016 at 03:21:50PM +0800, Baolin Wang wrote: > 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

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

2016-04-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. Introduce a callback 'get_charger_type' which

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

2016-04-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. Introduce a callback 'get_charger_type' which