2024-02-20 03:40:45

by Gergo Koteles

[permalink] [raw]
Subject: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

Hi All,

This patch series adds a new KEY_FN_R input event code and map the
Fn + R key to it in the ideapad-laptop driver.

It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
find any indication that the refresh rate toggle should not be Fn + R.

Regards,
Gergo

Gergo Koteles (2):
Input: allocate keycode for Fn + R
platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R

drivers/platform/x86/ideapad-laptop.c | 4 ++--
include/uapi/linux/input-event-codes.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)


base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
prerequisite-patch-id: 66a1ec71f181c6468a8226430af7ee917f40138a
--
2.43.2



2024-02-20 03:40:53

by Gergo Koteles

[permalink] [raw]
Subject: [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R

Newer Lenovo Yogas (e.g. Yoga 7 14ARB7) and Legions with 60Hz/90Hz
displays send a wmi event when Fn + R is pressed. This is intended for
use to adjust refresh rate, but there is no silkscreen print on the R
key to indicate this.

The Fn + R key is incorrectly assigned to KEY_DISPLAYTOGGLE, as the
latter is used to toggle the display on and off.

Map the Fn + R key to a more generic KEY_FN_R event code, since the
refresh rate toggle feature is not common and is only used by a few
Lenovo laptops.

This commit depends on "platform/x86: ideapad-laptop: support Fn+R
dual-function key"

Signed-off-by: Gergo Koteles <[email protected]>
---
drivers/platform/x86/ideapad-laptop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 4c130957f80d..c31c96228912 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1092,7 +1092,7 @@ static const struct key_entry ideapad_keymap[] = {
{ KE_KEY, 0x0e | IDEAPAD_WMI_KEY, { KEY_PICKUP_PHONE } },
{ KE_KEY, 0x0f | IDEAPAD_WMI_KEY, { KEY_HANGUP_PHONE } },
/* Refresh Rate Toggle (Fn+R) */
- { KE_KEY, 0x10 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
+ { KE_KEY, 0x10 | IDEAPAD_WMI_KEY, { KEY_FN_R } },
/* Dark mode toggle */
{ KE_KEY, 0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
/* Sound profile switch */
@@ -1102,7 +1102,7 @@ static const struct key_entry ideapad_keymap[] = {
/* Lenovo Support */
{ KE_KEY, 0x27 | IDEAPAD_WMI_KEY, { KEY_HELP } },
/* Refresh Rate Toggle */
- { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } },
+ { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_FN_R } },

{ KE_END },
};
--
2.43.2


2024-02-20 03:40:53

by Gergo Koteles

[permalink] [raw]
Subject: [PATCH 1/2] Input: allocate keycode for Fn + R

Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event
when Fn + R is pressed. This is intended for use to adjust refresh rate.

But there is no silkscreen print on the R key to indicate this,
so add a KEY_FN_R keycode define to use for this key-combo.

Signed-off-by: Gergo Koteles <[email protected]>
---
include/uapi/linux/input-event-codes.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 022a520e31fc..ba40af25943a 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -547,6 +547,7 @@
#define KEY_FN_S 0x1e3
#define KEY_FN_B 0x1e4
#define KEY_FN_RIGHT_SHIFT 0x1e5
+#define KEY_FN_R 0x1e6

#define KEY_BRL_DOT1 0x1f1
#define KEY_BRL_DOT2 0x1f2
--
2.43.2


2024-02-26 13:28:14

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:

> This patch series adds a new KEY_FN_R input event code and map the
> Fn + R key to it in the ideapad-laptop driver.
>
> It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> find any indication that the refresh rate toggle should not be Fn + R.
>
> Regards,
> Gergo
>
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/2] Input: allocate keycode for Fn + R
commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e
[2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R
commit: cd4525993e49f1449e9380bd28fa1179b05c911d

--
i.


2024-03-10 01:39:36

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

On Mon, Feb 26, 2024 at 03:27:33PM +0200, Ilpo J?rvinen wrote:
> On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:
>
> > This patch series adds a new KEY_FN_R input event code and map the
> > Fn + R key to it in the ideapad-laptop driver.
> >
> > It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> > find any indication that the refresh rate toggle should not be Fn + R.
> >
> > Regards,
> > Gergo
> >
> > [...]
>
>
> Thank you for your contribution, it has been applied to my local
> review-ilpo branch. Note it will show up in the public
> platform-drivers-x86/review-ilpo branch only once I've pushed my
> local branch there, which might take a while.
>
> The list of commits applied:
> [1/2] Input: allocate keycode for Fn + R
> commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e

I am sorry for the delay, but instead of defining a generic name we should define
a proper keycode for concrete action even if nothing is printed on a
particular key on a particular device.

Please drop this patch.

Thanks.

--
Dmitry

2024-03-11 12:11:07

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

On Sat, 9 Mar 2024, Dmitry Torokhov wrote:

> On Mon, Feb 26, 2024 at 03:27:33PM +0200, Ilpo J?rvinen wrote:
> > On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:
> >
> > > This patch series adds a new KEY_FN_R input event code and map the
> > > Fn + R key to it in the ideapad-laptop driver.
> > >
> > > It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> > > find any indication that the refresh rate toggle should not be Fn + R.
> > >
> > > Regards,
> > > Gergo
> > >
> > > [...]
> >
> >
> > Thank you for your contribution, it has been applied to my local
> > review-ilpo branch. Note it will show up in the public
> > platform-drivers-x86/review-ilpo branch only once I've pushed my
> > local branch there, which might take a while.
> >
> > The list of commits applied:
> > [1/2] Input: allocate keycode for Fn + R
> > commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e
>
> I am sorry for the delay, but instead of defining a generic name we should define
> a proper keycode for concrete action even if nothing is printed on a
> particular key on a particular device.
>
> Please drop this patch.

Dropping them at this point would bit of a hassle due to backmerges of
fixes branch.

Gergo please make new changes on top of for-next for the change into the
proper keycode (I see up sent a new series with assumption that I drop
the other patches).

--
i.

2024-03-11 19:04:04

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

On Mon, Mar 11, 2024 at 12:53:36PM +0200, Ilpo J?rvinen wrote:
> On Sat, 9 Mar 2024, Dmitry Torokhov wrote:
>
> > On Mon, Feb 26, 2024 at 03:27:33PM +0200, Ilpo J?rvinen wrote:
> > > On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:
> > >
> > > > This patch series adds a new KEY_FN_R input event code and map the
> > > > Fn + R key to it in the ideapad-laptop driver.
> > > >
> > > > It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> > > > find any indication that the refresh rate toggle should not be Fn + R.
> > > >
> > > > Regards,
> > > > Gergo
> > > >
> > > > [...]
> > >
> > >
> > > Thank you for your contribution, it has been applied to my local
> > > review-ilpo branch. Note it will show up in the public
> > > platform-drivers-x86/review-ilpo branch only once I've pushed my
> > > local branch there, which might take a while.
> > >
> > > The list of commits applied:
> > > [1/2] Input: allocate keycode for Fn + R
> > > commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e
> >
> > I am sorry for the delay, but instead of defining a generic name we should define
> > a proper keycode for concrete action even if nothing is printed on a
> > particular key on a particular device.
> >
> > Please drop this patch.
>
> Dropping them at this point would bit of a hassle due to backmerges of
> fixes branch.

You should really wait applying patches affecting other parts of the
kernel as well as UAPI until all maintainers responsible for them agree
with the changes.

Thanks.

--
Dmitry

2024-03-12 11:01:16

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions

On Mon, 11 Mar 2024, Dmitry Torokhov wrote:

> On Mon, Mar 11, 2024 at 12:53:36PM +0200, Ilpo J?rvinen wrote:
> > On Sat, 9 Mar 2024, Dmitry Torokhov wrote:
> >
> > > On Mon, Feb 26, 2024 at 03:27:33PM +0200, Ilpo J?rvinen wrote:
> > > > On Tue, 20 Feb 2024 04:39:34 +0100, Gergo Koteles wrote:
> > > >
> > > > > This patch series adds a new KEY_FN_R input event code and map the
> > > > > Fn + R key to it in the ideapad-laptop driver.
> > > > >
> > > > > It affects two WMI keycodes and I couldn't try the 0x0a, but I couldn't
> > > > > find any indication that the refresh rate toggle should not be Fn + R.
> > > > >
> > > > > Regards,
> > > > > Gergo
> > > > >
> > > > > [...]
> > > >
> > > >
> > > > Thank you for your contribution, it has been applied to my local
> > > > review-ilpo branch. Note it will show up in the public
> > > > platform-drivers-x86/review-ilpo branch only once I've pushed my
> > > > local branch there, which might take a while.
> > > >
> > > > The list of commits applied:
> > > > [1/2] Input: allocate keycode for Fn + R
> > > > commit: 4e45fa464aeef4e803412b5dcce73aad48c94b0e
> > >
> > > I am sorry for the delay, but instead of defining a generic name we should define
> > > a proper keycode for concrete action even if nothing is printed on a
> > > particular key on a particular device.
> > >
> > > Please drop this patch.
> >
> > Dropping them at this point would bit of a hassle due to backmerges of
> > fixes branch.
>
> You should really wait applying patches affecting other parts of the
> kernel as well as UAPI until all maintainers responsible for them agree
> with the changes.
>
> Thanks.

I'm sorry about that. I'll try to be more careful in the future.

I've now replaced those patches in pdx86/for-next.

--
i.