[Letux-kernel] twl4030 charging

H. Nikolaus Schaller hns at goldelico.com
Sat Jul 23 09:50:03 CEST 2016


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
11. this again calls twl4030_charger_update_current()
12. but nobody cares about detecting that charging has turned off...

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?

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

So far for today...

BR,
Nikolaus



More information about the Letux-kernel mailing list