Hi

> -----Original Message-----
> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb-
> ow...@vger.kernel.org] On Behalf Of Baolin Wang
> Sent: Wednesday, April 06, 2016 6:47 PM
> To: Peter Chen <hzpeterc...@gmail.com>
> Cc: Felipe Balbi <ba...@kernel.org>; Greg KH <gre...@linuxfoundation.org>;
> Sebastian Reichel <s...@kernel.org>; Dmitry Eremin-Solenikov
> <dbarysh...@gmail.com>; David Woodhouse <dw...@infradead.org>; Peter Chen
> <peter.c...@freescale.com>; Alan 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.com>; patc...@opensource.wolfsonmicro.com;
> Linux PM list <linux...@vger.kernel.org>; USB <linux-usb@vger.kernel.org>;
> device-mainlin...@lists.linuxfoundation.org; LKML <linux-
> 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> 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 *,
> >>                       struct usb_ss_ep_comp_descriptor *);
> >> +     /* get the charger type */
> >> +     enum usb_charger_type (*get_charger_type)(struct usb_gadget *);
> >>  };
> >
> > 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? I also don't catch the intent of
This api, as my understanding, gadget only need report gadget state changes.
All information required for usb charger is charger type and gadget state.

Li Jun

Reply via email to