aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 023f9c8534d0..ff2c876ec412 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -250,6 +250,13 @@ static int acpi_battery_get_property(struct power_supply *psy,
250 else 250 else
251 val->intval = battery->capacity_now * 1000; 251 val->intval = battery->capacity_now * 1000;
252 break; 252 break;
253 case POWER_SUPPLY_PROP_CAPACITY:
254 if (battery->capacity_now && battery->full_charge_capacity)
255 val->intval = battery->capacity_now * 100/
256 battery->full_charge_capacity;
257 else
258 val->intval = 0;
259 break;
253 case POWER_SUPPLY_PROP_MODEL_NAME: 260 case POWER_SUPPLY_PROP_MODEL_NAME:
254 val->strval = battery->model_number; 261 val->strval = battery->model_number;
255 break; 262 break;
@@ -276,6 +283,7 @@ static enum power_supply_property charge_battery_props[] = {
276 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, 283 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
277 POWER_SUPPLY_PROP_CHARGE_FULL, 284 POWER_SUPPLY_PROP_CHARGE_FULL,
278 POWER_SUPPLY_PROP_CHARGE_NOW, 285 POWER_SUPPLY_PROP_CHARGE_NOW,
286 POWER_SUPPLY_PROP_CAPACITY,
279 POWER_SUPPLY_PROP_MODEL_NAME, 287 POWER_SUPPLY_PROP_MODEL_NAME,
280 POWER_SUPPLY_PROP_MANUFACTURER, 288 POWER_SUPPLY_PROP_MANUFACTURER,
281 POWER_SUPPLY_PROP_SERIAL_NUMBER, 289 POWER_SUPPLY_PROP_SERIAL_NUMBER,
@@ -292,6 +300,7 @@ static enum power_supply_property energy_battery_props[] = {
292 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 300 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
293 POWER_SUPPLY_PROP_ENERGY_FULL, 301 POWER_SUPPLY_PROP_ENERGY_FULL,
294 POWER_SUPPLY_PROP_ENERGY_NOW, 302 POWER_SUPPLY_PROP_ENERGY_NOW,
303 POWER_SUPPLY_PROP_CAPACITY,
295 POWER_SUPPLY_PROP_MODEL_NAME, 304 POWER_SUPPLY_PROP_MODEL_NAME,
296 POWER_SUPPLY_PROP_MANUFACTURER, 305 POWER_SUPPLY_PROP_MANUFACTURER,
297 POWER_SUPPLY_PROP_SERIAL_NUMBER, 306 POWER_SUPPLY_PROP_SERIAL_NUMBER,