[Letux-kernel] letux-4.7-rc7: charging & ethernet gadget
andreas at kemnade.info
Tue Jul 19 23:37:51 CEST 2016
On Tue, 19 Jul 2016 22:50:44 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> > 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
> 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
> 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.
Well, ITHEN is normally enabled during automatic charge.
If I enable it manually
i2cset -f 0 0x4a 0x97 0x1f
Temperature shows sane values, so no additional regulator needed for
that. But there are regulators needed for automatic charging...
More information about the Letux-kernel