diff mbox series

[3/4] platform/x86: asus-wmi: Add wmi_uses_dsts2 quirk

Message ID 20190703154102.20002-3-Nemcev_Aleksey@inbox.ru (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/4] platform/x86: asus-wmi: Add wmi_needs_3_args quirk | expand

Commit Message

Nemcev Aleksey July 3, 2019, 3:41 p.m. UTC
From: Aleksey Nemcev <Nemcev_Aleksey@inbox.ru>

This quirk force driver to use ASUS_WMI_METHODID_DSTS2 to detect featues
It is requiered on some Asus notebook models like FX705GE with buggy
WMI which does not return ASUS_WMI_UNSUPPORTED_METHOD on unsupported
methods

Fixes detection of keyboard backlight on Asus FX705GE

Signed-off-by: Aleksey Nemcev <Nemcev_Aleksey@inbox.ru>
---
 drivers/platform/x86/asus-nb-wmi.c | 11 ++++++-----
 drivers/platform/x86/asus-wmi.c    |  3 +++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 10 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index bf937321f42e..5d98f5bdba14 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -85,6 +85,11 @@  static struct quirk_entry quirk_asus_x55u = {
 	.no_display_toggle = true,
 };
 
+static struct quirk_entry quirk_asus_fx705ge = {
+	.wmi_needs_3_args = true,
+	.wmi_uses_dsts2 = true,
+};
+
 static struct quirk_entry quirk_asus_wapf4 = {
 	.wapf = 4,
 	.wmi_backlight_set_devstate = true,
@@ -110,10 +115,6 @@  static struct quirk_entry quirk_asus_forceals = {
 	.wmi_force_als_set = true,
 };
 
-static struct quirk_entry quirk_asus_wmi_needs_3_args = {
-	.wmi_needs_3_args = true,
-};
-
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -414,7 +415,7 @@  static const struct dmi_system_id asus_quirks[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME,
 				  "TUF Gaming FX705GE_FX705GE"),
 		},
-		.driver_data = &quirk_asus_wmi_needs_3_args,
+		.driver_data = &quirk_asus_fx705ge,
 	},
 	{},
 };
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 56a407fa8944..4c62425f99c8 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1946,6 +1946,9 @@  static int asus_wmi_platform_init(struct asus_wmi *asus)
 	else
 		asus->dsts_id = ASUS_WMI_METHODID_DSTS2;
 
+	if (asus->driver->quirks->wmi_uses_dsts2)
+		asus->dsts_id = ASUS_WMI_METHODID_DSTS2;
+
 	/* CWAP allow to define the behavior of the Fn+F2 key,
 	 * this method doesn't seems to be present on Eee PCs */
 	if (asus->driver->quirks->wapf >= 0)
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 9568e42a6995..3d39de76b01b 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -34,6 +34,7 @@  struct quirk_entry {
 	bool wmi_backlight_set_devstate;
 	bool wmi_force_als_set;
 	bool wmi_needs_3_args;
+	bool wmi_uses_dsts2;
 	int wapf;
 	/*
 	 * For machines with AMD graphic chips, it will send out WMI event