[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bn2uomzd.fsf@linux.intel.com>
Date: Tue, 21 Jun 2016 13:27:50 +0300
From: Felipe Balbi <balbi@...nel.org>
To: Baolin Wang <baolin.wang@...aro.org>, gregkh@...uxfoundation.org,
sre@...nel.org, dbaryshkov@...il.com, dwmw2@...radead.org
Cc: robh@...nel.org, jun.li@....com, m.szyprowski@...sung.com,
ruslan.bilovol@...il.com, peter.chen@...escale.com,
stern@...land.harvard.edu, r.baldyga@...sung.com,
grygorii.strashko@...com, yoshihiro.shimoda.uh@...esas.com,
lee.jones@...aro.org, broonie@...nel.org,
ckeepax@...nsource.wolfsonmicro.com,
patches@...nsource.wolfsonmicro.com, baolin.wang@...aro.org,
linux-pm@...r.kernel.org, linux-usb@...r.kernel.org,
device-mainlining@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 2/4] gadget: Support for the usb charger framework
Hi,
Baolin Wang <baolin.wang@...aro.org> 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 charger when the gadget state is changed,
> then the usb charger can do the power things.
>
> Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
> Reviewed-by: Li Jun <jun.li@....com>
> Tested-by: Li Jun <jun.li@....com>
Before anything, I must say that I really liked this patch. It's
minimaly invasive to udc core and does all the necessary changes. If it
wasn't for the extra charger class, this would've been perfect.
Can't you just tie a charger to a UDC and avoid the charger class
completely?
> static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
> {
> + if (gadget->charger)
I guess you could do this check inside
usb_gadget_set_cur_limit_by_type() itself.
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)
Powered by blists - more mailing lists