mirror-linux/drivers/platform
Hans de Goede bfcfe6d335
platform/x86: asus-wmi: Fix wlan_ctrl_by_user detection
The wlan_ctrl_by_user detection was introduced by commit a50bd128f2
("asus-wmi: record wlan status while controlled by userapp").

Quoting from that commit's commit message:

"""
When you call WMIMethod(DSTS, 0x00010011) to get WLAN status, it may return

(1) 0x00050001 (On)
(2) 0x00050000 (Off)
(3) 0x00030001 (On)
(4) 0x00030000 (Off)
(5) 0x00000002 (Unknown)

(1), (2) means that the model has hardware GPIO for WLAN, you can call
WMIMethod(DEVS, 0x00010011, 1 or 0) to turn WLAN on/off.
(3), (4) means that the model doesn’t have hardware GPIO, you need to use
API or driver library to turn WLAN on/off, and call
WMIMethod(DEVS, 0x00010012, 1 or 0) to set WLAN LED status.
After you set WLAN LED status, you can see the WLAN status is changed with
WMIMethod(DSTS, 0x00010011). Because the status is recorded lastly
(ex: Windows), you can use it for synchronization.
(5) means that the model doesn’t have WLAN device.

WLAN is the ONLY special case with upper rule.
"""

The wlan_ctrl_by_user flag should be set on 0x0003000? ((3), (4) above)
return values, but the flag mistakenly also gets set on laptops with
0x0005000? ((1), (2)) return values. This is causing rfkill problems on
laptops where 0x0005000? is returned.

Fix the check to only set the wlan_ctrl_by_user flag for 0x0003000?
return values.

Fixes: a50bd128f2 ("asus-wmi: record wlan status while controlled by userapp")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219786
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250501131702.103360-2-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-07 15:46:34 +03:00
..
arm64 platform: arm64: add Huawei Matebook E Go EC driver 2025-03-03 10:55:36 +02:00
chrome - The 7 patch series "powerpc/crash: use generic crashkernel 2025-04-01 10:06:52 -07:00
cznic platform: cznic: CZNIC_PLATFORMS should depend on ARCH_MVEBU 2025-02-14 15:09:51 +01:00
goldfish Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
loongarch ACPI: EC: Enable EC support on LoongArch by default 2024-12-18 20:23:59 +01:00
mellanox mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show() 2025-04-11 12:56:52 +03:00
mips platform: mips: cpu_hwmon: Disable driver on unsupported hardware 2024-06-21 10:22:10 +02:00
olpc platform-drivers-x86 for v6.12-1 2024-09-19 09:16:04 +02:00
surface platform/surface: aggregator_registry: Add Support for Surface Pro 11 2025-03-11 17:25:16 +02:00
x86 platform/x86: asus-wmi: Fix wlan_ctrl_by_user detection 2025-05-07 15:46:34 +03:00
Kconfig platform: cznic: Add preliminary support for Turris Omnia MCU 2024-07-01 15:46:36 +02:00
Makefile platform-drivers-x86 for v6.11-1 2024-07-17 17:05:21 -07:00