All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gergo Koteles <soyer@irl.hu>
To: "Ike Panhc" <ike.pan@canonical.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Philipp Jungkamp" <p.jungkamp@gmx.net>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	Gergo Koteles <soyer@irl.hu>
Subject: [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R
Date: Tue, 20 Feb 2024 04:39:36 +0100	[thread overview]
Message-ID: <fbff2791d6d9b5e57d6ac9001717c21cee0296ce.1708399689.git.soyer@irl.hu> (raw)
In-Reply-To: <cover.1708399689.git.soyer@irl.hu>

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 <soyer@irl.hu>
---
 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


  parent reply	other threads:[~2024-02-20  3:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  3:39 [PATCH 0/2] map Fn + R key on newer Yogas and Legions Gergo Koteles
2024-02-20  3:39 ` [PATCH 1/2] Input: allocate keycode for Fn + R Gergo Koteles
2024-02-20  3:39 ` Gergo Koteles [this message]
2024-02-26 13:27 ` [PATCH 0/2] map Fn + R key on newer Yogas and Legions Ilpo Järvinen
2024-03-10  1:39   ` Dmitry Torokhov
2024-03-11 10:53     ` Ilpo Järvinen
2024-03-11 18:45       ` Dmitry Torokhov
2024-03-12 11:01         ` Ilpo Järvinen

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=fbff2791d6d9b5e57d6ac9001717c21cee0296ce.1708399689.git.soyer@irl.hu \
    --to=soyer@irl.hu \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ike.pan@canonical.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.jungkamp@gmx.net \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.