mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCHv5] platform/x86: asus-wmi: Add quirk for ASUS Vivobook S14
@ 2025-03-26 11:31 Kevin Robert Stravers
  2025-03-26 11:38 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Robert Stravers @ 2025-03-26 11:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kevin Robert Stravers, Corentin Chary, Luke D. Jones,
	Hans de Goede, Ilpo Järvinen,
	open list:ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS

The ASUS Vivobook S14 will have wifi disabled on boot as well as
resumption from suspend if the asus-wmi driver invokes rfkill functions.

This patch disables asus-wmi's rfkill usage to prevent the wifi card
from being software disabled.
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  5 +++++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 19 insertions(+)

diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index 3f8b2a324efd..1e6fb9308560 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -150,6 +150,10 @@ static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
 	.ignore_key_wlan = true,
 };
 
+static struct quirk_entry quirk_asus_vivobook_s14 = {
+	.skip_rfkill = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -530,6 +534,15 @@ static const struct dmi_system_id asus_quirks[] = {
 		},
 		.driver_data = &quirk_asus_zenbook_duo_kbd,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUS VivoBook S14",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "S5406SA"),
+		},
+		.driver_data = &quirk_asus_vivobook_s14,
+	},
 	{},
 };
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 38ef778e8c19..42e58a28c3e2 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2138,6 +2138,8 @@ static int asus_new_rfkill(struct asus_wmi *asus,
 
 static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
 {
+	if (asus->driver->quirks->skip_rfkill)
+		return;
 	if (asus->driver->wlan_ctrl_by_user && ashs_present())
 		return;
 
@@ -2188,6 +2190,9 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
 
 static int asus_wmi_rfkill_init(struct asus_wmi *asus)
 {
+	if (asus->driver->quirks->skip_rfkill)
+		return 0;
+
 	int result = 0;
 
 	mutex_init(&asus->hotplug_lock);
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 018dfde4025e..3692de24e326 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -41,6 +41,7 @@ struct quirk_entry {
 	bool wmi_ignore_fan;
 	bool filter_i8042_e1_extended_codes;
 	bool ignore_key_wlan;
+	bool skip_rfkill;
 	enum asus_wmi_tablet_switch_mode tablet_switch_mode;
 	int wapf;
 	/*
-- 
2.48.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-26 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-26 11:31 [PATCHv5] platform/x86: asus-wmi: Add quirk for ASUS Vivobook S14 Kevin Robert Stravers
2025-03-26 11:38 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®