[Gta04-owner] [PATCH 3.2] twl4030_charger: set usb max current through sysfs

Andreas Kemnade andreas at kemnade.info
Thu Mar 29 09:26:28 CEST 2012


Hi,

> > 
> > Yes, that is the same formula as in twl4030_charger_get_current() but
> > the second pair of formulas in the comment is wrong.
> 
> Is it?  In what way?
> 
> And by "wrong" do you mean "different from the TRM" or "different from what
> you measured with a very precise ammeter"??
> Because if they came from TI, then maybe they are actually correct.
> 
Insert a value here
 * CGAIN == 0: ICHG = (BCIICHG * 1.7) / (2^10 - 1) - 0.85
and here
 CGAIN == 0: val * 1.6618 - 0.85
and here
 ret = (curr * 16618 - 850 * 10000) / 10;

and you'll see a difference. The first and third formula give sane results
(the first one in A, the third one in uA).
The third one is the one in the code. For the BCIIREF stuff I compared them
against the example values given in the BCIIREF description.
About the second one:
1.6618 = 1.7*1000/1023 so you would also need to do 0.85*1000 and you get the
result in mA.

Greetings
Andreas Kemnade
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20120329/1c9b7e5b/attachment-0001.bin>


More information about the Gta04-owner mailing list