Skip to contentSkip to conversation

platform/x86: panasonic-laptop: Support the hardware wireless switch

PATCH New Alexis Calin 1 participant 1 message Nov 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: panasonic-laptop: Support the hardware wireless switch

The Let's Note CF-SV7 has a hardware wireless switch and an ACPI device MAT0028 ("WLSW"). When the switch is flipped, the firmware queues hotkey index 0x50 on the HKEY device, which this driver reports as "Unknown hotkey event: 0x0050". If a driver for MAT0028 is loaded, the vendor ASL notifies that device instead; no such driver exists in Linux. The firmware itself cuts Bluetooth but leaves Wi-Fi on, so under Linux the switch only turns Bluetooth off.

The switch position is available as SINF[0x0B]: the firmware returns 0xC0 when the radios are enabled and 0x80 when they are disabled (vendor HKEY.SGET(0x0B), from an EC status bit). Bit 7 is used as a check that the entry is a wireless switch, bit 6 as its position.

When MAT0028 is present and SINF[0x0B] has bit 7 set:
- register a read-only rfkill device whose hard block follows the switch, as dell-rbtn does for its slider; NetworkManager and GNOME, which take over rfkill handling from rfkill-input, honour it;
- report SW_RFKILL_ALL on the hotkey input device, for systems that rely on rfkill-input.
Both are updated at probe, on each 0x50 event and after resume.

SINF is now read before the input device is registered, because the switch capability depends on it.

Tested on a CF-SV7 (BIOS V3.00L14) only, with this change backported to Debian's 6.12.118: with GNOME and NetworkManager, Wi-Fi is disabled while the switch is off and reconnects after it is switched back on, and evtest shows SW_RFKILL_ALL following the switch.

Assisted-by LLM

---
Notes beyond the changelog:

A first version reported only SW_RFKILL_ALL. It had no effect on Wi-Fi under GNOME, because gsd-rfkill disables rfkill-input and does not act on the switch event; hence the rfkill hard block, as in dell-rbtn.

The meaning of SINF[0x0B] comes from the CF-SV7 DSDT (HKEY.SGET(0x0B), WLSW/MAT0028). I checked that the EC status bit behind it (EC RAM 0xA6 bit 0, read with ec_sys) follows the switch, and that the driver, loaded while the switch is off, starts with the rfkill device hard-blocked.

Built with W=1, with CONFIG_RFKILL=y and =n, on platform-drivers-x86 for-next. Not checked with sparse. checkpatch flags the Assisted-by trailer as a non-standard signature.

The code and the changelog were drafted with an LLM coding assistant, which also did the DSDT and firmware analysis behind them. I reviewed the change and ran the tests on my machine.

Alex, Cc'ing you since you have several Let's Note models: if any of them has a MAT0028 device, a test there would be very welcome. This is independent of your pending platform_profile RFC, but both touch probe.

---
 drivers/platform/x86/Kconfig            |   1 +
 drivers/platform/x86/panasonic-laptop.c | 126 ++++++++++++++++++++++++++++++--
 2 files changed, 122 insertions(+), 5 deletions(-)
drivers/platform/x86/Kconfig +1 -0
index 78e39cafea91..6ee410f4d490 100644
@@ -677,6 +677,7 @@ config PANASONIC_LAPTOP
 	depends on BACKLIGHT_CLASS_DEVICE
 	depends on ACPI_VIDEO=n || ACPI_VIDEO
 	depends on SERIO_I8042 || SERIO_I8042 = n
+	depends on RFKILL || RFKILL = n
 	select INPUT_SPARSEKMAP
 	help
 	  This driver adds support for access to backlight control and hotkeys
drivers/platform/x86/panasonic-laptop.c +121 -5

198 lines not on this page · raw message

---
base-commit: 61c0dac952b9308884936d05cce97565a5c89af4
change-id: 20261125-panasonic-wireless-switch-8a6973f7fb8e

Best regards,

Signature · 1 line
Alexis Calin <[email protected]>