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

Andreas Kemnade andreas at kemnade.info
Wed Jul 20 20:46:12 CEST 2016


Hi,

On Wed, 20 Jul 2016 10:59:55 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> Hi,
> 
> > Am 19.07.2016 um 23:37 schrieb Andreas Kemnade
> > <andreas at kemnade.info>:
> > 
> > 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 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:
> >> http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt#L26
> >> 
> >> 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.
> >> 
> > Well, ITHEN is normally enabled during automatic charge.
> > If I enable it manually
> > i2cset -f 0 0x4a 0x97 0x1f 
> > (BCICTL1)
> > Temperature shows sane values, so no additional regulator needed for
> > that. But there are regulators needed for automatic charging...
> 
> I have booted with USB cable connected. Which means automatic charging
> should have been enabled by hardware and U-Boot...
> 
if there is a charge on command in boot.scr...
Now I made a quite interesting observation:
My never-touch 3.7 kernel does not do automatic charging anymore.
So what do I have
       a bad dream
or/and a bad device
or/and a bad kernel

or a combination thereof?!
 ?????

Very puzzeled regards
Andreas


More information about the Letux-kernel mailing list