diff options
Diffstat (limited to 'drivers/acpi/sbs.c')
-rw-r--r-- | drivers/acpi/sbs.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index f58fc7447ab4..59640d9a0acc 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -59,7 +59,6 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | |||
59 | #define ACPI_AC_CLASS "ac_adapter" | 59 | #define ACPI_AC_CLASS "ac_adapter" |
60 | #define ACPI_BATTERY_CLASS "battery" | 60 | #define ACPI_BATTERY_CLASS "battery" |
61 | #define ACPI_SBS_HID "ACPI0002" | 61 | #define ACPI_SBS_HID "ACPI0002" |
62 | #define ACPI_SBS_DRIVER_NAME "ACPI Smart Battery System Driver" | ||
63 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" | 62 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" |
64 | #define ACPI_SBS_FILE_INFO "info" | 63 | #define ACPI_SBS_FILE_INFO "info" |
65 | #define ACPI_SBS_FILE_STATE "state" | 64 | #define ACPI_SBS_FILE_STATE "state" |
@@ -78,7 +77,7 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | |||
78 | #define MAX_SBS_BAT 4 | 77 | #define MAX_SBS_BAT 4 |
79 | #define MAX_SMBUS_ERR 1 | 78 | #define MAX_SMBUS_ERR 1 |
80 | 79 | ||
81 | ACPI_MODULE_NAME("acpi_sbs"); | 80 | ACPI_MODULE_NAME("sbs"); |
82 | 81 | ||
83 | MODULE_AUTHOR("Rich Townsend"); | 82 | MODULE_AUTHOR("Rich Townsend"); |
84 | MODULE_DESCRIPTION("Smart Battery System ACPI interface driver"); | 83 | MODULE_DESCRIPTION("Smart Battery System ACPI interface driver"); |
@@ -110,7 +109,7 @@ static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus); | |||
110 | static void acpi_sbs_update_queue(void *data); | 109 | static void acpi_sbs_update_queue(void *data); |
111 | 110 | ||
112 | static struct acpi_driver acpi_sbs_driver = { | 111 | static struct acpi_driver acpi_sbs_driver = { |
113 | .name = ACPI_SBS_DRIVER_NAME, | 112 | .name = "sbs", |
114 | .class = ACPI_SBS_CLASS, | 113 | .class = ACPI_SBS_CLASS, |
115 | .ids = ACPI_SBS_HID, | 114 | .ids = ACPI_SBS_HID, |
116 | .ops = { | 115 | .ops = { |
@@ -1034,21 +1033,19 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
1034 | } else { | 1033 | } else { |
1035 | seq_printf(seq, "capacity state: ok\n"); | 1034 | seq_printf(seq, "capacity state: ok\n"); |
1036 | } | 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 | } | ||
1037 | if (battery->state.amperage < 0) { | 1041 | if (battery->state.amperage < 0) { |
1038 | seq_printf(seq, "charging state: discharging\n"); | 1042 | seq_printf(seq, "charging state: discharging\n"); |
1039 | foo = battery->state.remaining_capacity * cscale * 60 / | 1043 | seq_printf(seq, "present rate: %d %s\n", |
1040 | (battery->state.average_time_to_empty == 0 ? 1 : | 1044 | -foo, battery->info.capacity_mode ? "mW" : "mA"); |
1041 | battery->state.average_time_to_empty); | ||
1042 | seq_printf(seq, "present rate: %i%s\n", | ||
1043 | foo, battery->info.capacity_mode ? "0 mW" : " mA"); | ||
1044 | } else if (battery->state.amperage > 0) { | 1045 | } else if (battery->state.amperage > 0) { |
1045 | seq_printf(seq, "charging state: charging\n"); | 1046 | seq_printf(seq, "charging state: charging\n"); |
1046 | foo = (battery->info.full_charge_capacity - | 1047 | seq_printf(seq, "present rate: %d %s\n", |
1047 | battery->state.remaining_capacity) * cscale * 60 / | 1048 | foo, battery->info.capacity_mode ? "mW" : "mA"); |
1048 | (battery->state.average_time_to_full == 0 ? 1 : | ||
1049 | battery->state.average_time_to_full); | ||
1050 | seq_printf(seq, "present rate: %i%s\n", | ||
1051 | foo, battery->info.capacity_mode ? "0 mW" : " mA"); | ||
1052 | } else { | 1049 | } else { |
1053 | seq_printf(seq, "charging state: charged\n"); | 1050 | seq_printf(seq, "charging state: charged\n"); |
1054 | seq_printf(seq, "present rate: 0 %s\n", | 1051 | seq_printf(seq, "present rate: 0 %s\n", |