* [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard
@ 2023-05-03 3:47 Luke D. Jones
2023-05-03 3:47 ` [PATCH 2/3] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7 Luke D. Jones
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Luke D. Jones @ 2023-05-03 3:47 UTC (permalink / raw)
To: linux-input
Cc: jikos, benjamin.tissoires, rydberg, linux-kernel, Luke D. Jones
Add support for the ROG Z13 keyboard. This is a variant of the last
few ASUS ROG keyboards and has much of the same functionality.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 3 +++
drivers/hid/hid-ids.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index d1094bb1aa42..ac93f987d822 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -1267,6 +1267,9 @@ static const struct hid_device_id asus_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2),
QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
+ USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3),
+ QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD),
QUIRK_ROG_CLAYMORE_II_KEYBOARD },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index c2e9b6d1fd7d..513290a2e91c 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -207,6 +207,7 @@
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6
+#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30
#define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
#define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
--
2.40.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7
2023-05-03 3:47 [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Luke D. Jones
@ 2023-05-03 3:47 ` Luke D. Jones
2023-05-03 3:47 ` [PATCH 3/3] HID: asus: reformat the hotkey mapping block Luke D. Jones
2023-05-23 13:17 ` [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Luke D. Jones @ 2023-05-03 3:47 UTC (permalink / raw)
To: linux-input
Cc: jikos, benjamin.tissoires, rydberg, linux-kernel, Luke D. Jones
These two keys are found on some models with dual display.
- 0x6a is intended for controlling the secondary screen brightness.
- 0x4b is intended for toggling the arrow keys between arrows and
page up / page down.
This key is found on a slightly modified keyboard layout.
- 0xc7 is intended to cycle through keybvoard brightnesses (upwards) but
there is not suitable existing code for this behaviour. Using
`KEY_KBDILLUMTOGGLE` is different behaviour to Windows but at least
is picked up by many desktops already.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index ac93f987d822..918d0d05ca88 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -883,6 +883,7 @@ static int asus_input_mapping(struct hid_device *hdev,
case 0xb5: asus_map_key_clear(KEY_CALC); break;
case 0xc4: asus_map_key_clear(KEY_KBDILLUMUP); break;
case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN); break;
+ case 0xc7: asus_map_key_clear(KEY_KBDILLUMTOGGLE); break;
/* ASUS touchpad toggle */
case 0x6b: asus_map_key_clear(KEY_F21); break;
@@ -911,6 +912,12 @@ static int asus_input_mapping(struct hid_device *hdev,
/* Fn+Right Aura mode next on N-Key keyboard */
case 0xb3: asus_map_key_clear(KEY_PROG3); break;
+ /* Screenpad toggle on N-Key keyboard */
+ case 0x6a: asus_map_key_clear(KEY_F13); break;
+
+ /* Arrows/Page-up/Down toggle on N-Key keyboard */
+ case 0x4b: asus_map_key_clear(KEY_F14); break;
+
default:
/* ASUS lazily declares 256 usages, ignore the rest,
* as some make the keyboard appear as a pointer device. */
--
2.40.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] HID: asus: reformat the hotkey mapping block
2023-05-03 3:47 [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Luke D. Jones
2023-05-03 3:47 ` [PATCH 2/3] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7 Luke D. Jones
@ 2023-05-03 3:47 ` Luke D. Jones
2023-05-23 13:17 ` [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Luke D. Jones @ 2023-05-03 3:47 UTC (permalink / raw)
To: linux-input
Cc: jikos, benjamin.tissoires, rydberg, linux-kernel, Luke D. Jones
Older formatting of this block was beginning to get somewhat cluttered.
Condensing the block and putting comments to the side makes it easier
to read and scan the scancodes plus keycodes.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 44 ++++++++++++------------------------------
1 file changed, 12 insertions(+), 32 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 918d0d05ca88..2bc14e076739 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -885,38 +885,18 @@ static int asus_input_mapping(struct hid_device *hdev,
case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN); break;
case 0xc7: asus_map_key_clear(KEY_KBDILLUMTOGGLE); break;
- /* ASUS touchpad toggle */
- case 0x6b: asus_map_key_clear(KEY_F21); break;
+ case 0x6b: asus_map_key_clear(KEY_F21); break; /* ASUS touchpad toggle */
+ case 0x38: asus_map_key_clear(KEY_PROG1); break; /* ROG key */
+ case 0xba: asus_map_key_clear(KEY_PROG2); break; /* Fn+C ASUS Splendid */
+ case 0x5c: asus_map_key_clear(KEY_PROG3); break; /* Fn+Space Power4Gear */
+ case 0x99: asus_map_key_clear(KEY_PROG4); break; /* Fn+F5 "fan" symbol */
+ case 0xae: asus_map_key_clear(KEY_PROG4); break; /* Fn+F5 "fan" symbol */
+ case 0x92: asus_map_key_clear(KEY_CALC); break; /* Fn+Ret "Calc" symbol */
+ case 0xb2: asus_map_key_clear(KEY_PROG2); break; /* Fn+Left previous aura */
+ case 0xb3: asus_map_key_clear(KEY_PROG3); break; /* Fn+Left next aura */
+ case 0x6a: asus_map_key_clear(KEY_F13); break; /* Screenpad toggle */
+ case 0x4b: asus_map_key_clear(KEY_F14); break; /* Arrows/Pg-Up/Dn toggle */
- /* ROG key */
- case 0x38: asus_map_key_clear(KEY_PROG1); break;
-
- /* Fn+C ASUS Splendid */
- case 0xba: asus_map_key_clear(KEY_PROG2); break;
-
- /* Fn+Space Power4Gear Hybrid */
- case 0x5c: asus_map_key_clear(KEY_PROG3); break;
-
- /* Fn+F5 "fan" symbol on FX503VD */
- case 0x99: asus_map_key_clear(KEY_PROG4); break;
-
- /* Fn+F5 "fan" symbol on N-Key keyboard */
- case 0xae: asus_map_key_clear(KEY_PROG4); break;
-
- /* Fn+Ret "Calc" symbol on N-Key keyboard */
- case 0x92: asus_map_key_clear(KEY_CALC); break;
-
- /* Fn+Left Aura mode previous on N-Key keyboard */
- case 0xb2: asus_map_key_clear(KEY_PROG2); break;
-
- /* Fn+Right Aura mode next on N-Key keyboard */
- case 0xb3: asus_map_key_clear(KEY_PROG3); break;
-
- /* Screenpad toggle on N-Key keyboard */
- case 0x6a: asus_map_key_clear(KEY_F13); break;
-
- /* Arrows/Page-up/Down toggle on N-Key keyboard */
- case 0x4b: asus_map_key_clear(KEY_F14); break;
default:
/* ASUS lazily declares 256 usages, ignore the rest,
@@ -1319,4 +1299,4 @@ static struct hid_driver asus_driver = {
};
module_hid_driver(asus_driver);
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL");
\ No newline at end of file
--
2.40.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard
2023-05-03 3:47 [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Luke D. Jones
2023-05-03 3:47 ` [PATCH 2/3] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7 Luke D. Jones
2023-05-03 3:47 ` [PATCH 3/3] HID: asus: reformat the hotkey mapping block Luke D. Jones
@ 2023-05-23 13:17 ` Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2023-05-23 13:17 UTC (permalink / raw)
To: Luke D. Jones; +Cc: linux-input, benjamin.tissoires, rydberg, linux-kernel
On Wed, 3 May 2023, Luke D. Jones wrote:
> Add support for the ROG Z13 keyboard. This is a variant of the last
> few ASUS ROG keyboards and has much of the same functionality.
>
> Signed-off-by: Luke D. Jones <luke@ljones.dev>
Applied, thanks Luke.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-23 13:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 3:47 [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Luke D. Jones
2023-05-03 3:47 ` [PATCH 2/3] HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7 Luke D. Jones
2023-05-03 3:47 ` [PATCH 3/3] HID: asus: reformat the hotkey mapping block Luke D. Jones
2023-05-23 13:17 ` [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).