diff options
Diffstat (limited to 'drivers/power/olpc_battery.c')
-rw-r--r-- | drivers/power/olpc_battery.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c index 602bbd008f78..8fefe5a73558 100644 --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c | |||
@@ -233,6 +233,14 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
233 | if (ret) | 233 | if (ret) |
234 | return ret; | 234 | return ret; |
235 | break; | 235 | break; |
236 | case POWER_SUPPLY_PROP_CHARGE_TYPE: | ||
237 | if (ec_byte & BAT_STAT_TRICKLE) | ||
238 | val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; | ||
239 | else if (ec_byte & BAT_STAT_CHARGING) | ||
240 | val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; | ||
241 | else | ||
242 | val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; | ||
243 | break; | ||
236 | case POWER_SUPPLY_PROP_PRESENT: | 244 | case POWER_SUPPLY_PROP_PRESENT: |
237 | val->intval = !!(ec_byte & (BAT_STAT_PRESENT | | 245 | val->intval = !!(ec_byte & (BAT_STAT_PRESENT | |
238 | BAT_STAT_TRICKLE)); | 246 | BAT_STAT_TRICKLE)); |
@@ -325,6 +333,7 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
325 | 333 | ||
326 | static enum power_supply_property olpc_bat_props[] = { | 334 | static enum power_supply_property olpc_bat_props[] = { |
327 | POWER_SUPPLY_PROP_STATUS, | 335 | POWER_SUPPLY_PROP_STATUS, |
336 | POWER_SUPPLY_PROP_CHARGE_TYPE, | ||
328 | POWER_SUPPLY_PROP_PRESENT, | 337 | POWER_SUPPLY_PROP_PRESENT, |
329 | POWER_SUPPLY_PROP_HEALTH, | 338 | POWER_SUPPLY_PROP_HEALTH, |
330 | POWER_SUPPLY_PROP_TECHNOLOGY, | 339 | POWER_SUPPLY_PROP_TECHNOLOGY, |