Skip to contentSkip to conversation

platform/x86: wireless-hotkey: Drive the HP airplane mode LED

PATCH In review ahmad baghereslami 2 participants 3 messages Oct 30 – Nov 19 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: wireless-hotkey: Drive the HP airplane mode LED

HP laptops with the HPQ6001 wireless button have an airplane mode LED next to it (white with radios on, amber in airplane mode) that stays in whatever state the firmware left it on Linux. The HPQ6001 device has a WLED method for it, and HP's Windows Wireless Button Driver (2.1.9.1) calls it from the Wireless Radio LED output report (Generic Desktop usage 0xc7) of the radio management HID collection it exposes:
WLED(1) with radios on, WLED(0) in airplane mode.

When the method exists, register a platform::wlan LED that calls it, with rfkill-any as default trigger, which follows the same state. Restore the LED on resume.

Tested on an HP ZBook 17 G3 (board 80D6) with Ubuntu's 7.0.0 kernel:
WLED(1) and WLED(0) switch the LED white and amber, the firmware does not change it by itself when the button is pressed, and with this patch the LED follows airplane mode toggled with the button and with rfkill.

Reading HP's Windows driver (Ghidra) and the ACPI tables, and writing this patch, were done with the help of an AI coding assistant (Claude); I tested the LED on the machine.

---
 drivers/platform/x86/Kconfig           |  1 +
 drivers/platform/x86/wireless-hotkey.c | 65 +++++++++++++++++++++++++-
 2 files changed, 65 insertions(+), 1 deletion(-)
drivers/platform/x86/Kconfig +1 -0
index 7ee9ff387..3bc09a694 100644
@@ -458,6 +458,7 @@ config WIRELESS_HOTKEY
 	tristate "Wireless hotkey button"
 	depends on ACPI
 	depends on INPUT
+	depends on LEDS_CLASS || !LEDS_CLASS
 	help
 	 This driver provides supports for the wireless buttons found on some AMD,
 	 HP, & Xiaomi laptops.
drivers/platform/x86/wireless-hotkey.c +64 -1

113 lines not on this page · raw message

Signature · 1 line
2.53.0
#1 lore raw

Hi Hans, Ilpo,

A gentle ping on this patch from October 30. Is there anything you would like me to change? It has been running on my ZBook 17 G3 since then, across suspends and a kernel update, without problems.

Thanks,
Ahmad

maintainer
#2 lore raw
In reply to ahmad baghereslami
Quoted 9 lines · ahmad baghereslami

HP laptops with the HPQ6001 wireless button have an airplane mode LED next to it (white with radios on, amber in airplane mode) that stays in whatever state the firmware left it on Linux. The HPQ6001 device has a WLED method for it, and HP's Windows Wireless Button Driver (2.1.9.1) calls it from the Wireless Radio LED output report (Generic Desktop usage 0xc7) of the radio management HID collection it exposes:
WLED(1) with radios on, WLED(0) in airplane mode.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.

The list of commits applied:
[1/1] platform/x86: wireless-hotkey: Drive the HP airplane mode LED

      commit: f230881dc57badee65f94fcbb09c28ed9dfbcd5f

--
i.