From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933184AbcILP1l (ORCPT ); Mon, 12 Sep 2016 11:27:41 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:55368 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932997AbcILP1d (ORCPT ); Mon, 12 Sep 2016 11:27:33 -0400 Date: Mon, 12 Sep 2016 16:26:27 +0100 From: Mark Brown To: NeilBrown Cc: Baolin Wang , Felipe Balbi , Greg KH , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , robh@kernel.org, Jun Li , Marek Szyprowski , Ruslan Bilovol , Peter Chen , Alan Stern , r.baldyga@samsung.com, grygorii.strashko@ti.com, Yoshihiro Shimoda , Lee Jones , Charles Keepax , patches@opensource.wolfsonmicro.com, Linux PM list , USB , device-mainlining@lists.linuxfoundation.org, LKML , "Bird, Timothy" Message-ID: <20160912152627.GA27946@sirena.org.uk> References: <8760q9a8m6.fsf@notabene.neil.brown.name> <878tv297a0.fsf@notabene.neil.brown.name> <87y4326l44.fsf@notabene.neil.brown.name> <20160909110727.GI27946@sirena.org.uk> <87pooc7n3t.fsf@notabene.neil.brown.name> <20160912122549.GZ27946@sirena.org.uk> <87inu11c5l.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Jsn5+Lu/ZvzbAGtZ" Content-Disposition: inline In-Reply-To: <87inu11c5l.fsf@notabene.neil.brown.name> X-Cookie: Question authority. User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Jsn5+Lu/ZvzbAGtZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. > > 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. --Jsn5+Lu/ZvzbAGtZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJX1skiAAoJECTWi3JdVIfQKY0H/R0FNjuK0aat01WGVS16c4n0 +8aDgG3uCfbwBjGNXl3yN8MCXFFEUu+kbCSscO5WqcLYswPFEledwj+AO96OR9OL wKKr+FAKwhfmGyirzKb0FjMoFXkzd+0rWeGb9UnhP4nhkVkUSN5bEgj9RwBCWSY4 4DaHFOJatnrhe/U7jS4gVx8M5kCyvazxIrKBJVTiI+Yo/FU81Bo4bbOwNZJoIVpN cIzFHNWnninf9RzYS7vMRAj1IUO7CA5GT0UeotlO79RpzPbSoQhWJb+v2lguNgVN PBvNJ3RKZI0dUxj2OIHeMLFo3nF77dh8BjsfpVwl431SmyBbEFAXwErpnLtn0Qk= =uIVa -----END PGP SIGNATURE----- --Jsn5+Lu/ZvzbAGtZ--