aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/olpc_battery.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@collabora.co.uk>2009-06-30 02:13:01 -0400
committerAnton Vorontsov <cbouatmailru@gmail.com>2009-06-30 18:44:03 -0400
commitb294a290d24d1196d68399cc3a9b8c50bfb55abd (patch)
tree6d8b2ec03c90bfc4ba3c478af9bfbd0e49b1b45a /drivers/power/olpc_battery.c
parentbfdb46ce8494eae30dbaae65c81e684e6db6228b (diff)
Revert "power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL"
This reverts commit 8efe444038a205e79b38b7ad03878824901849a8 and 4cbc76eadf56399cd11fb736b33c53aec9caab8c. Richard@laptop.org was apparently using CAPACITY_LEVEL for debugging battery/EC problems, and was upset that it was removed. This readds it. Conflicts: Documentation/power_supply_class.txt Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power/olpc_battery.c')
-rw-r--r--drivers/power/olpc_battery.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index 58e419299cd6..3a589df09376 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -276,6 +276,14 @@ static int olpc_bat_get_property(struct power_supply *psy,
276 return ret; 276 return ret;
277 val->intval = ec_byte; 277 val->intval = ec_byte;
278 break; 278 break;
279 case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
280 if (ec_byte & BAT_STAT_FULL)
281 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
282 else if (ec_byte & BAT_STAT_LOW)
283 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_LOW;
284 else
285 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
286 break;
279 case POWER_SUPPLY_PROP_TEMP: 287 case POWER_SUPPLY_PROP_TEMP:
280 ret = olpc_ec_cmd(EC_BAT_TEMP, NULL, 0, (void *)&ec_word, 2); 288 ret = olpc_ec_cmd(EC_BAT_TEMP, NULL, 0, (void *)&ec_word, 2);
281 if (ret) 289 if (ret)
@@ -321,6 +329,7 @@ static enum power_supply_property olpc_bat_props[] = {
321 POWER_SUPPLY_PROP_VOLTAGE_AVG, 329 POWER_SUPPLY_PROP_VOLTAGE_AVG,
322 POWER_SUPPLY_PROP_CURRENT_AVG, 330 POWER_SUPPLY_PROP_CURRENT_AVG,
323 POWER_SUPPLY_PROP_CAPACITY, 331 POWER_SUPPLY_PROP_CAPACITY,
332 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
324 POWER_SUPPLY_PROP_TEMP, 333 POWER_SUPPLY_PROP_TEMP,
325 POWER_SUPPLY_PROP_TEMP_AMBIENT, 334 POWER_SUPPLY_PROP_TEMP_AMBIENT,
326 POWER_SUPPLY_PROP_MANUFACTURER, 335 POWER_SUPPLY_PROP_MANUFACTURER,