* [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
@ 2025-03-13 15:17 Gašper Nemgar
2025-03-14 4:38 ` Ike Panhc
2025-03-14 9:34 ` Hans de Goede
0 siblings, 2 replies; 9+ messages in thread
From: Gašper Nemgar @ 2025-03-13 15:17 UTC (permalink / raw)
To: ike.pan; +Cc: linux-kernel
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 30bd366d7..af124aafe 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
/* Specific to some newer models */
{ KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
{ KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
+ /*Star- (User Asignable Key)*/
+ { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
+ /*Eye*/
+ { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
+ /*Performance*/
+ { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
+ /*shift + prtsc*/
+ { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
{ KE_END },
};
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-13 15:17 [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys Gašper Nemgar
@ 2025-03-14 4:38 ` Ike Panhc
2025-03-14 11:52 ` Gergo Koteles
2025-03-14 9:34 ` Hans de Goede
1 sibling, 1 reply; 9+ messages in thread
From: Ike Panhc @ 2025-03-14 4:38 UTC (permalink / raw)
To: Gašper Nemgar; +Cc: linux-kernel, platform-driver-x86@vger.kernel.org
On 3/13/25 23:17, Gašper Nemgar wrote:
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 30bd366d7..af124aafe 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
> /* Specific to some newer models */
> { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> + /*Star- (User Asignable Key)*/
> + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
> + /*Eye*/
> + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
> + /*Performance*/
> + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
> + /*shift + prtsc*/
> + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
>
> { KE_END },
> };
>
Acked-by: Ike Panhc <ike.pan@canonical.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-13 15:17 [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys Gašper Nemgar
2025-03-14 4:38 ` Ike Panhc
@ 2025-03-14 9:34 ` Hans de Goede
[not found] ` <CAKi4K-hFHy4_F+fQghFNNR8cnkojPcE0uXQWsf5+5dbqjXGs0g@mail.gmail.com>
1 sibling, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2025-03-14 9:34 UTC (permalink / raw)
To: Gašper Nemgar, ike.pan
Cc: linux-kernel, platform-driver-x86@vger.kernel.org
Hi Gašper,
Thank you for your patch.
First if all a few generic notes:
1. When sending out v2 of the patch please add
platform-driver-x86@vger.kernel.org to the Cc
2. The patch subject (first line of commit message) should have
a prefix describing the subsystem + driver, e.g. use:
"platform/x86: ideapad-laptop: Add a few new keymap entries"
3. Your patch is missing a signed-off-by, see:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
4. Your commit message / patch should also have a body, e.g.
the entirety of the commit message could look something like this:
-- begin --
platform/x86: ideapad-laptop: Add a few new keymap entries
The Yoga 9 2 in 1 14imh9 introduces 4 new hotkeys which are not
yet in ideapad_keymap[], add entries to map these keys.
Signed-off-by: Gašper Nemgar <your-email-here>
-- end --
A few more specific remarks below based on looking at
this picture of the keyboard:
https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg
On 13-Mar-25 4:17 PM, Gašper Nemgar wrote:
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 30bd366d7..af124aafe 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
> /* Specific to some newer models */
> { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> + /*Star- (User Asignable Key)*/
> + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
Ack.
> + /*Eye*/
> + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
It looks like the laptop already does display-toggle as Fn-F7 although
it like sends super + P for this (AKA meta + P).
So mapping this to KEY_DISPLAYTOGGLE seems wrong, what does this
do under Windows?
Maybe KEY_ZOOM ?
> + /*Performance*/
> + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
I think that instead of mapping this it should be handled specially
and call platform_profile_cycle() instead of sending a key-press
to userspace
> + /*shift + prtsc*/
> + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
Looking a the symbol on the keyboard this should send
KEY_SELECTIVE_SCREENSHOT
>
> { KE_END },
> };
>
Regards,
Hans
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-14 4:38 ` Ike Panhc
@ 2025-03-14 11:52 ` Gergo Koteles
2025-03-14 12:28 ` Gašper Nemgar
0 siblings, 1 reply; 9+ messages in thread
From: Gergo Koteles @ 2025-03-14 11:52 UTC (permalink / raw)
To: Ike Panhc, Gašper Nemgar
Cc: linux-kernel, platform-driver-x86@vger.kernel.org
Hi Gašper,
On 3/13/25 23:17, Gašper Nemgar wrote:
> /* Specific to some newer models */
> { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> + /*Star- (User Asignable Key)*/
Asignable -> Assignable?
Could you please add a space before/after the body of the comment?
> + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
Other Ideapads map this star key to KEY_FAVORITES, for consistency I
think it would be better if this one mapped there too.
Thanks,
Gergo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-14 11:52 ` Gergo Koteles
@ 2025-03-14 12:28 ` Gašper Nemgar
2025-03-14 14:02 ` Gergo Koteles
0 siblings, 1 reply; 9+ messages in thread
From: Gašper Nemgar @ 2025-03-14 12:28 UTC (permalink / raw)
To: Gergo Koteles
Cc: Ike Panhc, linux-kernel, platform-driver-x86@vger.kernel.org
Hello,
This specific laptop has one star with s in the middle which is
already handled by the driver and is assigned to key favourites.
There is another button with only a star, I think it is ok to assign
it to KEY_PROG1.
Thanks, Gašper
On Fri, 14 Mar 2025 at 12:52, Gergo Koteles <soyer@irl.hu> wrote:
>
> Hi Gašper,
>
> On 3/13/25 23:17, Gašper Nemgar wrote:
> > /* Specific to some newer models */
> > { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> > { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> > + /*Star- (User Asignable Key)*/
>
> Asignable -> Assignable?
> Could you please add a space before/after the body of the comment?
>
> > + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
>
> Other Ideapads map this star key to KEY_FAVORITES, for consistency I
> think it would be better if this one mapped there too.
>
> Thanks,
> Gergo
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-14 12:28 ` Gašper Nemgar
@ 2025-03-14 14:02 ` Gergo Koteles
0 siblings, 0 replies; 9+ messages in thread
From: Gergo Koteles @ 2025-03-14 14:02 UTC (permalink / raw)
To: Gašper Nemgar
Cc: Ike Panhc, linux-kernel, platform-driver-x86@vger.kernel.org
Hi Gašper,
On Fri, 2025-03-14 at 13:28 +0100, Gašper Nemgar wrote:
> Hello,
> This specific laptop has one star with s in the middle which is
> already handled by the driver and is assigned to key favourites.
> There is another button with only a star, I think it is ok to assign
> it to KEY_PROG1.
>
Ah, I see, this laptop, like a good movie, has multiple stars ;)
I think KEY_PROG1 is ok.
Thanks,
Gergo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
[not found] ` <CAKi4K-hFHy4_F+fQghFNNR8cnkojPcE0uXQWsf5+5dbqjXGs0g@mail.gmail.com>
@ 2025-03-16 8:41 ` Hans de Goede
2025-03-17 14:08 ` Peter F. Patel-Schneider
0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2025-03-16 8:41 UTC (permalink / raw)
To: Gašper Nemgar
Cc: ike.pan, linux-kernel, platform-driver-x86@vger.kernel.org
Hi Gašper,
On 14-Mar-25 12:35 PM, Gašper Nemgar wrote:
> Thanks for the feedback,
>
> I will go over your notes here and explain things.
> The Eye button on windows triggeres "Eye Care mode" https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50 <https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50>, does linux have a keycode as something like this, i didn't found any, should we jus assign it to one of the programmable keys?
Yes that sounds like the best solution.
> I will handle the performance as you have suggested, thanks
You're welcome.
> The shift + prtSc i have made a mistake here, i meant the Fn + prtSc.
> Just PrtSc is handled by a different device ("AT Translated Set 2 keyboard") and is not managed by this module. evtest told me it sends SysRq code which is intended and it triggers the selective screenshot.
Right, e.g. GNOME does not really differentiate between sysrq/printscreen
and KEY_SELECTIVE_SCREENSHOT and always uses the dialog instead of making
printscreen directly take a full screen screenshot. Still making this
the Fn + printscreen comboe send KEY_SELECTIVE_SCREENSHOT is the right thing
todo and is also done on other laptop models with the same icon.
> If I assign the Fn + PrtSc to KEY_SELECTIVE_SCREENSHOT the evtest shows
me it triggers code 634 and code name is "?". Is this correct behaviour?
This just means that your evtest is a bit old and does not know about
KEY_SELECTIVE_SCREENSHOT yet.
Regards,
Hans
> On Fri, 14 Mar 2025 at 10:34, Hans de Goede <hdegoede@redhat.com <mailto:hdegoede@redhat.com>> wrote:
>
> Hi Gašper,
>
> Thank you for your patch.
>
> First if all a few generic notes:
>
> 1. When sending out v2 of the patch please add
> platform-driver-x86@vger.kernel.org <mailto:platform-driver-x86@vger.kernel.org> to the Cc
>
> 2. The patch subject (first line of commit message) should have
> a prefix describing the subsystem + driver, e.g. use:
> "platform/x86: ideapad-laptop: Add a few new keymap entries"
>
> 3. Your patch is missing a signed-off-by, see:
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>
>
> 4. Your commit message / patch should also have a body, e.g.
> the entirety of the commit message could look something like this:
>
> -- begin --
> platform/x86: ideapad-laptop: Add a few new keymap entries
>
> The Yoga 9 2 in 1 14imh9 introduces 4 new hotkeys which are not
> yet in ideapad_keymap[], add entries to map these keys.
>
> Signed-off-by: Gašper Nemgar <your-email-here>
> -- end --
>
> A few more specific remarks below based on looking at
> this picture of the keyboard:
>
> https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg <https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg>
>
> On 13-Mar-25 4:17 PM, Gašper Nemgar wrote:
> > diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> > index 30bd366d7..af124aafe 100644
> > --- a/drivers/platform/x86/ideapad-laptop.c
> > +++ b/drivers/platform/x86/ideapad-laptop.c
> > @@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
> > /* Specific to some newer models */
> > { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> > { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> > + /*Star- (User Asignable Key)*/
> > + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
>
> Ack.
>
> > + /*Eye*/
> > + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
>
> It looks like the laptop already does display-toggle as Fn-F7 although
> it like sends super + P for this (AKA meta + P).
>
> So mapping this to KEY_DISPLAYTOGGLE seems wrong, what does this
> do under Windows?
>
> Maybe KEY_ZOOM ?
>
> > + /*Performance*/
> > + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
>
> I think that instead of mapping this it should be handled specially
> and call platform_profile_cycle() instead of sending a key-press
> to userspace
>
> > + /*shift + prtsc*/
> > + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
>
> Looking a the symbol on the keyboard this should send
> KEY_SELECTIVE_SCREENSHOT
>
> >
> > { KE_END },
> > };
> >
>
> Regards,
>
> Hans
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-16 8:41 ` Hans de Goede
@ 2025-03-17 14:08 ` Peter F. Patel-Schneider
2025-03-17 15:20 ` Gašper Nemgar
0 siblings, 1 reply; 9+ messages in thread
From: Peter F. Patel-Schneider @ 2025-03-17 14:08 UTC (permalink / raw)
To: Hans de Goede, Gašper Nemgar
Cc: ike.pan, linux-kernel, platform-driver-x86@vger.kernel.org
On 3/16/25 4:41 AM, Hans de Goede wrote:
> Hi Gašper,
>
> On 14-Mar-25 12:35 PM, Gašper Nemgar wrote:
>> Thanks for the feedback,
>>
>> I will go over your notes here and explain things.
>> The Eye button on windows triggeres "Eye Care mode" https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50 <https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50>, does linux have a keycode as something like this, i didn't found any, should we jus assign it to one of the programmable keys?
>
> Yes that sounds like the best solution.
>
>> I will handle the performance as you have suggested, thanks
>
> You're welcome.
>
>> The shift + prtSc i have made a mistake here, i meant the Fn + prtSc.
>> Just PrtSc is handled by a different device ("AT Translated Set 2 keyboard") and is not managed by this module. evtest told me it sends SysRq code which is intended and it triggers the selective screenshot.
>
> Right, e.g. GNOME does not really differentiate between sysrq/printscreen
> and KEY_SELECTIVE_SCREENSHOT and always uses the dialog instead of making
> printscreen directly take a full screen screenshot. Still making this
> the Fn + printscreen comboe send KEY_SELECTIVE_SCREENSHOT is the right thing
> todo and is also done on other laptop models with the same icon.
>
>> If I assign the Fn + PrtSc to KEY_SELECTIVE_SCREENSHOT the evtest shows
> me it triggers code 634 and code name is "?". Is this correct behaviour?
>
> This just means that your evtest is a bit old and does not know about
> KEY_SELECTIVE_SCREENSHOT yet.
>
> Regards,
>
> Hans
I have this laptop and did some digging to find out which keys use WMI, how
they are described by Lenovo, what they do now, and a suggestion for what to
do with them if different. I think that this is a comprehensive list.
The descriptions are from the User Guide Yoga 9i 2-in-1 (14″, 9) from Lenovo.
Key: Microphone Mute (Fn+F4)
WMI Code: 0x3e
Described as: p43 Enables/Disables the microphone.
Status: Already handled in ideapad_laptop
Key: KEY_MICMUTE 248
Key: Airplane Mode (Fn+F8)
WMI Code: 0x3f
Described as: p43 Enables/Disables airplane mode
Status: Already handled in ideapad_laptop
Key: KEY_RFKILL 247
Key: Star with S inside (right of F12)
WMI code: 0x1
Described as: p27&43 Displays the Lenovo Smart Key quick launch panel.
Status: Already handled in ideapad_laptop
Key: KEY_FAVORITES 0x16c
Key: Snip (Fn+PrtSrc)
WMI Code: 0x2d
Described as: p43 Opens the Snipping tool.
Status: Proposed patch uses KEY_PROG3.
Suggestion: KEY_CUT 137
Note: If the snipping tool does a selective screenshot then the
KEY_SELECTIVE_SCREENSHOT would be better.
Key: Performance Meter (just below Delete)
WMI Code: 0x3d
Described as: p44 Switches the computer’s active operation mode.
Suggestion: KEY_PROG4 203
Rationale: There already is a mapping from a thermal management button to
KEY_PROG4 in ideapad_laptop.
Note: I think that it is better to not hardwire keys.
Key: Speaker with gear (just below Perf key)
WMI Code: 0x12
Described as: p44 Switches the computer’s active audio mode.
Status: Already handled in indeapad_laptop
Key: KEY_PROG2 149
Key: Eye (just below Speaker with gear key)
WMI code: 0x45
Desribed as: p44 Turns on/off the Eye Care mode.
Status: Proposed patch uses KEY_DISPLAYTOGGLE.
Suggestion: KEY_BRIGHTNESS_CYCLE 243
Rationale: This KEY_DISPLAYTOGGLE appears to be for switching screens, not
adjusting brightness/color.
Key: Star (just below Eye key)
WMI code: 0x44
Described as: p44 Opens a custom (user-defined) app.
Status: In proposed patch
Key: KEY_PROG1 148
Key: Fn+Esc
WMI code: 0x2 or 0x3
Described as: p20 Switch F<n> hotkey behaviour.
Status: Explicitly ignored in ideapad_laptop, as the switching is done in the
device
Key: Fn+spce
Described as: p43 Adjusts the keyboard backlight. (Done in device.)
WMI code: 0x41
Status: The code is not mentioned in ideadpad_laptop. The backlight is
adjusted by the device.
Suggestion: Document with an explicit ignore.
Key: Fn+M
Described as: p21 Enable/disable the touchpad.
WMI code: 0x29
Suggestion: KEY_TOUCHPAD_TOGGLE 0x212
Key: Fn+N
Described as: p21 Shows device information.
WMI code: 0x2a
Suggestion: KEY_ROOT_MENU 0x26a
Note: There doesn't seem to be a really good match for this.
Key: Fn+Q
Described as: p21&32 Switch among different performance modes.
WMI code: 0x3d
Suggestion: KEY_PROG4 203
Rationale: Same as Perf key
Key: Fn+R
Described as: p21&32 Change the display refresh rate.
WMI code: 0x10
Status: Already in ideapad_laptop.
Key: KEY_REFRESH_RATE_TOGGLE 0x232
peter
>
>
>> On Fri, 14 Mar 2025 at 10:34, Hans de Goede <hdegoede@redhat.com <mailto:hdegoede@redhat.com>> wrote:
>>
>> Hi Gašper,
>>
>> Thank you for your patch.
>>
>> First if all a few generic notes:
>>
>> 1. When sending out v2 of the patch please add
>> platform-driver-x86@vger.kernel.org <mailto:platform-driver-x86@vger.kernel.org> to the Cc
>>
>> 2. The patch subject (first line of commit message) should have
>> a prefix describing the subsystem + driver, e.g. use:
>> "platform/x86: ideapad-laptop: Add a few new keymap entries"
>>
>> 3. Your patch is missing a signed-off-by, see:
>> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>
>>
>> 4. Your commit message / patch should also have a body, e.g.
>> the entirety of the commit message could look something like this:
>>
>> -- begin --
>> platform/x86: ideapad-laptop: Add a few new keymap entries
>>
>> The Yoga 9 2 in 1 14imh9 introduces 4 new hotkeys which are not
>> yet in ideapad_keymap[], add entries to map these keys.
>>
>> Signed-off-by: Gašper Nemgar <your-email-here>
>> -- end --
>>
>> A few more specific remarks below based on looking at
>> this picture of the keyboard:
>>
>> https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg <https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg>
>>
>> On 13-Mar-25 4:17 PM, Gašper Nemgar wrote:
>> > diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
>> > index 30bd366d7..af124aafe 100644
>> > --- a/drivers/platform/x86/ideapad-laptop.c
>> > +++ b/drivers/platform/x86/ideapad-laptop.c
>> > @@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
>> > /* Specific to some newer models */
>> > { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
>> > { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
>> > + /*Star- (User Asignable Key)*/
>> > + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
>>
>> Ack.
>>
>> > + /*Eye*/
>> > + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
>>
>> It looks like the laptop already does display-toggle as Fn-F7 although
>> it like sends super + P for this (AKA meta + P).
>>
>> So mapping this to KEY_DISPLAYTOGGLE seems wrong, what does this
>> do under Windows?
>>
>> Maybe KEY_ZOOM ?
>>
>> > + /*Performance*/
>> > + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
>>
>> I think that instead of mapping this it should be handled specially
>> and call platform_profile_cycle() instead of sending a key-press
>> to userspace
>>
>> > + /*shift + prtsc*/
>> > + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
>>
>> Looking a the symbol on the keyboard this should send
>> KEY_SELECTIVE_SCREENSHOT
>>
>> >
>> > { KE_END },
>> > };
>> >
>>
>> Regards,
>>
>> Hans
>>
>>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys
2025-03-17 14:08 ` Peter F. Patel-Schneider
@ 2025-03-17 15:20 ` Gašper Nemgar
0 siblings, 0 replies; 9+ messages in thread
From: Gašper Nemgar @ 2025-03-17 15:20 UTC (permalink / raw)
To: Peter F. Patel-Schneider
Cc: Hans de Goede, ike.pan, linux-kernel,
platform-driver-x86@vger.kernel.org
Thank you for the suggested ideas, I have found the document myself
and planned to implement this, currently i am occupied with my college
exams and will resume working on the patch as soon as possible. About
the Performance Meter (just below Delete) what you are talking about
doesn't affect this laptop, from my research only the function
`ideapad_wmi_notify` is called when that key is pressed,
`ideapad_acpi_notify` and then `ideapad_check_special_buttons` isn't.
Another thing, when the `platform_profile_cycle()` is called it
doesn't affect anything on the system except
/sys/firmware/acpi/platform_profile, is this intended and gnome just
doesn't handle it or is there something wrong.
I also tried to make the mic mute LED to start working but was unable
to, do you have any ideas as to how I would achieve this. I have
dumped the acpi tables and examined them and I don't think there is a
way through that. I will research other ways when I have the time, but
do you have any ideas in the meantime?
Thanks a lot
On Mon, 17 Mar 2025 at 15:08, Peter F. Patel-Schneider
<pfpschneider@gmail.com> wrote:
>
> On 3/16/25 4:41 AM, Hans de Goede wrote:
> > Hi Gašper,
> >
> > On 14-Mar-25 12:35 PM, Gašper Nemgar wrote:
> >> Thanks for the feedback,
> >>
> >> I will go over your notes here and explain things.
> >> The Eye button on windows triggeres "Eye Care mode" https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50 <https://download.lenovo.com/consumer/mobiles_pub/yoga_9i_2-in-1_14_9_ug_en.pdf#page=50>, does linux have a keycode as something like this, i didn't found any, should we jus assign it to one of the programmable keys?
> >
> > Yes that sounds like the best solution.
> >
> >> I will handle the performance as you have suggested, thanks
> >
> > You're welcome.
> >
> >> The shift + prtSc i have made a mistake here, i meant the Fn + prtSc.
> >> Just PrtSc is handled by a different device ("AT Translated Set 2 keyboard") and is not managed by this module. evtest told me it sends SysRq code which is intended and it triggers the selective screenshot.
> >
> > Right, e.g. GNOME does not really differentiate between sysrq/printscreen
> > and KEY_SELECTIVE_SCREENSHOT and always uses the dialog instead of making
> > printscreen directly take a full screen screenshot. Still making this
> > the Fn + printscreen comboe send KEY_SELECTIVE_SCREENSHOT is the right thing
> > todo and is also done on other laptop models with the same icon.
> >
> >> If I assign the Fn + PrtSc to KEY_SELECTIVE_SCREENSHOT the evtest shows
> > me it triggers code 634 and code name is "?". Is this correct behaviour?
> >
> > This just means that your evtest is a bit old and does not know about
> > KEY_SELECTIVE_SCREENSHOT yet.
> >
> > Regards,
> >
> > Hans
>
> I have this laptop and did some digging to find out which keys use WMI, how
> they are described by Lenovo, what they do now, and a suggestion for what to
> do with them if different. I think that this is a comprehensive list.
> The descriptions are from the User Guide Yoga 9i 2-in-1 (14″, 9) from Lenovo.
>
> Key: Microphone Mute (Fn+F4)
> WMI Code: 0x3e
> Described as: p43 Enables/Disables the microphone.
> Status: Already handled in ideapad_laptop
> Key: KEY_MICMUTE 248
>
> Key: Airplane Mode (Fn+F8)
> WMI Code: 0x3f
> Described as: p43 Enables/Disables airplane mode
> Status: Already handled in ideapad_laptop
> Key: KEY_RFKILL 247
>
> Key: Star with S inside (right of F12)
> WMI code: 0x1
> Described as: p27&43 Displays the Lenovo Smart Key quick launch panel.
> Status: Already handled in ideapad_laptop
> Key: KEY_FAVORITES 0x16c
>
> Key: Snip (Fn+PrtSrc)
> WMI Code: 0x2d
> Described as: p43 Opens the Snipping tool.
> Status: Proposed patch uses KEY_PROG3.
> Suggestion: KEY_CUT 137
> Note: If the snipping tool does a selective screenshot then the
> KEY_SELECTIVE_SCREENSHOT would be better.
>
> Key: Performance Meter (just below Delete)
> WMI Code: 0x3d
> Described as: p44 Switches the computer’s active operation mode.
> Suggestion: KEY_PROG4 203
> Rationale: There already is a mapping from a thermal management button to
> KEY_PROG4 in ideapad_laptop.
> Note: I think that it is better to not hardwire keys.
>
> Key: Speaker with gear (just below Perf key)
> WMI Code: 0x12
> Described as: p44 Switches the computer’s active audio mode.
> Status: Already handled in indeapad_laptop
> Key: KEY_PROG2 149
>
> Key: Eye (just below Speaker with gear key)
> WMI code: 0x45
> Desribed as: p44 Turns on/off the Eye Care mode.
> Status: Proposed patch uses KEY_DISPLAYTOGGLE.
> Suggestion: KEY_BRIGHTNESS_CYCLE 243
> Rationale: This KEY_DISPLAYTOGGLE appears to be for switching screens, not
> adjusting brightness/color.
>
> Key: Star (just below Eye key)
> WMI code: 0x44
> Described as: p44 Opens a custom (user-defined) app.
> Status: In proposed patch
> Key: KEY_PROG1 148
>
> Key: Fn+Esc
> WMI code: 0x2 or 0x3
> Described as: p20 Switch F<n> hotkey behaviour.
> Status: Explicitly ignored in ideapad_laptop, as the switching is done in the
> device
>
> Key: Fn+spce
> Described as: p43 Adjusts the keyboard backlight. (Done in device.)
> WMI code: 0x41
> Status: The code is not mentioned in ideadpad_laptop. The backlight is
> adjusted by the device.
> Suggestion: Document with an explicit ignore.
>
> Key: Fn+M
> Described as: p21 Enable/disable the touchpad.
> WMI code: 0x29
> Suggestion: KEY_TOUCHPAD_TOGGLE 0x212
>
> Key: Fn+N
> Described as: p21 Shows device information.
> WMI code: 0x2a
> Suggestion: KEY_ROOT_MENU 0x26a
> Note: There doesn't seem to be a really good match for this.
>
> Key: Fn+Q
> Described as: p21&32 Switch among different performance modes.
> WMI code: 0x3d
> Suggestion: KEY_PROG4 203
> Rationale: Same as Perf key
>
> Key: Fn+R
> Described as: p21&32 Change the display refresh rate.
> WMI code: 0x10
> Status: Already in ideapad_laptop.
> Key: KEY_REFRESH_RATE_TOGGLE 0x232
>
> peter
>
>
> >
> >
> >> On Fri, 14 Mar 2025 at 10:34, Hans de Goede <hdegoede@redhat.com <mailto:hdegoede@redhat.com>> wrote:
> >>
> >> Hi Gašper,
> >>
> >> Thank you for your patch.
> >>
> >> First if all a few generic notes:
> >>
> >> 1. When sending out v2 of the patch please add
> >> platform-driver-x86@vger.kernel.org <mailto:platform-driver-x86@vger.kernel.org> to the Cc
> >>
> >> 2. The patch subject (first line of commit message) should have
> >> a prefix describing the subsystem + driver, e.g. use:
> >> "platform/x86: ideapad-laptop: Add a few new keymap entries"
> >>
> >> 3. Your patch is missing a signed-off-by, see:
> >> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>
> >>
> >> 4. Your commit message / patch should also have a body, e.g.
> >> the entirety of the commit message could look something like this:
> >>
> >> -- begin --
> >> platform/x86: ideapad-laptop: Add a few new keymap entries
> >>
> >> The Yoga 9 2 in 1 14imh9 introduces 4 new hotkeys which are not
> >> yet in ideapad_keymap[], add entries to map these keys.
> >>
> >> Signed-off-by: Gašper Nemgar <your-email-here>
> >> -- end --
> >>
> >> A few more specific remarks below based on looking at
> >> this picture of the keyboard:
> >>
> >> https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg <https://ardes.bg/uploads/original/lenovo-yoga-9-2-in-1-14-g9-550178.jpg>
> >>
> >> On 13-Mar-25 4:17 PM, Gašper Nemgar wrote:
> >> > diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> >> > index 30bd366d7..af124aafe 100644
> >> > --- a/drivers/platform/x86/ideapad-laptop.c
> >> > +++ b/drivers/platform/x86/ideapad-laptop.c
> >> > @@ -1308,6 +1308,14 @@ static const struct key_entry ideapad_keymap[] = {
> >> > /* Specific to some newer models */
> >> > { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
> >> > { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
> >> > + /*Star- (User Asignable Key)*/
> >> > + { KE_KEY, 0x44 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
> >>
> >> Ack.
> >>
> >> > + /*Eye*/
> >> > + { KE_KEY, 0x45 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
> >>
> >> It looks like the laptop already does display-toggle as Fn-F7 although
> >> it like sends super + P for this (AKA meta + P).
> >>
> >> So mapping this to KEY_DISPLAYTOGGLE seems wrong, what does this
> >> do under Windows?
> >>
> >> Maybe KEY_ZOOM ?
> >>
> >> > + /*Performance*/
> >> > + { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_SPORT } },
> >>
> >> I think that instead of mapping this it should be handled specially
> >> and call platform_profile_cycle() instead of sending a key-press
> >> to userspace
> >>
> >> > + /*shift + prtsc*/
> >> > + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_PROG3 } },
> >>
> >> Looking a the symbol on the keyboard this should send
> >> KEY_SELECTIVE_SCREENSHOT
> >>
> >> >
> >> > { KE_END },
> >> > };
> >> >
> >>
> >> Regards,
> >>
> >> Hans
> >>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-03-17 15:20 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 15:17 [PATCH] Fixed ideapad-laptop driver to support Yoga 9 2 in 1 14imh9 unknown keys Gašper Nemgar
2025-03-14 4:38 ` Ike Panhc
2025-03-14 11:52 ` Gergo Koteles
2025-03-14 12:28 ` Gašper Nemgar
2025-03-14 14:02 ` Gergo Koteles
2025-03-14 9:34 ` Hans de Goede
[not found] ` <CAKi4K-hFHy4_F+fQghFNNR8cnkojPcE0uXQWsf5+5dbqjXGs0g@mail.gmail.com>
2025-03-16 8:41 ` Hans de Goede
2025-03-17 14:08 ` Peter F. Patel-Schneider
2025-03-17 15:20 ` Gašper Nemgar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox