From: David Cemin <dcemin@nvidia.com>
To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, W_Armin@gmx.de
Cc: mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com,
xy-jackie@139.com, i@rong.moe, marco_giunta@outlook.it,
ciro.pedrini@gmail.com, ldemarchi@nvidia.com,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v5 4/4] platform: lenovo: wmi-fn-keys: ignore all Legion keyboard backlight events
Date: Wed, 2 Dec 2026 16:02:51 -0800 [thread overview]
Message-ID: <20261203000251.1006053-5-dcemin@nvidia.com> (raw)
In-Reply-To: <20261203000251.1006053-1-dcemin@nvidia.com>
The keymap ignores 0x19, 0x1a and 0x21, which the Legion Pro 7 16IAX10H
was seen to emit for Fn+Down, Fn+Up and Fn+Space. Marco reports that on
the Legion Pro 7 16AFR10H these events do not name a key, they encode
the state that was reached: Fn+Up and Fn+Down report the new brightness
level (0x18 off, 0x19 low, 0x1a medium, 0x26 high) and Fn+Space reports
the new lighting preset (0x20 to 0x25). The three codes ignored today
are "low", "medium" and "preset 2", so the other seven still reach
userspace as KEY_UNKNOWN.
The keyboard controller handles these keys itself and reports the
brightness on its own HID interface, so none of the events carries an
action for the OS. Ignore all ten.
I have no Legion to test this on: the codes are taken from the report
linked below.
Suggested-by: Marco Giunta <marco_giunta@outlook.it>
Link: https://lore.kernel.org/r/BYAPR19MB229323713AAFB68EC5D8443EFC402@BYAPR19MB2293.namprd19.prod.outlook.com
Signed-off-by: David Cemin <dcemin@nvidia.com>
---
drivers/platform/lenovo/wmi-fn-keys.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/lenovo/wmi-fn-keys.c b/drivers/platform/lenovo/wmi-fn-keys.c
index dc5749be7d83..3710b2232fe3 100644
--- a/drivers/platform/lenovo/wmi-fn-keys.c
+++ b/drivers/platform/lenovo/wmi-fn-keys.c
@@ -71,10 +71,24 @@ static const struct key_entry lwmi_fn_keys_keymap[] = {
{ KE_IGNORE, 0x02 | LWMI_FN_KEY },
/* Esc (handled by the firmware) */
{ KE_IGNORE, 0x03 | LWMI_FN_KEY },
- /* Keyboard backlight down, up and effect (handled by the keyboard) */
+ /*
+ * Legion keyboard backlight level after Fn+Up/Down, handled by the
+ * keyboard: 0x18 off, 0x19 low, 0x1a medium, 0x26 high
+ */
+ { KE_IGNORE, 0x18 | LWMI_FN_KEY },
{ KE_IGNORE, 0x19 | LWMI_FN_KEY },
{ KE_IGNORE, 0x1a | LWMI_FN_KEY },
+ { KE_IGNORE, 0x26 | LWMI_FN_KEY },
+ /*
+ * Legion keyboard lighting preset after Fn+Space, handled by the
+ * keyboard: 0x20 to 0x25 are presets 1 to 6
+ */
+ { KE_IGNORE, 0x20 | LWMI_FN_KEY },
{ KE_IGNORE, 0x21 | LWMI_FN_KEY },
+ { KE_IGNORE, 0x22 | LWMI_FN_KEY },
+ { KE_IGNORE, 0x23 | LWMI_FN_KEY },
+ { KE_IGNORE, 0x24 | LWMI_FN_KEY },
+ { KE_IGNORE, 0x25 | LWMI_FN_KEY },
/*
* Keyboard backlight level after Fn+Space, handled by the firmware:
* 0x40 off, 0x41 low, 0x42 high
--
2.56.1
next prev parent reply other threads:[~2026-12-03 0:03 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 22:27 [RFC PATCH 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers David Cemin
2026-11-13 22:27 ` [RFC PATCH 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-11-15 21:50 ` Mark Pearson
2026-11-16 4:42 ` David Cemin
2026-11-16 16:59 ` Mark Pearson
2026-11-17 2:27 ` Jackie Dong
2026-11-13 22:27 ` [RFC PATCH 2/3] platform: lenovo: add WMI hotkeys driver David Cemin
2026-11-15 16:12 ` Armin Wolf
2026-11-16 4:42 ` David Cemin
2026-11-17 1:39 ` Armin Wolf
2026-11-16 10:55 ` Marco Giunta
2026-11-17 3:27 ` Jackie Dong
2026-11-19 2:29 ` David Cemin
2026-11-19 12:12 ` Jackie Dong
2026-11-13 22:27 ` [RFC PATCH 3/3] platform/x86: ideapad-laptop: do not bind the WMI event devices without the VPC David Cemin
2026-11-15 15:33 ` [RFC PATCH 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers Hans de Goede
2026-11-15 16:02 ` Armin Wolf
2026-11-15 18:02 ` Hans de Goede
2026-11-15 20:10 ` Hans de Goede
2026-11-15 20:12 ` Hans de Goede
2026-11-15 21:48 ` Mark Pearson
2026-11-16 4:42 ` David Cemin
2026-11-19 2:27 ` [PATCH v2 " David Cemin
2026-11-19 2:27 ` [PATCH v2 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-11-19 12:49 ` Rong Zhang
2026-11-19 2:27 ` [PATCH v2 2/3] platform: lenovo: add WMI hotkeys driver David Cemin
2026-11-19 6:10 ` Armin Wolf
2026-11-19 12:56 ` Rong Zhang
2026-11-19 2:27 ` [PATCH v2 3/3] platform/x86: ideapad-laptop: consume the Fn key events from the " David Cemin
2026-11-19 6:16 ` Armin Wolf
2026-11-19 13:00 ` Rong Zhang
2026-11-21 3:33 ` [PATCH v3 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers David Cemin
2026-11-21 3:33 ` [PATCH v3 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-11-21 3:33 ` [PATCH v3 2/3] platform: lenovo: add WMI Fn keys driver and use it from ideapad-laptop David Cemin
2026-11-21 10:42 ` Rong Zhang
2026-11-21 20:53 ` Rong Zhang
2026-11-30 4:31 ` David Cemin
2026-11-21 3:33 ` [PATCH v3 3/3] platform: lenovo: wmi-fn-keys: ignore the keyboard backlight level events David Cemin
2026-11-21 10:44 ` Rong Zhang
2026-11-30 4:31 ` David Cemin
2026-11-30 4:32 ` [PATCH v4 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers David Cemin
2026-11-30 4:32 ` [PATCH v4 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-12-02 11:36 ` Rong Zhang
2026-11-30 4:32 ` [PATCH v4 2/3] platform: lenovo: add WMI Fn keys driver and use it from ideapad-laptop David Cemin
2026-11-30 4:32 ` [PATCH v4 3/3] platform: lenovo: wmi-fn-keys: ignore the keyboard backlight level events David Cemin
2026-12-03 0:02 ` [PATCH v5 0/4] platform: lenovo: architecture independent home for the Lenovo WMI drivers David Cemin
2026-12-03 0:02 ` [PATCH v5 1/4] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-12-03 0:02 ` [PATCH v5 2/4] platform: lenovo: add WMI Fn keys driver and use it from ideapad-laptop David Cemin
2026-12-03 0:02 ` [PATCH v5 3/4] platform: lenovo: wmi-fn-keys: ignore the keyboard backlight level events David Cemin
2026-12-03 0:02 ` David Cemin [this message]
2026-12-03 10:29 ` [PATCH v5 4/4] platform: lenovo: wmi-fn-keys: ignore all Legion keyboard backlight events Marco Giunta
2026-12-03 12:09 ` Rong Zhang
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=20261203000251.1006053-5-dcemin@nvidia.com \
--to=dcemin@nvidia.com \
--cc=W_Armin@gmx.de \
--cc=ciro.pedrini@gmail.com \
--cc=derekjohn.clark@gmail.com \
--cc=hansg@kernel.org \
--cc=i@rong.moe \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=ldemarchi@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco_giunta@outlook.it \
--cc=mpearson-lenovo@squebb.ca \
--cc=platform-driver-x86@vger.kernel.org \
--cc=xy-jackie@139.com \
/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®