summaryrefslogtreecommitdiff
path: root/drivers/acpi/sbs.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-02-17 03:12:04 (GMT)
committerLen Brown <len.brown@intel.com>2007-02-17 03:12:04 (GMT)
commit255f0385c8e0d6b9005c0e09fffb5bd852f3b506 (patch)
tree26eebd5040bf6056973cce0f3a9dc10638a8c961 /drivers/acpi/sbs.c
parent902b236c087bf021c94cc21a2b09d928c4156c2b (diff)
parente6d0f5622d30a3b98fb0ba6264d5006a18270890 (diff)
downloadlinux-255f0385c8e0d6b9005c0e09fffb5bd852f3b506.tar.xz
Pull bugzilla-7897 into release branch
Diffstat (limited to 'drivers/acpi/sbs.c')
-rw-r--r--drivers/acpi/sbs.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 1eab203..59640d9 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -1033,21 +1033,19 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
} else {
seq_printf(seq, "capacity state: ok\n");
}
+
+ foo = (s16) battery->state.amperage * battery->info.ipscale;
+ if (battery->info.capacity_mode) {
+ foo = foo * battery->info.design_voltage / 1000;
+ }
if (battery->state.amperage < 0) {
seq_printf(seq, "charging state: discharging\n");
- foo = battery->state.remaining_capacity * cscale * 60 /
- (battery->state.average_time_to_empty == 0 ? 1 :
- battery->state.average_time_to_empty);
- seq_printf(seq, "present rate: %i%s\n",
- foo, battery->info.capacity_mode ? "0 mW" : " mA");
+ seq_printf(seq, "present rate: %d %s\n",
+ -foo, battery->info.capacity_mode ? "mW" : "mA");
} else if (battery->state.amperage > 0) {
seq_printf(seq, "charging state: charging\n");
- foo = (battery->info.full_charge_capacity -
- battery->state.remaining_capacity) * cscale * 60 /
- (battery->state.average_time_to_full == 0 ? 1 :
- battery->state.average_time_to_full);
- seq_printf(seq, "present rate: %i%s\n",
- foo, battery->info.capacity_mode ? "0 mW" : " mA");
+ seq_printf(seq, "present rate: %d %s\n",
+ foo, battery->info.capacity_mode ? "mW" : "mA");
} else {
seq_printf(seq, "charging state: charged\n");
seq_printf(seq, "present rate: 0 %s\n",