[Letux-kernel] twl4030 charging

H. Nikolaus Schaller hns at goldelico.com
Mon Jul 25 17:16:24 CEST 2016


> Am 23.07.2016 um 09:50 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> Hi,
> sorry for the delays. Here some more analyses after adding thousands
> of printk to twl_core and twl_charger.
> Here a summary:
> 0. amongst a lot of read/write to the twl (bci initialization and asoc) during boot BCICTL1 becomes 0x12
> 1. then, there is an OTG notify USB_EVENT_VBUS
> 2. this calls twl4030_charger_enable_usb() to enable charging
> 3. this calls twl4030_charger_update_current()
> 4. this does what is expected and BCICTL1 is still 0x12
> 5. then it writes 0xf4 to register BCIMFSTS4 - setting USBFASTMCHG
> 6. this changes BCICTL1 to 0x1b - and charging should start
> 7. there is a spurious read command from some still running bci initialization - I don't know yet if harmful or harmless
> 8. twl4030_charger_enable_usb is done
> 9. but then BCICTL1 turns back to 0x12 meaning that charging was stopped (by hardware?)
> 10. shortly after that we get a twl4030_bci 48070000.i2c:twl at 48:bci: BCI irq 00 08
> 	means BCIISR1A = 0x00
> 	means BCIISR2A = 0x08 = ACCHGOV_ISR1

This is a mis-interpretation because the BCI irq 00 08 has ISR2 first and then ISR1.

This means it is a "simple" ICHGLOW

> 11. this again calls twl4030_charger_update_current()
> 12. but nobody cares about detecting that charging has turned off...

so the following discussion is not necessary.

> This is really interesting if we look up the BCIISR2A value.
> 	ACCHGOVEN Ac charger overvoltage monitoring function enable
> Uh? We have no AC charger connected and VAC is ~0mV...
> How can that trigger an AC charger overvoltage interrupt?
> Does this automatically stop USB charging?
> And why does it not print the dev_crit message?

That now seems to be ok :)

> Could it be that the VAC monitoring has not yet been initialized at the point charging
> is enabled through the OTG notify event?

Does not seem to be the problem.

My analyses are going on...


More information about the Letux-kernel mailing list