diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2010-12-10 17:05:21 -0500 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2011-01-12 12:29:20 -0500 |
commit | 22fadd766b2a222b273df9f2264b72e4b3bbe921 (patch) | |
tree | 17ba072ba44590265cabb3ec6b6ea0852a2448e2 /drivers/power | |
parent | 20fd9830ccc685adce65ba89ffc3ca5426a2b064 (diff) |
olpc_battery: Add support for CURRENT_NOW and VOLTAGE_NOW
{CURRENT,VOLTAGE}_AVG are actually {CURRENT,VOLTAGE}_NOW (the EC code
directly passes through the value from the gas gauge instead of the
internally used average). We retain {CURRENT,VOLTAGE}_AVG as an alias
for compatibility reasons, it will be removed later.
Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
[ pgf@laptop.org: added VOLTAGE_NOW, aliased to VOLTAGE_AVG ]
Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/olpc_battery.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c index 0f7a7b11bda3..64e40ff5c44a 100644 --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c | |||
@@ -333,6 +333,7 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
333 | return ret; | 333 | return ret; |
334 | break; | 334 | break; |
335 | case POWER_SUPPLY_PROP_VOLTAGE_AVG: | 335 | case POWER_SUPPLY_PROP_VOLTAGE_AVG: |
336 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | ||
336 | ret = olpc_ec_cmd(EC_BAT_VOLTAGE, NULL, 0, (void *)&ec_word, 2); | 337 | ret = olpc_ec_cmd(EC_BAT_VOLTAGE, NULL, 0, (void *)&ec_word, 2); |
337 | if (ret) | 338 | if (ret) |
338 | return ret; | 339 | return ret; |
@@ -340,6 +341,7 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
340 | val->intval = (s16)be16_to_cpu(ec_word) * 9760L / 32; | 341 | val->intval = (s16)be16_to_cpu(ec_word) * 9760L / 32; |
341 | break; | 342 | break; |
342 | case POWER_SUPPLY_PROP_CURRENT_AVG: | 343 | case POWER_SUPPLY_PROP_CURRENT_AVG: |
344 | case POWER_SUPPLY_PROP_CURRENT_NOW: | ||
343 | ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2); | 345 | ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2); |
344 | if (ret) | 346 | if (ret) |
345 | return ret; | 347 | return ret; |
@@ -414,7 +416,9 @@ static enum power_supply_property olpc_xo1_bat_props[] = { | |||
414 | POWER_SUPPLY_PROP_HEALTH, | 416 | POWER_SUPPLY_PROP_HEALTH, |
415 | POWER_SUPPLY_PROP_TECHNOLOGY, | 417 | POWER_SUPPLY_PROP_TECHNOLOGY, |
416 | POWER_SUPPLY_PROP_VOLTAGE_AVG, | 418 | POWER_SUPPLY_PROP_VOLTAGE_AVG, |
419 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
417 | POWER_SUPPLY_PROP_CURRENT_AVG, | 420 | POWER_SUPPLY_PROP_CURRENT_AVG, |
421 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
418 | POWER_SUPPLY_PROP_CAPACITY, | 422 | POWER_SUPPLY_PROP_CAPACITY, |
419 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | 423 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, |
420 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | 424 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, |