[Gta04-owner] [PATCH 3.2] twl4030_charger: set usb max current through sysfs
andreas at kemnade.info
Thu Mar 29 09:26:28 CEST 2012
> > 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
CGAIN == 0: val * 1.6618 - 0.85
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 197 bytes
Desc: not available
More information about the Gta04-owner