[PATCH 3/3] battery: add CURRENT_NOW
Sascha Silbe
sascha-pgp at silbe.org
Sat May 1 12:58:27 EDT 2010
CURRENT_AVG is actually CURRENT_NOW (the EC code directly passes through
the value from the gas gauge instead of the internally used average).
We retain CURRENT_AVG as an alias for compatibility reasons, it will be
removed later.
This change allows an unpatched UPower (0.9.2) to calculate TimeToEmpty
and TimeToFull.
---
drivers/power/olpc_battery.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index dc144c5..c85dd7c 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -342,6 +342,7 @@ static int olpc_bat_get_property(struct power_supply *psy,
val->intval = (int)((s16)be16_to_cpu(ec_word)) * 9760L / 32;
break;
case POWER_SUPPLY_PROP_CURRENT_AVG:
+ case POWER_SUPPLY_PROP_CURRENT_NOW:
ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2);
if (ret)
return ret;
@@ -419,6 +420,7 @@ static enum power_supply_property olpc_bat_props[] = {
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
POWER_SUPPLY_PROP_CURRENT_AVG,
+ POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CAPACITY,
POWER_SUPPLY_PROP_CAPACITY_LEVEL,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
--
1.6.5
More information about the Devel
mailing list