View Single Post
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#674
Hello,

I fixed kernel module bq27x00_battery (which report info about battery). Now it export to HAL info in correct units (µV, µA, ...) by spec. power_supply_class.txt. Attached patch bq27x00_battery.patch.gz

I was inspirated by http://wiki.maemo.org/N900_Hardware_...eter/bq-script. I backported bq27x00_battery module from kernel 2.6.37 and added support for new properties:
POWER_SUPPLY_PROP_STATUS
POWER_SUPPLY_PROP_CHARGE_NOW
POWER_SUPPLY_PROP_CHARGE_FULL
POWER_SUPPLY_PROP_ONLINE
POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW
POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW

For autoloading this module (when N900 are booting) is needed to apply attached patch board-rx51-peripherals.patch.txt. Note that this patch replace patch bq_matan.patch.

Now /org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0 is good replecament for /org/freedesktop/Hal/devices/bme on HAL, so it can be used to report battery state when hostmode is active (and bme is stopped).

Next I added support for desktop widget battery ( http://maemo.org/packages/view/battery/ ) to read info from bq27x00 when is loaded (it read from HAL). Patch battery.patch.txt is attached too.

What about package/plugin status-area-applet-battery ( http://maemo.org/packages/view/statu...pplet-battery/ )? Is there any chance to replace (or fix) this applet to read bq27x00 info when bme is stopped? With source code of this applet will be simple to write patch, but it is closed...

Edit 1:
* Updated bq27x00_battery.patch.txt (backported changes from kernel 2.6.37)
* Added patch board-rx51-peripherals.patch.txt for autoloading bq27x00 when N900 are booting
Edit 2:
* Merged my patch with bq27x00 patches from kernel mailinglist
Attached Files
File Type: txt battery.patch.txt (1.0 KB, 334 views)
File Type: txt board-rx51-peripherals.patch.txt (493 Bytes, 268 views)
File Type: gz bq27x00_battery.patch.gz (6.1 KB, 291 views)

Last edited by pali; 2011-02-18 at 18:49.
 

The Following 19 Users Say Thank You to pali For This Useful Post: