[Letux-kernel] Charging on GTA04

Belisko Marek marek.belisko at gmail.com
Mon Jun 27 22:26:08 CEST 2016


Hi Nikolaus,

I build fresh 4.7-rc5-letux (make mrproper ARCH=arm; make
letux_defconfig ARCH=arm) boot device and twl4030_usb is reporting:
root at letux:~# cat /sys/class/power_supply/twl4030_usb/status
Charging
root at letux:~# cat /sys/class/power_supply/twl4030_usb/voltage_now
4961175
root at letux:~# cat /sys/class/power_supply/twl4030_usb/current_now
509352

genric-adc-battery has bug that despite of fact that twl4030 report
charging generic adc-batt report discharging. Also eth gadget works
for me. Strange.


On Mon, Jun 27, 2016 at 8:15 PM, H. Nikolaus Schaller <hns at goldelico.com> wrote:
>
>> Am 27.06.2016 um 20:06 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>
>> Hi all,
>> I have not found the issue, but a "good" kernel where works:
>>
>> a) hdq / bq27000
>> b) ip over usb
>> c) charging
>>
>> What is also not working is USB plug-in detection with the long cable...
>>
>> Anyways, we have a "good" and a "bad" kernel. Let's start to diff
>
> some first observations:
> - bq27xxx driver has been completely rewritten. There were bugs for other
>   fuel gauge chips and there might still be one for bq27000.
> - twl4030_charger.c has been converted to use iio madc for VAC and
>   replaced non-standard sysfs nodes by standard ones
>
>> and
>> find out what is going wrong :)
>>
>>       good: http://download.goldelico.com/letux-kernel/4.3/
>>       bad: http://download.goldelico.com/letux-kernel/letux-4.7-rc5/
>>
>> What I suspect from this is that some editing of a feature branch (especially
>> the charger code) did go wrong.
>
> One thing is still different: the sequence of initializing interrupts and registering
> the charger. I remember that these patches got garbled a little by rebasing
> so I had to reconstruct them. Maybe that is the issue.
>
> But it can still be completely somewhere else!
>
> BR,
> Nikolaus
>
>>
>> BR,
>> Nikolaus
>>
>>
>>
>>> Am 26.06.2016 um 22:14 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>
>>>
>>>> Am 26.06.2016 um 19:36 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>
>>>>
>>>>> Am 26.06.2016 um 18:43 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>>
>>>>>
>>>>>> Am 26.06.2016 um 18:07 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>>>
>>>>>>
>>>>>>> Am 26.06.2016 um 17:12 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>>>>
>>>>>>>
>>>>>>>> Am 26.06.2016 um 15:01 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>>>>>
>>>>>>>>
>>>>>>>>> Am 24.06.2016 um 10:03 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> it appears as if USB detection is now completely broken on -rc4...
>>>>>>>>>
>>>>>>>>> I have two boards where I neither get some "USB plugged in" nor
>>>>>>>>> does /sys/class/power/usb start charging.
>>>>>>>>>
>>>>>>>>> Something has gone wild.
>>>>>>>>>
>>>>>>>>> Does it work for anyone of you?
>>>>>>>>
>>>>>>>> Here some observations to this problem (using letux-4.7-rc4):
>>>>>>>>
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# cat uevent
>>>>>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>>>>>> POWER_SUPPLY_STATUS=Not charging
>>>>>>>> POWER_SUPPLY_ONLINE=0
>>>>>>>> POWER_SUPPLY_INPUT_CURRENT_LIMIT=841
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# echo continuous >mode
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# cat mode
>>>>>>>> off auto [continuous]
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# cat uevent
>>>>>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>>>>>> POWER_SUPPLY_STATUS=Charging
>>>>>>>> POWER_SUPPLY_ONLINE=1
>>>>>>>> POWER_SUPPLY_VOLTAGE_NOW=0
>>>>>>>> POWER_SUPPLY_CURRENT_NOW=12474
>>>>>>>> POWER_SUPPLY_INPUT_CURRENT_LIMIT=841
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# echo auto >mode
>>>>>>>> [  189.735412] twl4030_bci 48070000.i2c:twl at 48:bci: battery temperature out of range
>>>>>>>> [  189.766967] twl4030_bci 48070000.i2c:twl at 48:bci: battery temperature out of range
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb# cat uevent
>>>>>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>>>>>> POWER_SUPPLY_STATUS=Not charging
>>>>>>>> POWER_SUPPLY_ONLINE=0
>>>>>>>> POWER_SUPPLY_INPUT_CURRENT_LIMIT=841
>>>>>>>> root at letux:/sys/class/power_supply/twl4030_usb#
>>>>>>>>
>>>>>>>> This means:
>>>>>>>> 1.  "auto" mode is broken
>>>>>>>> 2. continuous mode seems to charge
>>>>>>>> 3. switching back to auto mode gives strange "battery temperature out of range" warning
>>>>>>>>
>>>>>>>> And I have no ethernet-gadget.
>>>>>>>>
>>>>>>>> I think I should compare with letux-4.6.0 or other -rc. And I should enable debugging
>>>>>>>> of the driver.
>>>>>>>
>>>>>>> Well, 4.6.0 isn't charging as well (and no ethernet gadget). And older versions are not properly booting.
>>>>>>>
>>>>>>> One strange observation:
>>>>>>>
>>>>>>> root at letux:~# cat /sys/class/power_supply/twl4030_usb/voltage_now
>>>>>>> 0
>>>>>>> root at letux:~# cat /sys/class/power_supply/twl4030_usb/uevent
>>>>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>>>>> POWER_SUPPLY_STATUS=Charging
>>>>>>> POWER_SUPPLY_ONLINE=1
>>>>>>> POWER_SUPPLY_VOLTAGE_NOW=0
>>>>>>> POWER_SUPPLY_CURRENT_NOW=808476
>>>>>>> POWER_SUPPLY_INPUT_CURRENT_LIMIT=798505
>>>>>>> root at letux:~#
>>>>>>>
>>>>>>> This means that voltage_now and POWER_SUPPLY_VOLTAGE_NOW is 0 although charging!
>>>>>>>
>>>>>>> This is definitively different to 4.6.0 where USB voltage is displayed.
>>>>>>>
>>>>>>> Is perhaps the madc broken?
>>>>>>
>>>>>> Yes and no...
>>>>>>
>>>>>> This is what I get with #define DEBUG
>>>>>>
>>>>>> root at letux:~# dmesg|fgrep bci
>>>>>> [    8.864227] driver_register 'twl4030_bci'
>>>>>> [    8.864868] twl4030_bci_probe
>>>>>> [    8.864959] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    8.865020] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad020)
>>>>>> [    8.865051]   bci->transceiver = fffffdfb
>>>>>> [    8.943939] twl4030_bci_probe
>>>>>> [    8.944000] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    8.944061] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad020)
>>>>>> [    8.944091]   bci->transceiver = fffffdfb
>>>>>> [    8.953796] twl4030_bci_probe
>>>>>> [    8.953857] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    8.953918] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad220)
>>>>>> [    8.953948]   bci->transceiver = fffffdfb
>>>>>> [    8.973114] twl4030_bci_probe
>>>>>> [    8.973175] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    8.973236] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad220)
>>>>>> [    8.973266]   bci->transceiver = fffffdfb
>>>>>> [    8.988189] twl4030_bci_probe
>>>>>> [    8.988250] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    8.988311] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddd99320)
>>>>>> [    8.988342]   bci->transceiver = fffffdfb
>>>>>> [    9.232696] twl4030_bci_probe
>>>>>> [    9.232788] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.232849] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddd99320)
>>>>>> [    9.232849]   bci->transceiver = fffffdfb
>>>>>> [    9.238159] twl4030_bci_probe
>>>>>> [    9.238250] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.238281] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad020)
>>>>>> [    9.238311]   bci->transceiver = fffffdfb
>>>>>> [    9.396270] twl4030_bci_probe
>>>>>> [    9.396362] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.396392] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, dcac2f20)
>>>>>> [    9.396423]   bci->transceiver = fffffdfb
>>>>>> [    9.424865] twl4030_bci_probe
>>>>>> [    9.424957] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.424987] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad020)
>>>>>> [    9.425018]   bci->transceiver = fffffdfb
>>>>>> [    9.477874] twl4030_bci_probe
>>>>>> [    9.477966] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.477996] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad120)
>>>>>> [    9.478027]   bci->transceiver = fffffdfb
>>>>>> [    9.530670] twl4030_bci_probe
>>>>>> [    9.530761] twl4030_bci_probe: of_find_compatible_node
>>>>>> [    9.530822] devm_usb_get_phy_by_node(ddcd2410 48070000.i2c:twl at 48:bci, df9b1af4 twl4030-usb, ddfad720)
>>>>>> [    9.530853]   bci->transceiver = dca39410
>>>>>> [    9.530883] twl4030_bci 48070000.i2c:twl at 48:bci: could not request vac iio channel -19
>>>>>> [    9.546997] twl4030_bci 48070000.i2c:twl at 48:bci: transceiver = dca39410
>>>>>> [    9.546997] twl4030_bci 48070000.i2c:twl at 48:bci: OTG notify 0
>>>>>> [    9.548370] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.549224] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.549804] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.550292] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.550781] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.551300] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.552612] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.553131] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.553558] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.554046] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.554534] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.554992] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [    9.626617] twl4030_bci 48070000.i2c:twl at 48:bci: v=0 cur=-850000 limit=0 target=500000
>>>>>> [   10.615722] twl4030_bci 48070000.i2c:twl at 48:bci: OTG notify 2
>>>>>> [   12.135711] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.136260] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.136840] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.137390] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.137817] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.139190] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.139678] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.140136] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.140563] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.141021] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.143005] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.143524] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.143951] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.144409] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.144866] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.146545] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.146972] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.147460] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.147918] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.165832] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.168548] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.169006] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.169433] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.169860] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.170288] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.198486] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.201812] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.202239] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.202697] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.203155] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.211883] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.212341] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.212799] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.213226] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.213684] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.216888] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.217437] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.217895] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.219116] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.219635] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.419799] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.423065] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.423522] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.423980] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.424438] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.426727] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.427215] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.427642] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.428100] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.428558] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.430541] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.431182] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.431610] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.432067] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.432525] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.447662] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.448211] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.448669] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.449127] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [   12.449554] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> root at letux:~#
>>>>>>
>>>>>> root at letux:~# echo auto >/sys/class/power_supply/twl4030_usb/mode
>>>>>> [  280.254119] twl4030_bci 48070000.i2c:twl at 48:bci: BCI irq 00 08
>>>>>> [  280.266662] twl4030_bci 48070000.i2c:twl at 48:bci: BCI irq 00 08
>>>>>> [  280.279632] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> root at letux:~# [  280.288757] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.294769] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.303192] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.311340] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.319427] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.327392] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.334716] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.342620] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.356506] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.370605] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.387207] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.393249] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.403289] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.409912] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.418304] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.427124] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.439941] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.447601] twl4030_bci 48070000.i2c:twl at 48:bci: v=0 cur=9150 limit=0 target=500000
>>>>>> [  280.452423] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.461273] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.465728] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.466339] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.466888] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.467437] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.467926] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.476196] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.488464] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.490081] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.502502] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.514495] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.557800] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.576171] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.586883] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.607116] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.622772] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.629150] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.638549] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.646270] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.652954] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.659973] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.667388] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.674468] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.681243] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.689605] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.700714] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.708557] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.716094] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.722961] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.731384] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.739349] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.747070] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.754119] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  280.761901] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>>
>>>>>> root at letux:~# echo continuous >/sys/class/power_supply/twl4030_usb/mode
>>>>>> root at letux:~# [  324.358245] twl4030_bci 48070000.i2c:twl at 48:bci: BCI irq 00 10
>>>>>> [  324.371276] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.378295] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.385040] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.394165] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.401306] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.402191] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.414855] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.426727] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.441223] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.447875] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.455444] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.463897] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.471313] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.479522] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.488952] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.497528] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.511199] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.522888] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.534454] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.544067] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.551605] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.558898] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.566894] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.573669] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.581848] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.589080] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.597717] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.652496] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.659973] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.667877] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.677307] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>> [  324.686981] twl4030_bci 48070000.i2c:twl at 48:bci: state: 00
>>>>>>
>>>>>> Really interesting is
>>>>>>
>>>>>> [    9.530883] twl4030_bci 48070000.i2c:twl at 48:bci: could not request vac iio channel -19
>>>>>>
>>>>>> Which means there is some error in the madc iio subsystem at that stage.
>>>>>
>>>>> Well, the bug is in one of our DT patches:
>>>>>
>>>>> <http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=arch/arm/boot/dts/twl4030.dtsi;h=0c862d2d7b5aa7e8460b91d143d6245a5c5a8da8;hb=f704c620abd294972e754c8b59a085191e411da8#l27>
>>>>>
>>>>> this line should read
>>>>>
>>>>>            io-channel-names = "vac";
>>>>>
>>>>>>
>>>>>> The second observation is that there is nothing happening on USB plug/unplug.
>>>>>>
>>>>>> IMHO USB-Plug detection is also broken (don't know if hw or software).
>>>>>
>>>>> Interestingly, I see different OTG notify values depending on whether
>>>>> the cable is plugged in during boot or not. But no new notifications if I
>>>>> unplug the cable.
>>>>>
>>>>> Well, that is only part of the truth:
>>>>>
>>>>> * if I take a short USB cable I can see notify 0 and notify 2 (but still no charging nor ethernet gadget)
>>>>> * if I take a long cable and plug/unplug at the hub end, I don't see notifications
>>>>> * if I take a long cable and plug/unplug at the gta04 end, I see notifications
>>>>>
>>>>> * MADC reports some mV only for VBUS
>>>>>
>>>>> That is really weird.
>>>>>
>>>>> What could this be (if not a hardware problem)?
>>>>
>>>> unlikely. I have swapped the SD card to a different GTA04 and it shows the same effects
>>>> (long vs. short cable, no charging).
>>>
>>> HW problem can be definitively ruled out.
>>>
>>> I have flashed a fresh SD card through
>>>
>>>      wget -O - http://download.goldelico.com/gta04/production/20150318-gta04.dd.bz2 | bzcat >/dev/sdc
>>>
>>> and that works perfectly (WARNING: it flashes an older U.Boot!).
>>>
>>> After reflashing the previous U-Boot and booting 4.6.0 it appears that charging works a little better.
>>> And I got sometimes Ethernet over USB capability.
>>>
>>> But I also got strange problems when unplugging the USB cable:
>>>
>>> root at letux:~# [  127.712615] musb-hdrc musb-hdrc.0.auto: VBUS_ERROR in b_idle (90, <VBusValid), retry #0, port1 00000100
>>>
>>> Quite strange...
>>>
>>> Will try 4.7-rc4 again tomorrow.
>>>
>>>>
>>>> So please help to fix this!
>>>>
>>>>>
>>>>> * USB/OTG detection is broken (some race between VBUS and D+/D- level detection on cable plug)
>>>>> * charger is fully enabled (too high inrush-current) preventing VBUS to rising above the VBUS detection level
>>>>>    with short cable I have 4.54V
>>>>>    with long cable I have just 4.39V
>>>>> * a bug in MADC so that VBUS is not reported properly
>>>>> * is the OTG charge pump not being turned on/off?
>>>>>
>>>>> More ideas?
>>>>>
>>>>> 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
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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

BR,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com


More information about the Letux-kernel mailing list