linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] map Fn + R key on newer Yogas and Legions
@ 2024-02-20  3:39 Gergo Koteles
  2024-02-20  3:39 ` [PATCH 1/2] Input: allocate keycode for Fn + R Gergo Koteles
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gergo Koteles @ 2024-02-20  3:39 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Ilpo Järvinen, Dmitry Torokhov,
	Philipp Jungkamp
  Cc: platform-driver-x86, linux-kernel, linux-input, Gergo Koteles

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Input: allocate keycode for Fn + R
  2024-02-20  3:39 [PATCH 0/2] map Fn + R key on newer Yogas and Legions Gergo Koteles
@ 2024-02-20  3:39 ` Gergo Koteles
  2024-02-20  3:39 ` [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R Gergo Koteles
  2024-02-26 13:27 ` [PATCH 0/2] map Fn + R key on newer Yogas and Legions Ilpo Järvinen
  2 siblings, 0 replies; 8+ messages in thread
From: Gergo Koteles @ 2024-02-20  3:39 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Ilpo Järvinen, Dmitry Torokhov,
	Philipp Jungkamp
  Cc: platform-driver-x86, linux-kernel, linux-input, 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 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 <soyer@irl.hu>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R
  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
  2024-02-26 13:27 ` [PATCH 0/2] map Fn + R key on newer Yogas and Legions Ilpo Järvinen
  2 siblings, 0 replies; 8+ messages in thread
From: Gergo Koteles @ 2024-02-20  3:39 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Ilpo Järvinen, Dmitry Torokhov,
	Philipp Jungkamp
  Cc: platform-driver-x86, linux-kernel, linux-input, 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"

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
  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 ` [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R Gergo Koteles
@ 2024-02-26 13:27 ` Ilpo Järvinen
  2024-03-10  1:39   ` Dmitry Torokhov
  2 siblings, 1 reply; 8+ messages in thread
From: Ilpo Järvinen @ 2024-02-26 13:27 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Dmitry Torokhov, Philipp Jungkamp,
	Gergo Koteles
  Cc: platform-driver-x86, linux-kernel, linux-input

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2024-03-10  1:39 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Ike Panhc, Hans de Goede, Philipp Jungkamp, Gergo Koteles,
	platform-driver-x86, linux-kernel, linux-input

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
  2024-03-10  1:39   ` Dmitry Torokhov
@ 2024-03-11 10:53     ` Ilpo Järvinen
  2024-03-11 18:45       ` Dmitry Torokhov
  0 siblings, 1 reply; 8+ messages in thread
From: Ilpo Järvinen @ 2024-03-11 10:53 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ike Panhc, Hans de Goede, Philipp Jungkamp, Gergo Koteles,
	platform-driver-x86, LKML, linux-input

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
  2024-03-11 10:53     ` Ilpo Järvinen
@ 2024-03-11 18:45       ` Dmitry Torokhov
  2024-03-12 11:01         ` Ilpo Järvinen
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2024-03-11 18:45 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Ike Panhc, Hans de Goede, Philipp Jungkamp, Gergo Koteles,
	platform-driver-x86, LKML, linux-input

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] map Fn + R key on newer Yogas and Legions
  2024-03-11 18:45       ` Dmitry Torokhov
@ 2024-03-12 11:01         ` Ilpo Järvinen
  0 siblings, 0 replies; 8+ messages in thread
From: Ilpo Järvinen @ 2024-03-12 11:01 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ike Panhc, Hans de Goede, Philipp Jungkamp, Gergo Koteles,
	platform-driver-x86, LKML, linux-input

[-- Attachment #1: Type: text/plain, Size: 1833 bytes --]

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-12 11:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R Gergo Koteles
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).