aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-02-16 22:12:04 -0500
committerLen Brown <len.brown@intel.com>2007-02-16 22:12:04 -0500
commit255f0385c8e0d6b9005c0e09fffb5bd852f3b506 (patch)
tree26eebd5040bf6056973cce0f3a9dc10638a8c961
parent902b236c087bf021c94cc21a2b09d928c4156c2b (diff)
parente6d0f5622d30a3b98fb0ba6264d5006a18270890 (diff)
Pull bugzilla-7897 into release branch
-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 1eab2034c9a5..59640d9a0acc 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)
1033 } else { 1033 } else {
1034 seq_printf(seq, "capacity state: ok\n"); 1034 seq_printf(seq, "capacity state: ok\n");
1035 } 1035 }
1036
1037 foo = (s16) battery->state.amperage * battery->info.ipscale;
1038 if (battery->info.capacity_mode) {
1039 foo = foo * battery->info.design_voltage / 1000;
1040 }
1036 if (battery->state.amperage < 0) { 1041 if (battery->state.amperage < 0) {
1037 seq_printf(seq, "charging state: discharging\n"); 1042 seq_printf(seq, "charging state: discharging\n");
1038 foo = battery->state.remaining_capacity * cscale * 60 / 1043 seq_printf(seq, "present rate: %d %s\n",
1039 (battery->state.average_time_to_empty == 0 ? 1 : 1044 -foo, battery->info.capacity_mode ? "mW" : "mA");
1040 battery->state.average_time_to_empty);
1041 seq_printf(seq, "present rate: %i%s\n",
1042 foo, battery->info.capacity_mode ? "0 mW" : " mA");
1043 } else if (battery->state.amperage > 0) { 1045 } else if (battery->state.amperage > 0) {
1044 seq_printf(seq, "charging state: charging\n"); 1046 seq_printf(seq, "charging state: charging\n");
1045 foo = (battery->info.full_charge_capacity - 1047 seq_printf(seq, "present rate: %d %s\n",
1046 battery->state.remaining_capacity) * cscale * 60 / 1048 foo, battery->info.capacity_mode ? "mW" : "mA");
1047 (battery->state.average_time_to_full == 0 ? 1 :
1048 battery->state.average_time_to_full);
1049 seq_printf(seq, "present rate: %i%s\n",
1050 foo, battery->info.capacity_mode ? "0 mW" : " mA");
1051 } else { 1049 } else {
1052 seq_printf(seq, "charging state: charged\n"); 1050 seq_printf(seq, "charging state: charged\n");
1053 seq_printf(seq, "present rate: 0 %s\n", 1051 seq_printf(seq, "present rate: 0 %s\n",