map Fn + R key on newer Lenovo Yogas and Legions
Subsystems (3)
v2 cover map Fn + R key on newer Lenovo Yogas and Legions
Hi All,
This patch series adds a new KEY_REFRESH_RATE_TOGGLE input event code and maps the Fn + R key to it in the ideapad-laptop driver.
It affects two WMI keycodes. I couldn't try the 0x0a.
Regards,
Gergo
Changes in v2:
- use KEY_REFRESH_RATE_TOGGLE instead of KEY_FN_R
[1]: https://lore.kernel.org/all/[email protected]/
Gergo Koteles (2):
Input: allocate keycode for Display refresh rate toggle platform/x86: ideapad-laptop: map Fn + R key to
KEY_REFRESH_RATE_TOGGLE
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.44.0
PATCH v2 1/2 Input: allocate keycode for Display refresh rate toggle
Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event when Fn + R is pressed. This is intended for use to switch between the two refresh rates.
Allocate a new KEY_REFRESH_RATE_TOGGLE keycode for it.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -602,6 +602,7 @@#define KEY_ALS_TOGGLE 0x230/* Ambient light sensor */ #define KEY_ROTATE_LOCK_TOGGLE 0x231/* Display rotation lock */ +#define KEY_REFRESH_RATE_TOGGLE 0x232/* Display refresh rate toggle */ #define KEY_BUTTONCONFIG 0x240/* AL Button Configuration */ #define KEY_TASKMANAGER 0x241/* AL Task/Project Manager */
Signature · 1 line
2.44.0
Re: [PATCH v2 1/2] Input: allocate keycode for Display refresh rate toggle
Quoted 7 lines · Gergo Koteles
Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event when Fn + R is pressed. This is intended for use to switch between the two refresh rates.
Allocate a new
KEY_REFRESH_RATE_TOGGLEkeycode for it.Signed-off-by Gergo Koteles <[email protected]>
Quoted 19 lines
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/input-event-codes.h +1
-0@@ -602,6 +602,7 @@#define KEY_ALS_TOGGLE 0x230/* Ambient light sensor */ #define KEY_ROTATE_LOCK_TOGGLE 0x231/* Display rotation lock */ +#define KEY_REFRESH_RATE_TOGGLE 0x232/* Display refresh rate toggle */ #define KEY_BUTTONCONFIG 0x240/* AL Button Configuration */ #define KEY_TASKMANAGER 0x241/* AL Task/Project Manager */ Signature · 1 line
2.44.0
Signature · 1 line
Dmitry
PATCH v2 2/2 platform/x86: ideapad-laptop: map Fn + R key to KEY_REFRESH_RATE_TOGGLE
In reply to Gergo KotelesNewer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event when Fn + R is pressed. This is intended for use to switch between the two refresh rates.
The Fn + R key was incorrectly assigned to KEY_DISPLAYTOGGLE because it is used to toggle the display on and off.
Map Fn + R key to the KEY_REFRESH_RATE_TOGGLE event code.
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
@@ -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_REFRESH_RATE_TOGGLE } },/* 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_REFRESH_RATE_TOGGLE } }, { KE_END }, };
Signature · 1 line
2.44.0
Ilpo Järvinen
maintainerQuoted 13 lines · Gergo Koteles
Hi All,
This patch series adds a new
KEY_REFRESH_RATE_TOGGLEinput event code and maps the Fn + R key to it in the ideapad-laptop driver.It affects two WMI keycodes. I couldn't try the
0x0a.Regards,
GergoChanges in v2:
- useKEY_REFRESH_RATE_TOGGLEinstead ofKEY_FN_R
Quoted 6 lines
[1]: https://lore.kernel.org/all/[email protected]/
Gergo Koteles (2):
Input: allocate keycode for Display refresh rate toggle platform/x86: ideapad-laptop: map Fn + R key to
KEY_REFRESH_RATE_TOGGLE
Hi,
As mentioned in the other thread, please redo this on top of pdx86/for-next.
Signature · 1 line
i.
Ilpo Järvinen
maintainerQuoted 15 lines · Ilpo Järvinen
Quoted 13 lines · Gergo Koteles
This patch series adds a new
KEY_REFRESH_RATE_TOGGLEinput event code and maps the Fn + R key to it in the ideapad-laptop driver.It affects two WMI keycodes. I couldn't try the
0x0a.Regards,
GergoChanges in v2:
- useKEY_REFRESH_RATE_TOGGLEinstead ofKEY_FN_R
Quoted 7 lines
Quoted 4 lines
Gergo Koteles (2):
Input: allocate keycode for Display refresh rate toggle platform/x86: ideapad-laptop: map Fn + R key to
KEY_REFRESH_RATE_TOGGLEAs mentioned in the other thread, please redo this on top of pdx86/for-next.
Nevermind, I replaced the original patches with these two.
Signature · 1 line
i.