aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2014-01-06 09:50:37 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-15 18:28:53 -0500
commit290a699346ae6cc3e4ccfa7bdc1ee4445f6e020f (patch)
tree797d468bcff24cc0509b9796d5f91fae70d945a0 /drivers/acpi
parenta771213d2f2e5f809a3234060ffa58c2b5d7a1b8 (diff)
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
commit a90b40385735af0d3031f98e97b439e8944a31b3 upstream. 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> 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/battery.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 95332717e4f5..99427d7307af 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -68,6 +68,7 @@ MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>");
68MODULE_DESCRIPTION("ACPI Battery Driver"); 68MODULE_DESCRIPTION("ACPI Battery Driver");
69MODULE_LICENSE("GPL"); 69MODULE_LICENSE("GPL");
70 70
71static int battery_bix_broken_package;
71static unsigned int cache_time = 1000; 72static unsigned int cache_time = 1000;
72module_param(cache_time, uint, 0644); 73module_param(cache_time, uint, 0644);
73MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); 74MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -443,7 +444,12 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
443 ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name)); 444 ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name));
444 return -ENODEV; 445 return -ENODEV;
445 } 446 }
446 if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags)) 447
448 if (battery_bix_broken_package)
449 result = extract_package(battery, buffer.pointer,
450 extended_info_offsets + 1,
451 ARRAY_SIZE(extended_info_offsets) - 1);
452 else if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags))
447 result = extract_package(battery, buffer.pointer, 453 result = extract_package(battery, buffer.pointer,
448 extended_info_offsets, 454 extended_info_offsets,
449 ARRAY_SIZE(extended_info_offsets)); 455 ARRAY_SIZE(extended_info_offsets));
@@ -1064,6 +1070,17 @@ static int battery_notify(struct notifier_block *nb,
1064 return 0; 1070 return 0;
1065} 1071}
1066 1072
1073static struct dmi_system_id bat_dmi_table[] = {
1074 {
1075 .ident = "NEC LZ750/LS",
1076 .matches = {
1077 DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
1078 DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"),
1079 },
1080 },
1081 {},
1082};
1083
1067static int acpi_battery_add(struct acpi_device *device) 1084static int acpi_battery_add(struct acpi_device *device)
1068{ 1085{
1069 int result = 0; 1086 int result = 0;
@@ -1174,6 +1191,8 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
1174 if (!acpi_battery_dir) 1191 if (!acpi_battery_dir)
1175 return; 1192 return;
1176#endif 1193#endif
1194 if (dmi_check_system(bat_dmi_table))
1195 battery_bix_broken_package = 1;
1177 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { 1196 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
1178#ifdef CONFIG_ACPI_PROCFS_POWER 1197#ifdef CONFIG_ACPI_PROCFS_POWER
1179 acpi_unlock_battery_dir(acpi_battery_dir); 1198 acpi_unlock_battery_dir(acpi_battery_dir);