[Letux-kernel] letux-4.7-rc7: charging & ethernet gadget

H. Nikolaus Schaller hns at goldelico.com
Tue Jul 19 22:50:44 CEST 2016

> I think I have to study the twl4030 data sheet if there is a common factor.

First interesting finding:

Nobody does and can call twl4030_madc_set_current_generator() for channel=1,
i.e. the BATTEMP channel / ADCIN1.

Therefore, ITHEN is not touched by the kernel and either U-Boot must take care
of. Or (I hope) automatic charging enabled by hardware does set this bit. Anyways
this means ITHEN is off if we boot w/o external power.

The same is true for the current source strength (ITHSENS). So we are lucky that
10kOhm at 10µA translates into 100mV. Unless our U-Boot modifies these values.

I remember that I stumbled over a similar thing when developing the gpadc driver
for the Palmas (twl6037). There we have made it a config through DT:

This could explain why we sometimes read 56°C. I think this always happens
if the ITHEN bit becomes reset (why?) and therefore the current source is off.
Pretending a missing battery. This of course will disable automatic charging.

But it does not explain why we sometimes get more or less random values.

Hm. Wait. Who is powering the current source for ITHEN? What if that LDO
is broken? Something to keep in mind for another test. Although I could not
find any reference where the current source is powered from.

Next test I do is to insert printk() into the twl4030 madc driver to see how
these bits are set and or changed.


PS: twl4030 madc source code is stable for a long time (at least since 4.3)
so the bug is not there.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20160719/e18c84f1/attachment.asc>

More information about the Letux-kernel mailing list