* [PATCH] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA
@ 2024-08-23 11:56 Mathieu Fenniak
2024-08-23 13:43 ` Ilpo Järvinen
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Fenniak @ 2024-08-23 11:56 UTC (permalink / raw)
Cc: Mathieu Fenniak, Corentin Chary, Luke D. Jones, Hans de Goede,
Ilpo Järvinen, platform-driver-x86, linux-kernel
The Asus Zenbook Duo (UX8406MA) has a keyboard which can be
placed on the laptop to connect it via USB, or can be removed from the
laptop to reveal a hidden secondary display in which case the keyboard
operates via Bluetooth.
When it is placed on the secondary display to connect via USB, it emits
a keypress for a wireless disable. This causes the rfkill system to be
activated disconnecting the current wifi connection, which doesn't
reflect the user's true intention.
Detect this hardware and suppress any wireless switches from the
keyboard; this keyboard does not have a wireless toggle capability so
these presses are always suprious.
Signed-off-by: Mathieu Fenniak <mathieu@fenniak.net>
---
drivers/platform/x86/asus-nb-wmi.c | 20 +++++++++++++++++++-
drivers/platform/x86/asus-wmi.h | 1 +
2 files changed, 20 insertions(+), 1 deletion(-)
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 {
--
2.44.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA
2024-08-23 11:56 [PATCH] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA Mathieu Fenniak
@ 2024-08-23 13:43 ` Ilpo Järvinen
2024-08-23 13:56 ` [PATCH v2] " Mathieu Fenniak
0 siblings, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2024-08-23 13:43 UTC (permalink / raw)
To: Mathieu Fenniak
Cc: Corentin Chary, Luke D. Jones, Hans de Goede, platform-driver-x86,
LKML
[-- Attachment #1: Type: text/plain, Size: 3059 bytes --]
On Fri, 23 Aug 2024, Mathieu Fenniak wrote:
> The Asus Zenbook Duo (UX8406MA) has a keyboard which can be
> placed on the laptop to connect it via USB, or can be removed from the
> laptop to reveal a hidden secondary display in which case the keyboard
> operates via Bluetooth.
>
> When it is placed on the secondary display to connect via USB, it emits
> a keypress for a wireless disable. This causes the rfkill system to be
One space is enough (the second one might have been auto-added by your
editor).
> activated disconnecting the current wifi connection, which doesn't
> reflect the user's true intention.
>
> Detect this hardware and suppress any wireless switches from the
> keyboard; this keyboard does not have a wireless toggle capability so
> these presses are always suprious.
spurious
>
> Signed-off-by: Mathieu Fenniak <mathieu@fenniak.net>
> ---
> drivers/platform/x86/asus-nb-wmi.c | 20 +++++++++++++++++++-
> drivers/platform/x86/asus-wmi.h | 1 +
> 2 files changed, 20 insertions(+), 1 deletion(-)
>
> 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;
Please put this next to the other bool values.
Seems fine otherwise so after correcting these small things, you can add:
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA
2024-08-23 13:43 ` Ilpo Järvinen
@ 2024-08-23 13:56 ` Mathieu Fenniak
2024-08-26 11:43 ` Ilpo Järvinen
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Fenniak @ 2024-08-23 13:56 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Mathieu Fenniak, Corentin Chary, Luke D. Jones, Hans de Goede,
platform-driver-x86, linux-kernel
The Asus Zenbook Duo (UX8406MA) has a keyboard which can be
placed on the laptop to connect it via USB, or can be removed from the
laptop to reveal a hidden secondary display in which case the keyboard
operates via Bluetooth.
When it is placed on the secondary display to connect via USB, it emits
a keypress for a wireless disable. This causes the rfkill system to be
activated disconnecting the current wifi connection, which doesn't
reflect the user's true intention.
Detect this hardware and suppress any wireless switches from the
keyboard; this keyboard does not have a wireless toggle capability so
these presses are always spurious.
Signed-off-by: Mathieu Fenniak <mathieu@fenniak.net>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/platform/x86/asus-nb-wmi.c | 20 +++++++++++++++++++-
drivers/platform/x86/asus-wmi.h | 1 +
2 files changed, 20 insertions(+), 1 deletion(-)
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..d02f15fd3482 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -40,6 +40,7 @@ struct quirk_entry {
bool wmi_force_als_set;
bool wmi_ignore_fan;
bool filter_i8042_e1_extended_codes;
+ bool ignore_key_wlan;
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
int wapf;
/*
--
2.44.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA
2024-08-23 13:56 ` [PATCH v2] " Mathieu Fenniak
@ 2024-08-26 11:43 ` Ilpo Järvinen
0 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2024-08-26 11:43 UTC (permalink / raw)
To: Mathieu Fenniak
Cc: Corentin Chary, Luke D. Jones, Hans de Goede, platform-driver-x86,
linux-kernel
On Fri, 23 Aug 2024 15:56:28 +0200, Mathieu Fenniak wrote:
> The Asus Zenbook Duo (UX8406MA) has a keyboard which can be
> placed on the laptop to connect it via USB, or can be removed from the
> laptop to reveal a hidden secondary display in which case the keyboard
> operates via Bluetooth.
>
> When it is placed on the secondary display to connect via USB, it emits
> a keypress for a wireless disable. This causes the rfkill system to be
> activated disconnecting the current wifi connection, which doesn't
> reflect the user's true intention.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA
commit: 9286dfd5735b9cceb6a14bdf15e13400ccb60fe7
--
i.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-26 11:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 11:56 [PATCH] platform/x86: asus-wmi: Fix spurious rfkill on UX8406MA Mathieu Fenniak
2024-08-23 13:43 ` Ilpo Järvinen
2024-08-23 13:56 ` [PATCH v2] " Mathieu Fenniak
2024-08-26 11:43 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox