[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d1pngwjb.fsf@intel.com>
Date: Mon, 18 Apr 2016 11:18:16 +0300
From: Felipe Balbi <balbi@...nel.org>
To: Pavel Machek <pavel@....cz>, Baolin Wang <baolin.wang@...aro.org>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Sebastian Reichel <sre@...nel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
Peter Chen <peter.chen@...escale.com>,
Alan Stern <stern@...land.harvard.edu>, r.baldyga@...sung.com,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nel.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 v7 1/4] gadget: Introduce the usb charger framework
Hi,
Pavel Machek <pavel@....cz> writes:
> Hi!
>
>> > It's your HW :-) You tell me if it's really necessary. But, hey, if you
>> > get enumerated @500mA, this is the host telling you it _CAN_ give you
>> > 500mA. In that case, why wouldn't you ?
>
> Dunno, perhaps not to drain battery in host too quickly?
> Or perhaps you are charging from external battery?
>
>> >>> why RW ? Who's going to use these ? Also, you're not documenting this
>> >>> new sysfs file.
>> >>
>> >> Cause we have show and store operation for SDP type. If users want to
>> >> know or set the SDP current, they can use the sysfs file.
>> >> I'll add the documentation for it.
>> >
>> > but why would the user change it ? Here's the thing: you have a few
>> > posibilities for this:
>> >
>> > a) you are connected to a dedicated charger
>> >
>> > In this case, you can get up to 2000mA depending on the charger.
>> >
>> > If $this charger can give you or not 2000mA is not detectable,
>> > so what do charging ICs do ? They slowly increase the attached
>> > load accross VBUS/GND and measure VBUS value. When IC notices
>> > VBUS dropping bit, step back to previous load.
>> >
>> > This means you will always charger with maximum rating of DCP.
>> >
>> > Why would user change this ? More is unsafe, less is just
>> > stupid.
>
> Less is not neccessarily stupid. First, it is useful for debugging, second, you
> don't know how much this charger can give you. You measured you can get 1.8A,
> but the note on the charger says 1.5A. You may want to go with 1.5A.
>
> Also, there are several incompatible standards for detecting
> "dedicated charger". IIRC iPhone has different one from iPad. So it is
> quite important to be able to control this manually.
manually ??? Hell no! Charger IC should be able to do this no
problem. I would be surprised if there's any charger IC out there which
blindly connects a 1.8A load from the start. What these ICs do is that
they slowly increment the load and check voltage level. They'll continue
to do that up to the maximum you listed (1.8A, let's say). As soon as
voltage drops a bit, charger IC knows that it use previous load.
>> > d) you are connected to a standard port and get enumerated with your
>> > 100mA configuration.
>> >
>> > you *know* 100mA is okay. So you connect a 100mA load and get it
>> > over with.
>> >
>> > This means you will always charger with maximum rating for this
>> > SDP.
>> >
>> > Why would user change this ? More is unsafe, less is just
>> > stupid.
>
> I've needed to override 100mA default many times. Maybe it is unsafe,
> but it is useful.
still unsafe. If you really wanna do that, you're welcome to removing
safety margins from your own kernel, but we're definitely not going to
ship this to millions of users.
> (And with USB 5V connected directly to pretty beefy PC power supply...
> it is sometimes safer than it looks).
you're not considering the thermal dissipation on the USB connector
itself. Many of them might not use good metals because they assume the
maximum power dissipated is 500mA * 5V = 2.5W. If you try to draw more,
you could, literally, melt the connector.
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)
Powered by blists - more mailing lists