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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 0f1c8190c1d3..5dfe18bf24cb 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -93,7 +93,7 @@ struct acpi_battery {
93#endif 93#endif
94 struct acpi_device *device; 94 struct acpi_device *device;
95 unsigned long update_time; 95 unsigned long update_time;
96 int current_now; 96 int rate_now;
97 int capacity_now; 97 int capacity_now;
98 int voltage_now; 98 int voltage_now;
99 int design_capacity; 99 int design_capacity;
@@ -197,7 +197,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
197 val->intval = battery->voltage_now * 1000; 197 val->intval = battery->voltage_now * 1000;
198 break; 198 break;
199 case POWER_SUPPLY_PROP_CURRENT_NOW: 199 case POWER_SUPPLY_PROP_CURRENT_NOW:
200 val->intval = battery->current_now * 1000; 200 case POWER_SUPPLY_PROP_POWER_NOW:
201 val->intval = battery->rate_now * 1000;
201 break; 202 break;
202 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: 203 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
203 case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: 204 case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
@@ -248,6 +249,7 @@ static enum power_supply_property energy_battery_props[] = {
248 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, 249 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
249 POWER_SUPPLY_PROP_VOLTAGE_NOW, 250 POWER_SUPPLY_PROP_VOLTAGE_NOW,
250 POWER_SUPPLY_PROP_CURRENT_NOW, 251 POWER_SUPPLY_PROP_CURRENT_NOW,
252 POWER_SUPPLY_PROP_POWER_NOW,
251 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 253 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
252 POWER_SUPPLY_PROP_ENERGY_FULL, 254 POWER_SUPPLY_PROP_ENERGY_FULL,
253 POWER_SUPPLY_PROP_ENERGY_NOW, 255 POWER_SUPPLY_PROP_ENERGY_NOW,
@@ -274,7 +276,7 @@ struct acpi_offsets {
274 276
275static struct acpi_offsets state_offsets[] = { 277static struct acpi_offsets state_offsets[] = {
276 {offsetof(struct acpi_battery, state), 0}, 278 {offsetof(struct acpi_battery, state), 0},
277 {offsetof(struct acpi_battery, current_now), 0}, 279 {offsetof(struct acpi_battery, rate_now), 0},
278 {offsetof(struct acpi_battery, capacity_now), 0}, 280 {offsetof(struct acpi_battery, capacity_now), 0},
279 {offsetof(struct acpi_battery, voltage_now), 0}, 281 {offsetof(struct acpi_battery, voltage_now), 0},
280}; 282};
@@ -606,11 +608,11 @@ static int acpi_battery_print_state(struct seq_file *seq, int result)
606 else 608 else
607 seq_printf(seq, "charging state: charged\n"); 609 seq_printf(seq, "charging state: charged\n");
608 610
609 if (battery->current_now == ACPI_BATTERY_VALUE_UNKNOWN) 611 if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
610 seq_printf(seq, "present rate: unknown\n"); 612 seq_printf(seq, "present rate: unknown\n");
611 else 613 else
612 seq_printf(seq, "present rate: %d %s\n", 614 seq_printf(seq, "present rate: %d %s\n",
613 battery->current_now, acpi_battery_units(battery)); 615 battery->rate_now, acpi_battery_units(battery));
614 616
615 if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN) 617 if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN)
616 seq_printf(seq, "remaining capacity: unknown\n"); 618 seq_printf(seq, "remaining capacity: unknown\n");