HID: asus: pass through ROG N-Key Win-lock reports
PATCH 1/1 HID: asus: pass through ROG N-Key Win-lock reports
The ASUS ROG Zephyrus G16 (USB 0b05:19b6) reports its Win-key lock state using a vendor-defined input report:
5d bf 01 01 lock
5d bf 01 00 unlock
The firmware sends these reports when Fn+Super changes the lock state. While locked, it also repeats the lock report when Super is pressed and suppressed.
hid-asus filters all reports with ID 0x5d or 0x5e as continuous AURA echoes. Since the driver's raw_event callback runs before the HID core delivers reports to hidraw, this also prevents userspace from observing the firmware-managed lock state.
Pass only 5d bf 01 xx reports through on the USB ROG N-Key Keyboard2. Continue filtering all other 0x5d reports and all 0x5e reports.
Tested on an ASUS ROG Zephyrus G16 (0b05:19b6) by reading lock and unlock notifications from hidraw while the EC suppressed and restored KEY_LEFTMETA.
--- drivers/hid/hid-asus.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/hid/hid-asus.c +13 -1
@@ -100,6 +100,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");#define QUIRK_ROG_ALLY_XPAD BIT(13)#define QUIRK_HID_FN_LOCK BIT(14)#define QUIRK_FILTER_CAMERA_COMPANION BIT(15) +#define QUIRK_HID_WIN_LOCK BIT(16)#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \ QUIRK_NO_INIT_REPORTS | \
@@ -505,6 +506,16 @@ static int asus_raw_event(struct hid_device *hdev,if (drvdata->quirks &QUIRK_MEDION_E1239T )return asus_e1239t_event (drvdata, data, size); +/* +* Report 0x5d normally carries a continuous stream of AURA echoes. +* Win-key lock notifications use opcode 0xbf; pass those to hidraw. +*/ +if ((drvdata->quirks &QUIRK_HID_WIN_LOCK ) && + size >=4 && + data[0 ] ==FEATURE_KBD_LED_REPORT_ID1 && + data[1 ] ==0xbf && data[2 ] ==0x01 ) +return 0 ; +/* * Skip these report ID, the device emits a continuous stream associated * with the AURA mode it is in which looks like an 'echo'.
@@ -1689,7 +1700,8 @@ static const struct hid_device_id asus_devices[] = { QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, {HID_USB_DEVICE (USB_VENDOR_ID_ASUSTEK ,USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 ), - QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD | QUIRK_HID_FN_LOCK }, +QUIRK_USE_KBD_BACKLIGHT |QUIRK_ROG_NKEY_KEYBOARD | + QUIRK_HID_FN_LOCK | QUIRK_HID_WIN_LOCK }, { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 ), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD | QUIRK_HID_FN_LOCK },
Signature · 1 line
2.55.0