Skip to contentSkip to conversation

map Fn + R key on newer Yogas and Legions

PATCH Superseded Gergo Koteles 3 participants 8 messages Feb 20, 2024 – Mar 12, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover 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

Signature · 1 line
2.43.2
#1 lore raw

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.

---
 include/uapi/linux/input-event-codes.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
index 022a520e31fc..ba40af25943a 100644
@@ -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
Signature · 1 line
2.43.2
#2 lore raw

PATCH 2/2 platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R

In reply to Gergo Koteles

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"

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/ideapad-laptop.c +2 -2
index 4c130957f80d..c31c96228912 100644
@@ -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 },
 };
Signature · 1 line
2.43.2
maintainer
#3 lore raw
In reply to Gergo Koteles
Quoted 10 lines · Gergo Koteles

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.

maintainer
#4 lore raw
Quoted 14 lines · Ilpo Järvinen
Quoted 10 lines · Gergo Koteles

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

[...]

Quoted 8 lines

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.

Signature · 1 line
Dmitry
maintainer
#5 lore raw
Quoted 24 lines · Dmitry Torokhov
Quoted 14 lines · Ilpo Järvinen
Quoted 10 lines · Gergo Koteles

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

[...]

Quoted 8 lines

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
Quoted 5 lines

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).

Signature · 1 line
 i.
maintainer
#6 lore raw
Quoted 26 lines · Ilpo Järvinen
Quoted 24 lines · Dmitry Torokhov
Quoted 22 lines · Ilpo Järvinen
Quoted 10 lines · Gergo Koteles

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
Quoted 8 lines
Quoted 5 lines

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.

Signature · 1 line
Dmitry
maintainer
#7 lore raw
Quoted 33 lines · Dmitry Torokhov
Quoted 32 lines · Ilpo Järvinen
Quoted 29 lines · Dmitry Torokhov
Quoted 14 lines · Ilpo Järvinen
Quoted 10 lines · Gergo Koteles

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

[...]

Quoted 8 lines

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.

Quoted 8 lines
Quoted 2 lines

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.

Signature · 1 line
 i.