From: NeilBrown <neilb@suse.com>
To: Mark Brown <broonie@kernel.org>
Cc: Baolin Wang <baolin.wang@linaro.org>,
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>,
r.baldyga@samsung.com, grygorii.strashko@ti.com,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Lee Jones <lee.jones@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-m
Subject: Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation
Date: Tue, 13 Sep 2016 10:00:28 +0200 [thread overview]
Message-ID: <877fag1b6r.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20160912152627.GA27946@sirena.org.uk>
[-- Attachment #1: Type: text/plain, Size: 3662 bytes --]
On Mon, Sep 12 2016, Mark Brown wrote:
> [ Unknown signature status ]
> On Mon, Sep 12, 2016 at 03:27:18PM +0200, NeilBrown wrote:
>> On Mon, Sep 12 2016, Mark Brown wrote:
>
>> > It's no worse than any other board file situation - if someone has that
>> > problem they get to fix it.
>
>> My point is that the present design does not appear to scale beyond a
>> single USB power supply (as if there were two, they would be named in
>> discovery order, which is not reliably stable).
>
> For the practical purposes of people making systems (as opposed to
> upstream where this is likely to get most use) it pretty much is.
> Though quite how many systems have multiple chargers is itself also a
> question.
>
>> Your point is, I think, that when someone actually cares about that lack
>> of scaling, they can fix it.
>
> Yes.
>
>> I am perfectly happy with that approach. However if the code doesn't
>> scale beyond one charger, it shouldn't pretend that it does.
>> i.e.
>> Don't have "usb_charger_find_by_name()", just a global "usb_charger"
>> (or similar).
>> The first charger to register gets to be the "usb_charger". The
>> second one gets an error.
>> I could be quite happy with that sort of interface.
>
> Well, a fairly standard way of extending would be to allow the explicit
> assignment of names to chargers so this'd avoid such churn.
Sure, that might work. I'm just against a design that obviously cannot
work.
>
>> > The whole point from the point of view of the wm831x driver is that it
>> > just wants something to tell it how much current it's allowed to draw, I
>> > appreciate that doesn't change your analysis of the bit in the middle
>> > but the consumer driver bit seems fine here.
>
>> Yes, the wm831x driver probably does the right thing.
>> Other drivers might want to know not only the minimum they are allowed
>> to draw, but also the maximum they should try even if they are carefully
>> monitoring the voltage.
>> So wm831x is doing the right thing with the wrong interface. Maybe you
>> can describe that as "fine".
>
> That's not actually 100% clear to me - for what the wm831x is doing it
> probably *does* want the higher limit. This is a system inflow limit
> (as it should be for this), at least the charger will adapt to voltage
> variations though other users in the system are much less likely to do
> so.
Interesting ... I hadn't considered that possibility.
As long as the current remains below the maximum, the charger will
reduce the voltage towards 2V as load increases. Somewhere before it
gets there, the system will not be able to make use of the power as the
voltage will be too low to be usable. So that will naturally limit the
current being drawn.
Not having very much electrical engineering background, I cannot say for
sure what will happen, but it seems likely that once the voltage drops
much below 4.75V, the charger won't be operating at peak efficiency,
which would be a waste.
I can easily imagine that the hardware would switch off at some voltage
level, rather than just making do with what is there.
So I'm skeptical of this approach, but I'm open to being corrected by
someone more knowledgeable than I.
Looking at it from a different perspective, according to the patch set,
the limits that wm831x is able to impose are:
+ 0,
+ 2,
+ 100,
+ 500,
+ 900,
+ 1500,
+ 1800,
+ 550,
These are, from the battery charger spec, minimums rather than maximums.
e.g. a CDP provides at least 1500, and as much as 5000. So it seems
that the wm831x was designed to be told the minimum guaranteed available.
But that is circumstantial evidence and might be misleading.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2016-09-13 8:00 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-01 7:09 [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2016-08-01 7:09 ` [PATCH v16 1/4] usb: gadget: Introduce the usb charger framework Baolin Wang
2016-08-01 7:09 ` [PATCH v16 2/4] usb: gadget: Support for " Baolin Wang
2016-08-01 7:09 ` [PATCH v16 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger Baolin Wang
2016-08-01 7:09 ` [PATCH v16 4/4] power: wm831x_power: Support USB charger current limit management Baolin Wang
[not found] ` <cover.1470034830.git.baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-11 3:14 ` [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2016-08-29 9:02 ` Baolin Wang
2016-09-06 5:40 ` NeilBrown
[not found] ` <8760q9a8m6.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-09-06 7:40 ` Felipe Balbi
2016-09-08 6:55 ` Baolin Wang
2016-09-08 7:31 ` NeilBrown
2016-09-08 8:12 ` Baolin Wang
2016-09-08 23:13 ` NeilBrown
2016-09-09 6:46 ` Baolin Wang
2016-09-09 21:19 ` NeilBrown
2016-09-18 9:39 ` Baolin Wang
2016-10-05 7:26 ` Baolin Wang
2016-10-05 7:47 ` Felipe Balbi
[not found] ` <878tu3p78u.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-10-05 7:57 ` Baolin Wang
2016-10-05 10:44 ` NeilBrown
2016-10-08 3:18 ` Baolin Wang
2016-09-09 11:07 ` Mark Brown
2016-09-09 21:57 ` NeilBrown
2016-09-12 12:25 ` Mark Brown
[not found] ` <20160912122549.GZ27946-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-09-12 13:27 ` NeilBrown
[not found] ` <87inu11c5l.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-09-12 15:26 ` Mark Brown
2016-09-13 8:00 ` NeilBrown [this message]
2016-09-14 11:16 ` Mark Brown
2016-09-14 14:11 ` NeilBrown
2016-09-14 14:57 ` Mark Brown
2016-09-14 17:50 ` NeilBrown
2016-09-14 18:02 ` Mark Brown
2016-09-15 10:33 ` Pavel Machek
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=877fag1b6r.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=balbi@kernel.org \
--cc=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=grygorii.strashko@ti.com \
--cc=jun.li@nxp.com \
--cc=lee.jones@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=peter.chen@freescale.com \
--cc=r.baldyga@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).