Skip to content

Commit 5ec4596

Browse files
flukejonesgregkh
authored andcommitted
HID: asus: add ROG Ally N-Key ID and keycodes
[ Upstream commit 08b50c6 ] A handful of buttons on the ROG Ally are not actually part of the xpad device and are instead keyboard keys (a typical use of the MCU that asus uses). We attach a group of F<num> key codes which aren't used much and which the handheld community has already accepted as defaults here. Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f742108 commit 5ec4596

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/hid/hid-asus.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,10 @@ static int asus_input_mapping(struct hid_device *hdev,
881881
case 0xb3: asus_map_key_clear(KEY_PROG3); break; /* Fn+Left next aura */
882882
case 0x6a: asus_map_key_clear(KEY_F13); break; /* Screenpad toggle */
883883
case 0x4b: asus_map_key_clear(KEY_F14); break; /* Arrows/Pg-Up/Dn toggle */
884-
884+
case 0xa5: asus_map_key_clear(KEY_F15); break; /* ROG Ally left back */
885+
case 0xa6: asus_map_key_clear(KEY_F16); break; /* ROG Ally QAM button */
886+
case 0xa7: asus_map_key_clear(KEY_F17); break; /* ROG Ally ROG long-press */
887+
case 0xa8: asus_map_key_clear(KEY_F18); break; /* ROG Ally ROG long-press-release */
885888

886889
default:
887890
/* ASUS lazily declares 256 usages, ignore the rest,
@@ -1273,6 +1276,9 @@ static const struct hid_device_id asus_devices[] = {
12731276
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
12741277
USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3),
12751278
QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
1279+
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
1280+
USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY),
1281+
QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
12761282
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
12771283
USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD),
12781284
QUIRK_ROG_CLAYMORE_II_KEYBOARD },

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866
209209
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6
210210
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30
211+
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY 0x1abe
211212
#define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
212213
#define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
213214

0 commit comments

Comments
 (0)