platform/x86: asus-wmi: Add quirk for ASUS Vivobook S14
PATCH v5 1/1 platform/x86: asus-wmi: Add quirk for ASUS Vivobook S14
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(+)
drivers/platform/x86/asus-nb-wmi.c +13 -0
@@ -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, + }, {}, };
drivers/platform/x86/asus-wmi.c +5 -0
@@ -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);
drivers/platform/x86/asus-wmi.h +1 -0
@@ -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;/*
Signature · 1 line
2.48.1
Hi Kevin,
Quoted 5 lines · Kevin Robert Stravers
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.
Your patch is still missing a Signed-off-by line in the commit-message. We can only accept patches with a Signed-off-by line in the commit-message like this:
By adding this line you indicate that you are the author of the code and are submitting it under the existing license for the file which you are modifying (typically GPL-2.0) or that you have permission from the author to submit it under this license. See:
Please resend your patch with a valid Signed-off-by added.
Unrelated to the S-o-b problem I wonder if you've tried setting asus_nb_wmi.wapf=4 on the kernel commandline instead of adding a new mechanism to disable rfkill support all together, see:
/*
* WAPF defines the behavior of the Fn+Fx wlan key
* The significance of values is yet to be found, but
* most of the time:
* Bit | Bluetooth | WLAN * 0 | Hardware | Hardware * 1 | Hardware | Software * 4 | Software | Software
*/
static int wapf = -1;module_param(wapf, uint, 0444);MODULE_PARM_DESC(wapf, "WAPF value");
This would still require a quirk to do this automatically on your model, but it would avoid the need to add a new type of quirk.
Regards,
Hans
Quoted 72 lines
--- 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(+)drivers/platform/x86/asus-nb-wmi.c +13
-0@@ -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, + }, {}, };drivers/platform/x86/asus-wmi.c +5
-0@@ -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);drivers/platform/x86/asus-wmi.h +1
-0@@ -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;/*