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

H. Nikolaus Schaller hns at goldelico.com
Tue Jul 19 09:34:24 CEST 2016


> Am 19.07.2016 um 09:04 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> Hi,
> 
>> Am 19.07.2016 um 07:01 schrieb Andreas Kemnade <andreas at kemnade.info>:
>> 
>> 
>> 
>> On Mon, 18 Jul 2016 20:53:09 +0200
>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>> 
>>> 
>>>> Am 18.07.2016 um 20:41 schrieb Andreas Kemnade
>>>> <andreas at kemnade.info>:
>>>> 
>>>> On Mon, 18 Jul 2016 18:08:38 +0200
>>>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>>>> 
>>>> MUSB itself gets the plugging info via ULPI from twl4030...
>>>> And if VBus measurement somehow does not work, it also influences
>>>> musb. I just remembered the state we reached in the kernel workshop.
>>>> Linear charging was working.
>>> 
>>> Yes.
>>> 
>>>> Vbus measurement was working. Gadget was
>>>> working, b_host.sh was working.
>>> 
>>> AFAIR it did not work for my devices.
>>> 
>> What did not work? I only remember that you had to replug the
>> cable at the right side for something (gadget?)?
> 
> I think charging didn't work either for my device and gadget became
> more and more unreliable. Finally missing was IP forwarding on my
> notebook. On yours it did work.
> 
>> 
>>> Note: it somehow depends on the device. I have one Letux7004 where it
>>> worked last time I tested.
>>> 
>>> So the problem is even more subtle. Some small difference in hardware
>>> makes the problem appear or not.
>>> 
>>>> That was 4.7rc1 + fixes done there. So
>>>> somewhere in between there and now caused something vbus
>>>> measurement to break.
>>>> As now b_host.sh, vbus and gadget do not work.
>>>> So maybe we should first concentrace on reaching the workshop state
>>>> again. So that is a bit like a git bisect between that 4.7rc1 and
>>>> now.
>>> 
>>> Or looking at your original patches
>>> 
>>> http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work/kemnade/charging_fixes
>>> http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work/hacks
>>> 
>>> and heck if they were rebased properly. And are complete.
>>> 
>> It seems that they are there.
>> rc3 seems to still be like rc1.
>> rc4 not.
>> 
>> Maybe next thing is to probably trace writes to the twl in twl-core.c
>> and then diff them. Maybe also trying with disabled musb.
>> 
>> Regards,
>> Andreas
>> 
>> message sent through a GTA04 with 4.7rc3 via USB and ip masquerading to
>> wwan
> 
> fine!
> 
> Here a new observation:. After setting to continuous mode,
> charging starts. And after resetting to auto it stops.
> 
> Interesting is the temperature value. It fluctuates heavily in
> continuous mode. Which means that the BCI-ADC isn't working
> properly.
> 
> The other interesting observation is that VBUS is always 0.
> Even if the driver pretends that it is charging.
> 
> a) no cable plugged in + continuous mode ->says "charging"
> 
> TWL4030 Main Battery
> ====================
> volt: 3829mV
> temp: 3°C
> VBUS: 6mV
> VCHG: 19mV
> 
> Battery /sys/class/power_supply/bq27000-battery
> ==================
> capacity: 74%
> status: Discharging
> volt: 3930000uV
> current: 314695uA
> 
> USB Charger /sys/class/power_supply/twl4030_usb
> ===================
> type: USB
> online: 1
> status: Charging
> volt: 0uV
> current: 15797uA
> max_current: 798505uA
> 
> b) no cable/cable (doesn't matter) auto mode - not charging
> 
> [ 1575.130889] twl4030_bci 48070000.i2c:twl at 48:bci: battery temperature out of range
> 
> TWL4030 Main Battery
> ====================
> volt: 3800mV
> temp: 56°C
> VBUS: 0mV
> VCHG: 0mV
> 
> Battery /sys/class/power_supply/bq27000-battery
> ==================
> capacity: 71%
> status: Discharging
> volt: 3922000uV
> current: 281494uA
> 
> USB Charger /sys/class/power_supply/twl4030_usb
> ===================
> type: USB
> online: 0
> status: Not charging
> volt: uV
> current: uA
> max_current: 841uA
> 
> c) USB power plugged in + continuous mode -> charging current is flowing
> 
> root at letux:~# ./charger
> TWL4030 Main Battery
> ====================
> volt: 4123mV
> temp: 56°C
> VBUS: 27mV
> VCHG: 0mV
> 
> Battery /sys/class/power_supply/bq27000-battery
> ==================
> capacity: 68%
> status: Charging
> level: Normal
> volt: 4022000uV
> current: -451783uA
> 
> USB Charger /sys/class/power_supply/twl4030_usb
> ===================
> type: USB
> online: 1
> status: Charging
> volt: 0uV
> current: 786873uA
> max_current: 798505uA
> 
> This means for the twl4030 ADCs:
> * current measurements appear to represent correct values
> * VBATT measurement appears to be accurate
> * VBUS, VCHG and temperature are broken

* and generic-adc-battery driver reports a different voltage than what is seen by directly accessing the iio /sys nodes (4193 mV instead of ~3800 mV).

> 
> This more indicates that the problem is in the twl4030 initialization and
> neither musb nor usb phy.
> 
> Perhaps a regmap sync problem?

or a missing mutex for iio access to the madc? But this is unlikely since I had removed the madc driver completely w/o making a difference.

> 
> I think I have to study the twl4030 data sheet if there is a common factor.
> 
> BR,
> Nikolaus
> 
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20160719/069e1d0f/attachment-0001.asc>


More information about the Letux-kernel mailing list