[Letux-kernel] twl4030 charging

Andreas Kemnade andreas at kemnade.info
Tue Jul 26 08:58:37 CEST 2016

On Mon, 25 Jul 2016 21:50:34 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> So what does that mean?
> I have studied the source code a little more and have tried to
> understand twl4030_charger_update_current().
> That function sets several limit current values for comparators (in a
> way that I must admit that I don't understand at all - strange bit
> patterns not directly related to the data sheet).
> Now what could be is that these calculations are wrong. And set the
> wrong bit patterns so that the charger stops immediately. But what
> "immedialtey" means depends on the speed of the BCI ADCs and might
> also depend on hardware induced noise.
Well, I disabled the ADC magic there and set the current directly to
the target setting. But that does not help. I suspected the there would
be some conflict between ADC access from code and via BCI/USB

> Another thought is that since the battery is connected in parallel
> with the system to the charger, this means that all current
> measurements are based on the sum of the charging current + system
> demand.
> So such current limits heavily depend on the system load - and mixed
> with battery quality. Here the driver might make assumptions that are
> not always true. This might explain why it works on some devices and
> doesn't on others. Which must be some hardware dependency.
Hmm, perhaps low battery current (even because of low usb current) ->
false conclusion: battery is full -> stop charging. Seen that often
during my experiments with disabling VBUSUNPLUGEN.
That might be triggered by the timing of setting current limit 
 (max. Iusb, end-of-charge-current, etc.) registers. So maybe
 simplifying that. I thought I have already done that. I will try again.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20160726/5d5dcdde/attachment-0001.asc>

More information about the Letux-kernel mailing list