Skip to contentSkip to conversation

ACPI: Don't report current_now if battery reports in mWh

PATCH In review Matthew Garrett 4 participants 4 messages Aug 23, 2010 – Aug 24, 2010 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: Don't report current_now if battery reports in mWh

ACPI batteries can report in units of either current or energy. Right now we expose the current_now file even if the battery is reporting energy units, resulting in a file that should contain mA instead containing mW. Don't expose this value unless the battery is reporting current.

Cc Arjan van de Ven <[email protected]>
---
 drivers/acpi/battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/battery.c +0 -1
index dc58402..9841720 100644
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
 	POWER_SUPPLY_PROP_CYCLE_COUNT,
 	POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
 	POWER_SUPPLY_PROP_VOLTAGE_NOW,
-	POWER_SUPPLY_PROP_CURRENT_NOW,
 	POWER_SUPPLY_PROP_POWER_NOW,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_FULL,
Signature · 1 line
1.7.2.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Matthew Garrett

ACPI batteries can report in units of either current or energy. Right now we expose the current_now file even if the battery is reporting energy units, resulting in a file that should contain mA instead containing mW. Don't expose this value unless the battery is reporting current.

Cc Arjan van de Ven <[email protected]>
Quoted 17 lines
---
 drivers/acpi/battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/battery.c +0 -1
index dc58402..9841720 100644
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
 	POWER_SUPPLY_PROP_CYCLE_COUNT,
 	POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
 	POWER_SUPPLY_PROP_VOLTAGE_NOW,
-	POWER_SUPPLY_PROP_CURRENT_NOW,
 	POWER_SUPPLY_PROP_POWER_NOW,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_FULL,
#2 lore raw
Quoted 11 lines · Rafael J. Wysocki
Quoted 8 lines · Matthew Garrett

ACPI batteries can report in units of either current or energy. Right now we expose the current_now file even if the battery is reporting energy units, resulting in a file that should contain mA instead containing mW. Don't expose this value unless the battery is reporting current.

Cc Arjan van de Ven <[email protected]>

Looks good to me as well.

Should I merge this into the battery-2.6.git tree, or ACPI folks are gonna handle this patch?

Thanks,

Quoted 17 lines
Quoted 17 lines
---
 drivers/acpi/battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/battery.c +0 -1
index dc58402..9841720 100644
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
 	POWER_SUPPLY_PROP_CYCLE_COUNT,
 	POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
 	POWER_SUPPLY_PROP_VOLTAGE_NOW,
-	POWER_SUPPLY_PROP_CURRENT_NOW,
 	POWER_SUPPLY_PROP_POWER_NOW,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_FULL,
Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
Acked-by
#3 lore raw
Quoted 11 lines · Anton Vorontsov
Quoted 10 lines · Rafael J. Wysocki
Quoted 8 lines · Matthew Garrett

ACPI batteries can report in units of either current or energy. Right now we expose the current_now file even if the battery is reporting energy units, resulting in a file that should contain mA instead containing mW. Don't expose this value unless the battery is reporting current.

Cc Arjan van de Ven <[email protected]>
Quoted 7 lines
Quoted 1 line

Looks good to me as well.

Should I merge this into the battery-2.6.git tree, or ACPI folks are gonna handle this patch?

I think Len may want to handle this patch. :)

thanks,
rui

Quoted 20 lines

Thanks,

Quoted 17 lines
Quoted 17 lines
---
 drivers/acpi/battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/battery.c +0 -1
index dc58402..9841720 100644
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
 	POWER_SUPPLY_PROP_CYCLE_COUNT,
 	POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
 	POWER_SUPPLY_PROP_VOLTAGE_NOW,
-	POWER_SUPPLY_PROP_CURRENT_NOW,
 	POWER_SUPPLY_PROP_POWER_NOW,
 	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
 	POWER_SUPPLY_PROP_ENERGY_FULL,