Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e6d0f5622d30a3b98fb0ba6264d5006a18270890
Commit:     e6d0f5622d30a3b98fb0ba6264d5006a18270890
Parent:     eaefd5fb7d793c9c1bcef1b0c0d5ec3824a85b91
Author:     Vladimir Lebedev <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 10 01:51:13 2007 -0500
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Feb 10 01:51:13 2007 -0500

    ACPI: sbs: fix present rate
    
    http://bugzilla.kernel.org/show_bug.cgi?id=7897
    
    Signed-off-by: Vladimir Lebedev <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/sbs.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index f58fc74..87b48f8 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -1034,21 +1034,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",
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to