summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-asus.c
diff options
context:
space:
mode:
authorLuke D Jones <luke@ljones.dev>2021-04-18 21:12:29 +1200
committerJiri Kosina <jkosina@suse.cz>2021-05-05 14:40:42 +0200
commitc980512b4512adf2c6f9edb948ce19423b23124d (patch)
treee6a36bb0d006081069ab0d5d4f079936f49083dd /drivers/hid/hid-asus.c
parentedb032033da0dc850f6e7740fa1023c73195bc89 (diff)
downloadlwn-c980512b4512adf2c6f9edb948ce19423b23124d.tar.gz
lwn-c980512b4512adf2c6f9edb948ce19423b23124d.zip
HID: asus: filter G713/G733 key event to prevent shutdown
The G713 and G733 both emit an unexpected keycode on some key presses such as Fn+Pause. The device in this case is emitting two events on key down, and 3 on key up, the third key up event is report ID 0x02 and is unfiltered, causing incorrect event. This patch filters out the single problematic event. Signed-off-by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-asus.c')
-rw-r--r--drivers/hid/hid-asus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 1ed1c05c3d54..60606c11bdaf 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -355,6 +355,16 @@ static int asus_raw_event(struct hid_device *hdev,
return -1;
}
}
+ if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
+ /*
+ * G713 and G733 send these codes on some keypresses, depending on
+ * the key pressed it can trigger a shutdown event if not caught.
+ */
+ if(data[0] == 0x02 && data[1] == 0x30) {
+ return -1;
+ }
+ }
+
}
return 0;