aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-07-30 08:00:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-11 21:35:24 -0400
commit6813e1d7dcf1db51970149e22f1524336a0bfa24 (patch)
tree082dc63e1e959cb6e0ae6deafc488ee45172a1c3 /drivers/acpi
parentc181b464309da49333b85aa9df1eafe2678f1da3 (diff)
ACPI / battery: Fix parsing _BIX return value
commit 016d5baad04269e8559332df05f89bd95b52d6ad upstream. The _BIX method returns extended battery info as a package. According the ACPI spec (ACPI 5, Section 10.2.2.2), the first member of that package should be "Revision". However, the current ACPI battery driver treats the first member as "Power Unit" which should be the second member. This causes the result of _BIX return data parsing to be incorrect. Fix this by adding a new member called 'revision' to struct acpi_battery and adding the offsetof() information on it to extended_info_offsets[] as the first row. [rjw: Changelog] Reported-and-tested-by: Jan Hoffmann <jan.christian.hoffmann@gmail.com> References: http://bugzilla.kernel.org/show_bug.cgi?id=60519 Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/battery.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index e7100459ac4a..95332717e4f5 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -117,6 +117,7 @@ struct acpi_battery {
117 struct acpi_device *device; 117 struct acpi_device *device;
118 struct notifier_block pm_nb; 118 struct notifier_block pm_nb;
119 unsigned long update_time; 119 unsigned long update_time;
120 int revision;
120 int rate_now; 121 int rate_now;
121 int capacity_now; 122 int capacity_now;
122 int voltage_now; 123 int voltage_now;
@@ -359,6 +360,7 @@ static struct acpi_offsets info_offsets[] = {
359}; 360};
360 361
361static struct acpi_offsets extended_info_offsets[] = { 362static struct acpi_offsets extended_info_offsets[] = {
363 {offsetof(struct acpi_battery, revision), 0},
362 {offsetof(struct acpi_battery, power_unit), 0}, 364 {offsetof(struct acpi_battery, power_unit), 0},
363 {offsetof(struct acpi_battery, design_capacity), 0}, 365 {offsetof(struct acpi_battery, design_capacity), 0},
364 {offsetof(struct acpi_battery, full_charge_capacity), 0}, 366 {offsetof(struct acpi_battery, full_charge_capacity), 0},