Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f10a3a32 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Revert "ACPI: battery: Convert discharge energy rate to current properly"



This reverts commit 558073dd, 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 aaad0776 (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: default avatarPaul Martin <pm@debian.org>
Requested-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <len.brown@intel.com>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bbeba4c3
Loading
Loading
Loading
Loading
+1 −13
Original line number Original line Diff line number Diff line
@@ -173,19 +173,7 @@ static int acpi_battery_get_property(struct power_supply *psy,
		val->intval = battery->voltage_now * 1000;
		val->intval = battery->voltage_now * 1000;
		break;
		break;
	case POWER_SUPPLY_PROP_CURRENT_NOW:
	case POWER_SUPPLY_PROP_CURRENT_NOW:
		val->intval = battery->current_now;
		val->intval = battery->current_now * 1000;
		if (battery->power_unit) {
			val->intval *= 1000;
		} else {
			/*
			 * If power units are mW, convert to mA by dividing by
			 * current voltage.
			 */
			if (battery->voltage_now)
				val->intval /= battery->voltage_now;
			else
				val->intval = -1;
		}
		break;
		break;
	case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
	case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
	case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
	case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: