All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: NeilBrown <neilb@suse.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	robh@kernel.org, Jun Li <jun.li@nxp.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	Peter Chen <peter.chen@freescale.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	grygorii.strashko@ti.com,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Mark Brown <broonie@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	patches@opensource.wolfsonmicro.com,
	Linux PM list <linux-pm@vger.kernel.org>,
	USB <linux-usb@vger.kernel.org>,
	device-mainlining@lists.linuxfoundation.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v19 0/4] Introduce usb charger framework to deal with the usb gadget power negotation
Date: Thu, 30 Mar 2017 11:16:59 +0800	[thread overview]
Message-ID: <CAMz4ku+PAn3nUGg7gs04cPHhn16cKgNv_+duv-kz0GqOEYTYkQ@mail.gmail.com> (raw)
In-Reply-To: <8737dx6m0b.fsf@notabene.neil.brown.name>

Hi,

On 29 March 2017 at 07:04, NeilBrown <neilb@suse.com> wrote:
> On Tue, Mar 07 2017, Baolin Wang wrote:
>
>> On 3 March 2017 at 10:23, NeilBrown <neilb@suse.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

WARNING: multiple messages have this Message-ID (diff)
From: Baolin Wang <baolin.wang@linaro.org>
To: NeilBrown <neilb@suse.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	robh@kernel.org, Jun Li <jun.li@nxp.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	Peter Chen <peter.chen@freescale.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	grygorii.strashko@ti.com,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Mark Brown <broonie@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	patches@opensource.wolfsonmicro.com,
	Linux PM list <linux-pm@vger.kernel.org>,
	USB <linux-usb@vger.kernel.org>,
	device-mainlining@lists.linuxfou
Subject: Re: [PATCH v19 0/4] Introduce usb charger framework to deal with the usb gadget power negotation
Date: Thu, 30 Mar 2017 11:16:59 +0800	[thread overview]
Message-ID: <CAMz4ku+PAn3nUGg7gs04cPHhn16cKgNv_+duv-kz0GqOEYTYkQ@mail.gmail.com> (raw)
In-Reply-To: <8737dx6m0b.fsf@notabene.neil.brown.name>

Hi,

On 29 March 2017 at 07:04, NeilBrown <neilb@suse.com> wrote:
> On Tue, Mar 07 2017, Baolin Wang wrote:
>
>> On 3 March 2017 at 10:23, NeilBrown <neilb@suse.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

  reply	other threads:[~2017-03-30  3:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  8:51 [PATCH v19 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2017-02-20  8:51 ` [PATCH v19 1/4] usb: gadget: Introduce the usb charger framework Baolin Wang
2017-02-20  8:51   ` Baolin Wang
2017-02-20  8:51 ` [PATCH v19 2/4] usb: gadget: Support for " Baolin Wang
2017-02-20 10:08   ` kbuild test robot
2017-02-20 10:08     ` kbuild test robot
2017-02-20 10:18     ` Baolin Wang
2017-02-20 10:18       ` Baolin Wang
2017-02-20  8:51 ` [PATCH v19 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger Baolin Wang
2017-02-20  8:51 ` [PATCH v19 4/4] power: wm831x_power: Support USB charger current limit management Baolin Wang
2017-02-20  8:51   ` Baolin Wang
2017-02-20 10:20   ` kbuild test robot
2017-02-20 10:20     ` kbuild test robot
2017-03-03  2:23 ` [PATCH v19 0/4] Introduce usb charger framework to deal with the usb gadget power negotation NeilBrown
2017-03-03  2:23   ` NeilBrown
2017-03-07  9:38   ` Baolin Wang
2017-03-07  9:38     ` Baolin Wang
2017-03-09  1:50     ` Jun Li
2017-03-09  1:50       ` Jun Li
2017-03-09  6:10       ` Baolin Wang
2017-03-09  6:10         ` Baolin Wang
2017-03-09 10:34         ` Jun Li
2017-03-09 10:34           ` Jun Li
2017-03-09 11:22           ` Baolin Wang
2017-03-09 11:22             ` Baolin Wang
2017-03-10  6:30             ` Jun Li
2017-03-10  6:30               ` Jun Li
2017-03-10  7:15               ` Baolin Wang
2017-03-10  7:15                 ` Baolin Wang
2017-03-10  8:27                 ` Jun Li
2017-03-10  8:27                   ` Jun Li
2017-03-10 10:52                   ` Baolin Wang
2017-03-10 10:52                     ` Baolin Wang
2017-03-13  1:09                     ` Jun Li
2017-03-13  1:09                       ` Jun Li
2017-03-13  8:43                       ` Baolin Wang
2017-03-13  8:43                         ` Baolin Wang
2017-03-14  1:10                         ` Jun Li
2017-03-14  1:10                           ` Jun Li
2017-03-14  2:03                           ` Baolin Wang
2017-03-14  2:03                             ` Baolin Wang
2017-03-28 23:04     ` NeilBrown
2017-03-28 23:04       ` NeilBrown
2017-03-30  3:16       ` Baolin Wang [this message]
2017-03-30  3:16         ` Baolin Wang
2017-03-14  9:57 ` Lee Jones
2017-03-14 10:39   ` Baolin Wang
2017-03-14 10:39     ` Baolin Wang
2017-03-14 12:14     ` Lee Jones
2017-03-14 12:14       ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMz4ku+PAn3nUGg7gs04cPHhn16cKgNv_+duv-kz0GqOEYTYkQ@mail.gmail.com \
    --to=baolin.wang@linaro.org \
    --cc=balbi@kernel.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=dbaryshkov@gmail.com \
    --cc=device-mainlining@lists.linuxfoundation.org \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=grygorii.strashko@ti.com \
    --cc=john.stultz@linaro.org \
    --cc=jun.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=neilb@suse.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=peter.chen@freescale.com \
    --cc=robh@kernel.org \
    --cc=ruslan.bilovol@gmail.com \
    --cc=sre@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.