Skip to content

Commit 87c7ee7

Browse files
flukejonesJiri Kosina
authored andcommitted
HID: asus: Prevent Claymore sending suspend event
Prevent the ASUS Claymore keyboard from sending a suspend event when the device sleeps itself. The suspend event causes a system suspend if uncaught. Signed off by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent fbf4272 commit 87c7ee7

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

drivers/hid/hid-asus.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
8282
#define QUIRK_T90CHI BIT(9)
8383
#define QUIRK_MEDION_E1239T BIT(10)
8484
#define QUIRK_ROG_NKEY_KEYBOARD BIT(11)
85+
#define QUIRK_ROG_CLAYMORE_II_KEYBOARD BIT(12)
8586

8687
#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
8788
QUIRK_NO_INIT_REPORTS | \
@@ -366,6 +367,17 @@ static int asus_raw_event(struct hid_device *hdev,
366367

367368
}
368369

370+
if (drvdata->quirks & QUIRK_ROG_CLAYMORE_II_KEYBOARD) {
371+
/*
372+
* CLAYMORE II keyboard sends this packet when it goes to sleep
373+
* this causes the whole system to go into suspend.
374+
*/
375+
376+
if(size == 2 && data[0] == 0x02 && data[1] == 0x00) {
377+
return -1;
378+
}
379+
}
380+
369381
return 0;
370382
}
371383

@@ -1225,6 +1237,9 @@ static const struct hid_device_id asus_devices[] = {
12251237
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
12261238
USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2),
12271239
QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
1240+
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
1241+
USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD),
1242+
QUIRK_ROG_CLAYMORE_II_KEYBOARD },
12281243
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
12291244
USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD),
12301245
QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES },

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822
198198
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866
199199
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6
200+
#define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
200201
#define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
201202

202203
#define USB_VENDOR_ID_ATEN 0x0557

0 commit comments

Comments
 (0)