aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-05 16:30:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-05 16:30:03 -0500
commitf10a3a32ae2edbe94920ce6827f4c2550eb6ed48 (patch)
tree96f79b4958009440ea360a59afcc2e459fcb71ac /drivers/acpi/battery.c
parentbbeba4c35c252b2e961f09ce6ebe76b2cd5e7e3e (diff)
Revert "ACPI: battery: Convert discharge energy rate to current properly"
This reverts commit 558073dd56707864f09d563b64e7c37c021e89d2, along with the failed try to fix the regression it caused ("ACPI: Fix ACPI battery regression introduced by commit 558073"), which just made things worse. Commit aaad077638be1a25871bcae5e43952d6b63abfca (that failed "Fix ACPI battery regression") got the voltage conversion confused, and fixed the problem with Rafael's battery monitor apparently just by mistake. So revert them both, getting us back to the 2.6.27 state in this, and let's revisit it when people understand what's going on. Noted-by: Paul Martin <pm@debian.org> Requested-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Len Brown <len.brown@intel.com> Cc: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 4fb3c12ac1d8..1423b0c0cd2e 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -173,19 +173,7 @@ static int acpi_battery_get_property(struct power_supply *psy,
173 val->intval = battery->voltage_now * 1000; 173 val->intval = battery->voltage_now * 1000;
174 break; 174 break;
175 case POWER_SUPPLY_PROP_CURRENT_NOW: 175 case POWER_SUPPLY_PROP_CURRENT_NOW:
176 val->intval = battery->current_now; 176 val->intval = battery->current_now * 1000;
177 if (battery->power_unit) {
178 val->intval *= 1000;
179 } else {
180 /*
181 * If power units are mW, convert to mA by dividing by
182 * current voltage.
183 */
184 if (battery->voltage_now)
185 val->intval /= battery->voltage_now;
186 else
187 val->intval = -1;
188 }
189 break; 177 break;
190 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: 178 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
191 case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: 179 case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: