diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2014-01-06 09:50:37 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-06 16:28:57 -0500 |
commit | a90b40385735af0d3031f98e97b439e8944a31b3 (patch) | |
tree | fae266418d9debf7685f09f578989e5ac27e2897 /drivers | |
parent | d6e0a2dd12f4067a5bcefb8bbd8ddbeff800afbc (diff) |
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
The AML method _BIX of NEC LZ750/LS returns a broken package which
skips the first member "Revision" (ACPI 5.0, Table 10-234).
Add a quirk for this machine to skip member "Revision" during parsing
the package returned by _BIX.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=67351
Reported-and-tested-by: Francisco Castro <fcr@adinet.com.uy>
Cc: 3.8+ <stable@vger.kernel.org> " 3.8+
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/battery.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index fbf1aceda8b8..5876a49dfd38 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -62,6 +62,7 @@ MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>"); | |||
62 | MODULE_DESCRIPTION("ACPI Battery Driver"); | 62 | MODULE_DESCRIPTION("ACPI Battery Driver"); |
63 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
64 | 64 | ||
65 | static int battery_bix_broken_package; | ||
65 | static unsigned int cache_time = 1000; | 66 | static unsigned int cache_time = 1000; |
66 | module_param(cache_time, uint, 0644); | 67 | module_param(cache_time, uint, 0644); |
67 | MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); | 68 | MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); |
@@ -416,7 +417,12 @@ static int acpi_battery_get_info(struct acpi_battery *battery) | |||
416 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name)); | 417 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name)); |
417 | return -ENODEV; | 418 | return -ENODEV; |
418 | } | 419 | } |
419 | if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags)) | 420 | |
421 | if (battery_bix_broken_package) | ||
422 | result = extract_package(battery, buffer.pointer, | ||
423 | extended_info_offsets + 1, | ||
424 | ARRAY_SIZE(extended_info_offsets) - 1); | ||
425 | else if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags)) | ||
420 | result = extract_package(battery, buffer.pointer, | 426 | result = extract_package(battery, buffer.pointer, |
421 | extended_info_offsets, | 427 | extended_info_offsets, |
422 | ARRAY_SIZE(extended_info_offsets)); | 428 | ARRAY_SIZE(extended_info_offsets)); |
@@ -754,6 +760,17 @@ static int battery_notify(struct notifier_block *nb, | |||
754 | return 0; | 760 | return 0; |
755 | } | 761 | } |
756 | 762 | ||
763 | static struct dmi_system_id bat_dmi_table[] = { | ||
764 | { | ||
765 | .ident = "NEC LZ750/LS", | ||
766 | .matches = { | ||
767 | DMI_MATCH(DMI_SYS_VENDOR, "NEC"), | ||
768 | DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"), | ||
769 | }, | ||
770 | }, | ||
771 | {}, | ||
772 | }; | ||
773 | |||
757 | static int acpi_battery_add(struct acpi_device *device) | 774 | static int acpi_battery_add(struct acpi_device *device) |
758 | { | 775 | { |
759 | int result = 0; | 776 | int result = 0; |
@@ -846,6 +863,9 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) | |||
846 | { | 863 | { |
847 | if (acpi_disabled) | 864 | if (acpi_disabled) |
848 | return; | 865 | return; |
866 | |||
867 | if (dmi_check_system(bat_dmi_table)) | ||
868 | battery_bix_broken_package = 1; | ||
849 | acpi_bus_register_driver(&acpi_battery_driver); | 869 | acpi_bus_register_driver(&acpi_battery_driver); |
850 | } | 870 | } |
851 | 871 | ||