Closed hansemro closed 3 years ago
Kernel Log:
[ 3.422821] i2c i2c-0: of_i2c: invalid reg on /ocp/interconnect@48000000/segment@0/target-module@70000/i2c@0/battery
[ 3.434112] i2c i2c-0: Failed to create I2C device for /ocp/interconnect@48000000/segment@0/target-module@70000/i2c@0/battery
[ 3.450134] bq27xxx-battery 0-0055: data memory update not supported for chip
sysfs:
amazon-otter:~# ls /sys/class/power_supply/bq27541-0/
capacity current_now manufacturer subsystem uevent
capacity_level cycle_count power technology voltage_now
charge_full device power_avg temp
charge_full_design health present time_to_empty_now
charge_now hwmon1 status type
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/capacity
100
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/capacity_level
Full
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/charge_full
3873000
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/charge_full_design
4400000
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/health
Good
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/cycle_count
78
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/temp
270
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/current_now
200000
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/voltage_now
4162000
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/type
Battery
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/manufacturer
Texas Instruments
amazon-otter:~# cat /sys/class/power_supply/bq27541-0/power_avg
775
Device tree seems to be working despite some warnings on battery.
Added to dtb_dev
(commit 2d07bdfddba7b687bb3acf6c8abaa54acac43e6a)
Moving battery from i2c1 to root node / fixes i2c errors from above kernel log. This makes sense since the battery is not an i2c device. Fixed in commit 38d10bd46c47e87e33abac618edb725cabeea4dd.
Merged to main (relevant pull request: #14)
Reference:
Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
Kindle Fire has BQ27541 on i2c.1 at register 0x55.
arch/arm/boot/dts/omap4-kc1.dts
: