[Letux-kernel] automatic charging working with 4.7
H. Nikolaus Schaller
hns at goldelico.com
Tue Jul 26 22:10:34 CEST 2016
Hi,
> Am 26.07.2016 um 21:07 schrieb Andreas Kemnade <andreas at kemnade.info>:
>
> Hi,
>
> I finally took the advice given to us about in the UART slave
> discussion:
> Fix powermanagement issues in userspace ;-)
:)
> So I did:
>
> rmmod twl4030_charger
> sleep 2
> #USB PHY_CLK_CTRL
> #seems to be already done
> twl-i2c.sh USB w 0xFE 0x01
> sleep 1
> twl-i2c.sh USB r 0xFF
> #should be 01
>
> #USB POWER_CTL_SET OTG_EN
> twl-i2c.sh USB w 0xAD 0x20
fine!
that is what the phy-twl4030 should have done, but does not.
>
> sleep 1
> # now we have sometimes a working usb gadget
> #BCICTL1 (not needed)
> #twl-i2c.sh MAIN_CHARGE w 0x23 0x1f
>
> #BCIMFSTS4
> twl-i2c.sh MAIN_CHARGE w 0x10 0x74
>
> #BOOT_BCI
> twl-i2c.sh PM_MASTER w 0x07 0x32
> sleep 2
would normally be done by twl4030_charger
>
> #charging starts
>
> #to have the vbus and iusb sysnodes in /sys/class/power_supply/twl4030_usb...
> modprobe twl4030_charger
>
> now we have even vbus measurement.
> twl-i2c.sh is from
> http://misc.andi.de1.cc/twl-i2c.sh
>
> Well, of course that is not the end solution, but maybe a step backward to move two steps forward.
Yes, it more or less mimics what the charging enable command was doing in 2.6.32 kernels...
So that is a good step forward!
a) we know for (almost) sure now that the problem is not in twl4030_charger
b) it must be in twl4030-phy (which does not handle OTG_EN) and power management (which we already know to be broken)
Great step towards a solution (but we don't know how many steps the ladder has in total :)
I think the next thing I will try is to check/change the status of OTG_EN in twl4030_charger...
Would be a simple workaround :)
BR,
Nikolaus
More information about the Letux-kernel
mailing list