The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key
@ 2024-02-10 22:51 Gergo Koteles
  2024-02-13 12:01 ` Ilpo Järvinen
  2024-02-19  2:39 ` Ike Panhc
  0 siblings, 2 replies; 5+ messages in thread
From: Gergo Koteles @ 2024-02-10 22:51 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Gergo Koteles

According to the manual, Fn+R adjusts the display refresh rate.
Map Fn+R to KEY_DISPLAYTOGGLE.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
 drivers/platform/x86/ideapad-laptop.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 88eefccb6ed2..4c130957f80d 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1091,6 +1091,8 @@ static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY,	0x07 | IDEAPAD_WMI_KEY, { KEY_HELP } },
 	{ 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 } },
 	/* Dark mode toggle */
 	{ KE_KEY,	0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
 	/* Sound profile switch */
-- 
2.43.0


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

* Re: [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key
  2024-02-10 22:51 [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key Gergo Koteles
@ 2024-02-13 12:01 ` Ilpo Järvinen
  2024-02-19  2:39 ` Ike Panhc
  1 sibling, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2024-02-13 12:01 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Gergo Koteles; +Cc: platform-driver-x86, linux-kernel

On Sat, 10 Feb 2024 23:51:57 +0100, Gergo Koteles wrote:

> According to the manual, Fn+R adjusts the display refresh rate.
> Map Fn+R to KEY_DISPLAYTOGGLE.
> 
> 


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/1] platform/x86: ideapad-laptop: support Fn+R dual-function key
      commit: c5211eacf3326538fbf31b612e5ea546ca8a3425

--
 i.


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

* Re: [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key
  2024-02-10 22:51 [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key Gergo Koteles
  2024-02-13 12:01 ` Ilpo Järvinen
@ 2024-02-19  2:39 ` Ike Panhc
  2024-02-19 12:32   ` Gergo Koteles
  1 sibling, 1 reply; 5+ messages in thread
From: Ike Panhc @ 2024-02-19  2:39 UTC (permalink / raw)
  To: Gergo Koteles, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel

On 2/11/24 06:51, Gergo Koteles wrote:
> According to the manual, Fn+R adjusts the display refresh rate.
> Map Fn+R to KEY_DISPLAYTOGGLE.
> 
> Signed-off-by: Gergo Koteles <soyer@irl.hu>
> ---
>  drivers/platform/x86/ideapad-laptop.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 88eefccb6ed2..4c130957f80d 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1091,6 +1091,8 @@ static const struct key_entry ideapad_keymap[] = {
>  	{ KE_KEY,	0x07 | IDEAPAD_WMI_KEY, { KEY_HELP } },
>  	{ 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 } },
>  	/* Dark mode toggle */
>  	{ KE_KEY,	0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
>  	/* Sound profile switch */

Acked-by: Ike Panhc <ike.pan@canonical.com>

BTW on which ideapad we need this patch?

Thanks.

--
Ike

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

* Re: [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key
  2024-02-19  2:39 ` Ike Panhc
@ 2024-02-19 12:32   ` Gergo Koteles
  2024-02-19 12:51     ` Ilpo Järvinen
  0 siblings, 1 reply; 5+ messages in thread
From: Gergo Koteles @ 2024-02-19 12:32 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel

Hi Ike,

On Mon, 2024-02-19 at 10:39 +0800, Ike Panhc wrote:
> On 2/11/24 06:51, Gergo Koteles wrote:
> > According to the manual, Fn+R adjusts the display refresh rate.
> > Map Fn+R to KEY_DISPLAYTOGGLE.
> > 
> > Signed-off-by: Gergo Koteles <soyer@irl.hu>
> > ---
> >  drivers/platform/x86/ideapad-laptop.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> > index 88eefccb6ed2..4c130957f80d 100644
> > --- a/drivers/platform/x86/ideapad-laptop.c
> > +++ b/drivers/platform/x86/ideapad-laptop.c
> > @@ -1091,6 +1091,8 @@ static const struct key_entry ideapad_keymap[] = {
> >  	{ KE_KEY,	0x07 | IDEAPAD_WMI_KEY, { KEY_HELP } },
> >  	{ 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 } },
> >  	/* Dark mode toggle */
> >  	{ KE_KEY,	0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
> >  	/* Sound profile switch */
> 
> Acked-by: Ike Panhc <ike.pan@canonical.com>
> 
> BTW on which ideapad we need this patch?
> 

Oh, I somehow missed that. I found it on a Yoga 7 14ARB7.

Newer Yogas and Legions with 60Hz/90Hz displays have this refresh rate
toggle feature.

I'm wondering if this would be worth a new KEY_REFRESH_RATE_TOGGLE
event code? 

KEY_DISPLAYTOGGLE is used to toggle the LCD on/off in other drivers.

What do you think?

Thanks,
Gergo

> Thanks.
> 
> --
> Ike


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

* Re: [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key
  2024-02-19 12:32   ` Gergo Koteles
@ 2024-02-19 12:51     ` Ilpo Järvinen
  0 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2024-02-19 12:51 UTC (permalink / raw)
  To: Gergo Koteles, Hans de Goede; +Cc: Ike Panhc, platform-driver-x86, LKML

On Mon, 19 Feb 2024, Gergo Koteles wrote:
> On Mon, 2024-02-19 at 10:39 +0800, Ike Panhc wrote:
> > On 2/11/24 06:51, Gergo Koteles wrote:
> > > According to the manual, Fn+R adjusts the display refresh rate.
> > > Map Fn+R to KEY_DISPLAYTOGGLE.
> > > 
> > > Signed-off-by: Gergo Koteles <soyer@irl.hu>

> > > +++ b/drivers/platform/x86/ideapad-laptop.c
> > > @@ -1091,6 +1091,8 @@ static const struct key_entry ideapad_keymap[] = {
> > >  	{ KE_KEY,	0x07 | IDEAPAD_WMI_KEY, { KEY_HELP } },
> > >  	{ 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 } },
> > >  	/* Dark mode toggle */
> > >  	{ KE_KEY,	0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } },
> > >  	/* Sound profile switch */
> > 
> > Acked-by: Ike Panhc <ike.pan@canonical.com>
> > 
> > BTW on which ideapad we need this patch?
> > 
> 
> Oh, I somehow missed that. I found it on a Yoga 7 14ARB7.
> 
> Newer Yogas and Legions with 60Hz/90Hz displays have this refresh rate
> toggle feature.
> 
> I'm wondering if this would be worth a new KEY_REFRESH_RATE_TOGGLE
> event code? 
> 
> KEY_DISPLAYTOGGLE is used to toggle the LCD on/off in other drivers.
> 
> What do you think?

At least to me it felt like an abuse of KEY_DISPLAYTOGGLE because it's 
obviously different. But since there was existing, similar use for it 
already, I didn't push back on it but took your patch.

-- 
 i.


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

end of thread, other threads:[~2024-02-19 12:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-10 22:51 [PATCH] platform/x86: ideapad-laptop: support Fn+R dual-function key Gergo Koteles
2024-02-13 12:01 ` Ilpo Järvinen
2024-02-19  2:39 ` Ike Panhc
2024-02-19 12:32   ` Gergo Koteles
2024-02-19 12:51     ` 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