mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Patryk Pilichowski <pat.pilichowski@gmail.com>
To: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Patryk Pilichowski <pat.pilichowski@gmail.com>
Subject: [PATCH v2 1/2] platform/x86: msi-wmi: Sort scancodes numerically
Date: Tue, 20 Oct 2026 16:14:26 +0200	[thread overview]
Message-ID: <20261020141427.1580282-2-pat.pilichowski@gmail.com> (raw)
In-Reply-To: <20261020141427.1580282-1-pat.pilichowski@gmail.com>

The scancode enum is grouped by model, so the values are not in order
and are hard to follow. The grouping is not meaningful either, as the
same event codes are used across MSI models.

Sort the enum by scancode, give every entry an explicit value and use
lowercase hex.

No functional change.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Patryk Pilichowski <pat.pilichowski@gmail.com>
---
 drivers/platform/x86/msi-wmi.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index 05c35133a1b3..5369ac28f4c5 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -33,25 +33,22 @@ MODULE_ALIAS("wmi:" MSIWMI_MSI_EVENT_GUID);
 MODULE_ALIAS("wmi:" MSIWMI_WIND_EVENT_GUID);
 
 enum msi_scancodes {
-	/* Generic MSI keys (not present on MSI Wind) */
-	MSI_KEY_BRIGHTNESSUP	= 0xD0,
-	MSI_KEY_BRIGHTNESSDOWN,
-	MSI_KEY_VOLUMEUP,
-	MSI_KEY_VOLUMEDOWN,
-	MSI_KEY_MUTE,
-	/* MSI Wind keys */
 	WIND_KEY_TOUCHPAD	= 0x08,	/* Fn+F3 touchpad toggle */
-	WIND_KEY_BLUETOOTH	= 0x56,	/* Fn+F11 Bluetooth toggle */
-	WIND_KEY_CAMERA,		/* Fn+F6 webcam toggle */
-	WIND_KEY_WLAN		= 0x5f,	/* Fn+F11 Wi-Fi toggle */
-	WIND_KEY_TURBO,			/* Fn+F10 turbo mode toggle */
-	WIND_KEY_ECO		= 0x69,	/* Fn+F10 ECO mode toggle */
-	/* MSI Claw keys */
 	CLAW_KEY_VOLUMEDOWN	= 0x21,
 	CLAW_KEY_CENTER		= 0x29,	/* MSI M-Center main menu */
 	CLAW_KEY_QUICK_LONG	= 0x2a,	/* MSI M-Center quick access long hold */
 	CLAW_KEY_VOLUMEUP	= 0x32,
+	WIND_KEY_BLUETOOTH	= 0x56,	/* Fn+F11 Bluetooth toggle */
+	WIND_KEY_CAMERA		= 0x57,	/* Fn+F6 webcam toggle */
 	CLAW_KEY_QUICK_SHORT	= 0x58,	/* MSI M-Center quick access short press */
+	WIND_KEY_WLAN		= 0x5f,	/* Fn+F11 Wi-Fi toggle */
+	WIND_KEY_TURBO		= 0x60,	/* Fn+F10 turbo mode toggle */
+	WIND_KEY_ECO		= 0x69,	/* Fn+F10 ECO mode toggle */
+	MSI_KEY_BRIGHTNESSUP	= 0xd0,
+	MSI_KEY_BRIGHTNESSDOWN	= 0xd1,
+	MSI_KEY_VOLUMEUP	= 0xd2,
+	MSI_KEY_VOLUMEDOWN	= 0xd3,
+	MSI_KEY_MUTE		= 0xd4,
 };
 static struct key_entry msi_wmi_keymap[] = {
 	{ KE_KEY, MSI_KEY_BRIGHTNESSUP,		{KEY_BRIGHTNESSUP} },
-- 
2.56.0


  reply	other threads:[~2026-10-20 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 14:14 [PATCH v2 0/2] platform/x86: msi-wmi: Ignore WMI events for keys also handled by atkbd Patryk Pilichowski
2026-10-20 14:14 ` Patryk Pilichowski [this message]
2026-10-20 14:14 ` [PATCH v2 2/2] " Patryk Pilichowski

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=20261020141427.1580282-2-pat.pilichowski@gmail.com \
    --to=pat.pilichowski@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.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®