aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2017-04-04 15:32:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-12 06:41:17 -0400
commit8d620dff40bab02f4da98c95e2fd47f445f5440a (patch)
tree132d029a2f197defaa89edcf9d8971a1cc05541c /drivers/platform/x86
parent2bd6cc1cce47a4e572ba5f9107b34120cd8c3302 (diff)
platform/x86: acer-wmi: Only supports AMW0_GUID1 on acer family
[ Upstream commit 5241b1938a4d33eee3d3b43f23067c8e5b96db45 ] The AMW0_GUID1 wmi is not only found on Acer family but also other machines like Lenovo, Fujitsu and Medion. In the past, acer-wmi handled those non-Acer machines by quirks list. But actually acer-wmi driver was loaded on any machine that had AMW0_GUID1. This behavior is strange because those machines should be supported by appropriate wmi drivers. e.g. fujitsu-laptop, ideapad-laptop. This patch adds the logic to check the machine that has AMW0_GUID1 should be in Acer/Packard Bell/Gateway white list. But, it still keeps the quirk list of those supported non-acer machines for backward compatibility. Tested-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/acer-wmi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 79d64ea00bfb..a66192f692e3 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -355,6 +355,32 @@ static const struct dmi_system_id acer_blacklist[] __initconst = {
355 {} 355 {}
356}; 356};
357 357
358static const struct dmi_system_id amw0_whitelist[] __initconst = {
359 {
360 .ident = "Acer",
361 .matches = {
362 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
363 },
364 },
365 {
366 .ident = "Gateway",
367 .matches = {
368 DMI_MATCH(DMI_SYS_VENDOR, "Gateway"),
369 },
370 },
371 {
372 .ident = "Packard Bell",
373 .matches = {
374 DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"),
375 },
376 },
377 {}
378};
379
380/*
381 * This quirk table is only for Acer/Gateway/Packard Bell family
382 * that those machines are supported by acer-wmi driver.
383 */
358static const struct dmi_system_id acer_quirks[] __initconst = { 384static const struct dmi_system_id acer_quirks[] __initconst = {
359 { 385 {
360 .callback = dmi_matched, 386 .callback = dmi_matched,
@@ -464,6 +490,17 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
464 }, 490 },
465 .driver_data = &quirk_acer_travelmate_2490, 491 .driver_data = &quirk_acer_travelmate_2490,
466 }, 492 },
493 {}
494};
495
496/*
497 * This quirk list is for those non-acer machines that have AMW0_GUID1
498 * but supported by acer-wmi in past days. Keeping this quirk list here
499 * is only for backward compatible. Please do not add new machine to
500 * here anymore. Those non-acer machines should be supported by
501 * appropriate wmi drivers.
502 */
503static const struct dmi_system_id non_acer_quirks[] __initconst = {
467 { 504 {
468 .callback = dmi_matched, 505 .callback = dmi_matched,
469 .ident = "Fujitsu Siemens Amilo Li 1718", 506 .ident = "Fujitsu Siemens Amilo Li 1718",
@@ -598,6 +635,7 @@ static void __init find_quirks(void)
598{ 635{
599 if (!force_series) { 636 if (!force_series) {
600 dmi_check_system(acer_quirks); 637 dmi_check_system(acer_quirks);
638 dmi_check_system(non_acer_quirks);
601 } else if (force_series == 2490) { 639 } else if (force_series == 2490) {
602 quirks = &quirk_acer_travelmate_2490; 640 quirks = &quirk_acer_travelmate_2490;
603 } 641 }
@@ -2108,6 +2146,24 @@ static int __init acer_wmi_init(void)
2108 find_quirks(); 2146 find_quirks();
2109 2147
2110 /* 2148 /*
2149 * The AMW0_GUID1 wmi is not only found on Acer family but also other
2150 * machines like Lenovo, Fujitsu and Medion. In the past days,
2151 * acer-wmi driver handled those non-Acer machines by quirks list.
2152 * But actually acer-wmi driver was loaded on any machines that have
2153 * AMW0_GUID1. This behavior is strange because those machines should
2154 * be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
2155 * ideapad-laptop. So, here checks the machine that has AMW0_GUID1
2156 * should be in Acer/Gateway/Packard Bell white list, or it's already
2157 * in the past quirk list.
2158 */
2159 if (wmi_has_guid(AMW0_GUID1) &&
2160 !dmi_check_system(amw0_whitelist) &&
2161 quirks == &quirk_unknown) {
2162 pr_err("Unsupported machine has AMW0_GUID1, unable to load\n");
2163 return -ENODEV;
2164 }
2165
2166 /*
2111 * Detect which ACPI-WMI interface we're using. 2167 * Detect which ACPI-WMI interface we're using.
2112 */ 2168 */
2113 if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1)) 2169 if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))