platform/x86: wireless-hotkey: Add support for Pegatron airplane button
PATCH 1/1 platform/x86: wireless-hotkey: Add support for Pegatron airplane button
The PTK0001 ACPI device is used by the "Pega Radio Switch Device" Windows driver on Pegatron-built laptops like the Medion Akoya E6246. Its airplane mode hotkey sends an 0x88 ACPI notification instead of 0x80.
Store the expected notification value in the device ID table and add support for the PTK0001 ACPI device.
Signed-off-by Alexander Gruhlke <[email protected]>
---
Written with Claude Code (Claude Opus 5.5): it traced Fn+F2 through the DSDT (EC query _Q0B -> Notify(PTK0001, 0x88)) and wrote the patch. I reviewed it.
Tested on a Medion Akoya E6246 (MD63200) on 7.3.4: each Fn+F2 press now reports KEY_RFKILL, which soft-blocks and unblocks Wi-Fi and Bluetooth in turn.
drivers/platform/x86/wireless-hotkey.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/platform/x86/wireless-hotkey.c +10 -5
@@ -11,6 +11,7 @@#include <linux/init.h> #include <linux/input.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/acpi.h> #include <acpi/acpi_bus.h>
@@ -21,17 +22,20 @@ MODULE_ALIAS("acpi*:HPQ6001:*");MODULE_ALIAS ("acpi*:WSTADEF:*" );MODULE_ALIAS ("acpi*:AMDI0051:*" );MODULE_ALIAS ("acpi*:LGEX0815:*" ); +MODULE_ALIAS ("acpi*:PTK0001:*" );struct wl_button {struct input_dev *input_dev;char phys[32 ]; +u32 event; };static const struct acpi_device_id wl_ids[] = { - {"HPQ6001" ,0 }, - {"WSTADEF" ,0 }, - {"AMDI0051" ,0 }, - {"LGEX0815" ,0 }, + {"HPQ6001" ,0x80 }, + {"WSTADEF" ,0x80 }, + {"AMDI0051" ,0x80 }, + {"LGEX0815" ,0x80 }, + {"PTK0001" ,0x88 }, {"" ,0 }, };
@@ -76,7 +80,7 @@ static void wl_notify(acpi_handle handle, u32 event, void *data) {struct wl_button *button = data; -if (event !=0x80 ) { +if (event != button->event) {pr_info ("Received unknown event (0x%x)\n" , event);return ; }
@@ -101,6 +105,7 @@ static int wl_probe(struct platform_device *pdev)if (!button)return -ENOMEM ; + button->event = (uintptr_t )device_get_match_data (&pdev->dev);platform_set_drvdata (pdev, button); err =wireless_input_setup (&pdev->dev);
Signature · 1 line
2.56.1