[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMz4ku+PAn3nUGg7gs04cPHhn16cKgNv_+duv-kz0GqOEYTYkQ@mail.gmail.com>
Date: Thu, 30 Mar 2017 11:16:59 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: NeilBrown <neilb@...e.com>
Cc: Felipe Balbi <balbi@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>,
Sebastian Reichel <sre@...nel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
David Woodhouse <dwmw2@...radead.org>, robh@...nel.org,
Jun Li <jun.li@....com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Ruslan Bilovol <ruslan.bilovol@...il.com>,
Peter Chen <peter.chen@...escale.com>,
Alan Stern <stern@...land.harvard.edu>,
grygorii.strashko@...com,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Mark Brown <broonie@...nel.org>,
John Stultz <john.stultz@...aro.org>,
Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>,
patches@...nsource.wolfsonmicro.com,
Linux PM list <linux-pm@...r.kernel.org>,
USB <linux-usb@...r.kernel.org>,
device-mainlining@...ts.linuxfoundation.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v19 0/4] Introduce usb charger framework to deal with the
usb gadget power negotation
Hi,
On 29 March 2017 at 07:04, NeilBrown <neilb@...e.com> wrote:
> On Tue, Mar 07 2017, Baolin Wang wrote:
>
>> On 3 March 2017 at 10:23, NeilBrown <neilb@...e.com> wrote:
>>
>>>
>>> I understand your reluctance to change drivers that you cannot test.
>>> An alternative it do change all the
>>> atomic_notifier_call_chain(.*notifier,
>>> calls that don't pass a pointer to vbus_draw to pass NULL, and to
>>> declare the passing of NULL to be deprecated (so hopefully people won't
>>> use it in new code).
>>> Then any notification callback that expects a current can just ignore
>>> calls where the pointer is NULL.
>>
>> I am afraid if it is enough to send out vbus draw information from USB
>> phy driver, for example you will miss super speed (900mA), which need
>> get the speed information from gadget driver.
>
> When the gadget driver determines that 900mA is available, it calls
> usb_phy_set_power() which calls the ->set_power() method on the usb_phy.
> The usb_phy the uses the notifier to inform all interested parties
> that 900mA is available.
That is one possible way. Now we only set vbus draw by
usb_gadget_vbus_draw() after setting config and suspend/resume usb
device. Maybe we can add one condition in usb_gadget_vbus_draw() like:
if (mA >= 500 && gadet->speed >= SUPER_SPEED)
mA = 900;
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists