From: "Luke D. Jones" <luke@ljones.dev>
To: linux-input@vger.kernel.org
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
rydberg@bitmath.org, linux-kernel@vger.kernel.org,
"Luke D. Jones" <luke@ljones.dev>
Subject: [PATCH 3/3] HID: asus: reformat the hotkey mapping block
Date: Wed, 3 May 2023 15:47:11 +1200 [thread overview]
Message-ID: <20230503034711.253439-3-luke@ljones.dev> (raw)
In-Reply-To: <20230503034711.253439-1-luke@ljones.dev>
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
next prev parent reply other threads:[~2023-05-03 3:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-05-23 13:17 ` [PATCH 1/3] HID: asus: Add support for ASUS ROG Z13 keyboard Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230503034711.253439-3-luke@ljones.dev \
--to=luke@ljones.dev \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@bitmath.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®