diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2011-07-01 04:03:39 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-07-14 00:01:34 -0400 |
commit | e4108292cc5b5ca07abc83af31a78338362810ca (patch) | |
tree | 77bd78f45fb5d2ba51ec36c3e6b8c46cdffc0354 /drivers/acpi | |
parent | 1dd5c715e5b7524da8c1030f5cf1ea903e45c457 (diff) |
ACPI / SBS: Correct the value of power_now and power_avg in the sysfs
https://bugzilla.kernel.org/show_bug.cgi?id=24492
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/sbs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 01dad1bedd17..c517ec8106e9 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -230,11 +230,17 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy, | |||
230 | case POWER_SUPPLY_PROP_POWER_NOW: | 230 | case POWER_SUPPLY_PROP_POWER_NOW: |
231 | val->intval = abs(battery->rate_now) * | 231 | val->intval = abs(battery->rate_now) * |
232 | acpi_battery_ipscale(battery) * 1000; | 232 | acpi_battery_ipscale(battery) * 1000; |
233 | val->intval *= (acpi_battery_mode(battery)) ? | ||
234 | (battery->voltage_now * | ||
235 | acpi_battery_vscale(battery) / 1000) : 1; | ||
233 | break; | 236 | break; |
234 | case POWER_SUPPLY_PROP_CURRENT_AVG: | 237 | case POWER_SUPPLY_PROP_CURRENT_AVG: |
235 | case POWER_SUPPLY_PROP_POWER_AVG: | 238 | case POWER_SUPPLY_PROP_POWER_AVG: |
236 | val->intval = abs(battery->rate_avg) * | 239 | val->intval = abs(battery->rate_avg) * |
237 | acpi_battery_ipscale(battery) * 1000; | 240 | acpi_battery_ipscale(battery) * 1000; |
241 | val->intval *= (acpi_battery_mode(battery)) ? | ||
242 | (battery->voltage_now * | ||
243 | acpi_battery_vscale(battery) / 1000) : 1; | ||
238 | break; | 244 | break; |
239 | case POWER_SUPPLY_PROP_CAPACITY: | 245 | case POWER_SUPPLY_PROP_CAPACITY: |
240 | val->intval = battery->state_of_charge; | 246 | val->intval = battery->state_of_charge; |