From: NeilBrown <neilb-IBi9RG/b67k@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Baolin Wang <baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Felipe Balbi <balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Greg KH
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Dmitry Eremin-Solenikov
<dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
Jun Li <jun.li-3arQi8VN3Tc@public.gmane.org>,
Marek Szyprowski
<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Ruslan Bilovol
<ruslan.bilovol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Alan Stern
<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
grygorii.strashko-l0cyMroinI0@public.gmane.org,
Yoshihiro Shimoda
<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Charles Keepax
<ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
Linux PM list <linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
USB <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
device-m
Subject: Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation
Date: Mon, 12 Sep 2016 15:27:18 +0200 [thread overview]
Message-ID: <87inu11c5l.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20160912122549.GZ27946-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]
On Mon, Sep 12 2016, Mark Brown wrote:
> [ Unknown signature status ]
> On Sat, Sep 10, 2016 at 07:57:26AM +1000, NeilBrown wrote:
>> On Fri, Sep 09 2016, Mark Brown wrote:
>
>> > The wm831x driver in the patch series is an example of such hardware -
>> > it is purely a power manager, it has no USB PHY hardware at all. It's a
>
>> The "probe" routine calls
>
>> + usb_charger_find_by_name(wm831x_pdata->usb_gadget);
>
>> Presumably wm831x_pdata is initialised by a board file?
>
> Yes.
>
>> I strongly suspect it is initialized to "usb-charger.0" because the
>> names given to usb chargers are "usb-charger.%d" in discovery order.
>> I don't see this being at all useful if there is ever more than one
>> usb-charger.
>> Do you?
>
> 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).
Your point is, I think, that when someone actually cares about that lack
of scaling, they can fix it.
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.
>
>> So how can this wm831x driver actually find out what sort of charger is
>> connected and so set the power limit? I just don't see this working *at*
>> *all*.
>
> 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".
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2016-09-12 13:27 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 [this message]
[not found] ` <87inu11c5l.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-09-12 15:26 ` Mark Brown
2016-09-13 8:00 ` NeilBrown
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=87inu11c5l.fsf@notabene.neil.brown.name \
--to=neilb-ibi9rg/b67k@public.gmane.org \
--cc=balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
--cc=jun.li-3arQi8VN3Tc@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=ruslan.bilovol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
--cc=yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
/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).