Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mfenniak/f313f9a94fbcfa8fb52f978f29393ab1 to your computer and use it in GitHub Desktop.
Save mfenniak/f313f9a94fbcfa8fb52f978f29393ab1 to your computer and use it in GitHub Desktop.
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index fceffe2082ec..ed3633c5955d 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -145,6 +145,10 @@ static struct quirk_entry quirk_asus_ignore_fan = {
.wmi_ignore_fan = true,
};
+static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
+ .ignore_key_wlan = true,
+};
+
static int dmi_matched(const struct dmi_system_id *dmi)
{
pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -516,6 +520,15 @@ static const struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_ignore_fan,
},
+ {
+ .callback = dmi_matched,
+ .ident = "ASUS Zenbook Duo UX8406MA",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "UX8406MA"),
+ },
+ .driver_data = &quirk_asus_zenbook_duo_kbd,
+ },
{},
};
@@ -630,7 +643,12 @@ static void asus_nb_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code,
case 0x32: /* Volume Mute */
if (atkbd_reports_vol_keys)
*code = ASUS_WMI_KEY_IGNORE;
-
+ break;
+ case 0x5D: /* Wireless console Toggle */
+ case 0x5E: /* Wireless console Enable */
+ case 0x5F: /* Wireless console Disable */
+ if (quirks->ignore_key_wlan)
+ *code = ASUS_WMI_KEY_IGNORE;
break;
}
}
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index cc30f1853847..a6ee9440d932 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -50,6 +50,7 @@ struct quirk_entry {
*/
int no_display_toggle;
u32 xusb2pr;
+ bool ignore_key_wlan;
};
struct asus_wmi_driver {
@mfenniak
Copy link
Author

@nalim It seems to make sense to me. I don't feel that I have any expertise in this area, but triggering a "tablet mode" capability like that seems logical, and, if it doesn't result in the rfkill system being triggered since the event is consumed that still addresses my major annoyance.

Just so you're fully aware, I'm not a maintainer in any of these areas being patched -- I followed the standard kernel patch process to submit mine upstream to the platform-x86 maintainer who merged it. I would happily test the full patch to help support your change, and if any questions arise on the flip-flop from one behavior to another I'd contribute my 👍 to changing to this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment