X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Add support for calculator hotkey
@ 2018-06-19 15:51 Benjamin Berg
       [not found] ` <20180619155152.4984-1-bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Berg @ 2018-06-19 15:51 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh, Darren Hart, Andy Shevchenko
  Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Christian Kellner, Benjamin Berg,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA

The P52 has a keyboard which features a calculator key above the numpad.
Add support for this the calculator key (0x1313).

Signed-off-by: Benjamin Berg <bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cae9b0595692..6c979fe44ea7 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1928,7 +1928,7 @@ enum {	/* hot key scan codes (derived from ACPI DSDT) */
 	/* first new observed key (star, favorites) is 0x1311 */
 	TP_ACPI_HOTKEYSCAN_STAR = 69,
 	TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL2,
-	TP_ACPI_HOTKEYSCAN_UNK25,
+	TP_ACPI_HOTKEYSCAN_CALCULATOR,
 	TP_ACPI_HOTKEYSCAN_BLUETOOTH,
 	TP_ACPI_HOTKEYSCAN_KEYBOARD,
 
@@ -3449,7 +3449,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
 
 		KEY_FAVORITES,       /* Favorite app, 0x311 */
 		KEY_RESERVED,        /* Clipping tool */
-		KEY_RESERVED,
+		KEY_CALC,            /* Calculator (above numpad), 0x313 */
 		KEY_BLUETOOTH,       /* Bluetooth */
 		KEY_KEYBOARD         /* Keyboard, 0x315 */
 		},
-- 
2.17.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH] platform/x86: thinkpad_acpi: Add support for calculator hotkey
       [not found] ` <20180619155152.4984-1-bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2018-06-19 18:12   ` Henrique de Moraes Holschuh
       [not found]     ` <20180619181236.4qcyc7qmziqiijn4-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2018-06-19 18:12 UTC (permalink / raw)
  To: Benjamin Berg
  Cc: Henrique de Moraes Holschuh, Christian Kellner,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Hart,
	Andy Shevchenko

On Tue, 19 Jun 2018, Benjamin Berg wrote:
> The P52 has a keyboard which features a calculator key above the numpad.
> Add support for this the calculator key (0x1313).
> 
> Signed-off-by: Benjamin Berg <bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index cae9b0595692..6c979fe44ea7 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -1928,7 +1928,7 @@ enum {	/* hot key scan codes (derived from ACPI DSDT) */
>  	/* first new observed key (star, favorites) is 0x1311 */
>  	TP_ACPI_HOTKEYSCAN_STAR = 69,
>  	TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL2,
> -	TP_ACPI_HOTKEYSCAN_UNK25,
> +	TP_ACPI_HOTKEYSCAN_CALCULATOR,
>  	TP_ACPI_HOTKEYSCAN_BLUETOOTH,
>  	TP_ACPI_HOTKEYSCAN_KEYBOARD,
>  
> @@ -3449,7 +3449,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
>  
>  		KEY_FAVORITES,       /* Favorite app, 0x311 */
>  		KEY_RESERVED,        /* Clipping tool */
> -		KEY_RESERVED,
> +		KEY_CALC,            /* Calculator (above numpad), 0x313 */

Replace 0x313 with (P52) please.

Other than that,
Acked-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>


That said, it would be nice to know if other models also have this
hotkey, especially if it has a different meaning (in which case we just
special-case the keymap in the driver, so it is *not* a problem).

-- 
  Henrique Holschuh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH] platform/x86: thinkpad_acpi: Add support for calculator hotkey
       [not found]     ` <20180619181236.4qcyc7qmziqiijn4-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
@ 2018-06-19 19:19       ` Benjamin Berg
       [not found]         ` <5b3d294cd3bfd1c8ce8ae955f13df4d3814109aa.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Berg @ 2018-06-19 19:19 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Henrique de Moraes Holschuh, Christian Kellner,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Hart,
	Andy Shevchenko

On Tue, 2018-06-19 at 15:12 -0300, Henrique de Moraes Holschuh wrote:
> On Tue, 19 Jun 2018, Benjamin Berg wrote:
> > The P52 has a keyboard which features a calculator key above the
> > numpad.
> > Add support for this the calculator key (0x1313).
> > 
> > Signed-off-by: Benjamin Berg <bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > ---
> >  drivers/platform/x86/thinkpad_acpi.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/thinkpad_acpi.c
> > b/drivers/platform/x86/thinkpad_acpi.c
> > index cae9b0595692..6c979fe44ea7 100644
> > --- a/drivers/platform/x86/thinkpad_acpi.c
> > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > @@ -1928,7 +1928,7 @@ enum {	/* hot key scan codes (derived
> > from ACPI DSDT) */
> >  	/* first new observed key (star, favorites) is 0x1311 */
> >  	TP_ACPI_HOTKEYSCAN_STAR = 69,
> >  	TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL2,
> > -	TP_ACPI_HOTKEYSCAN_UNK25,
> > +	TP_ACPI_HOTKEYSCAN_CALCULATOR,
> >  	TP_ACPI_HOTKEYSCAN_BLUETOOTH,
> >  	TP_ACPI_HOTKEYSCAN_KEYBOARD,
> >  
> > @@ -3449,7 +3449,7 @@ static int __init hotkey_init(struct
> > ibm_init_struct *iibm)
> >  
> >  		KEY_FAVORITES,       /* Favorite app, 0x311 */
> >  		KEY_RESERVED,        /* Clipping tool */
> > -		KEY_RESERVED,
> > +		KEY_CALC,            /* Calculator (above numpad),
> > 0x313 */
> 
> Replace 0x313 with (P52) please.

Sure.

> Other than that,
> Acked-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
> 
> 
> That said, it would be nice to know if other models also have this
> hotkey, especially if it has a different meaning (in which case we just
> special-case the keymap in the driver, so it is *not* a problem).

I believe this is not specific to the P52 but simply the keyboard
version that includes a numpad. I only have the P52, but looking at
photos of e.g. the T570 and T580 the keyboard looks identical there.

On a different note, these keyboards also have "=", "(" and ")" keys
above the numpad. These keys emit the key combinations required for a
US keyboard layout on the P52 I have. I do believe there is a way to
set the keyboard layout through ACPI which I suspect changes the
emitted keycodes to match the expected values for other layouts.
Unfortunately supporting that seems quite involved.

Benjamin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH] platform/x86: thinkpad_acpi: Add support for calculator hotkey
       [not found]         ` <5b3d294cd3bfd1c8ce8ae955f13df4d3814109aa.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2018-06-20 12:51           ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2018-06-20 12:51 UTC (permalink / raw)
  To: Benjamin Berg
  Cc: Henrique de Moraes Holschuh, Christian Kellner,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Hart,
	Andy Shevchenko

On Tue, 19 Jun 2018, Benjamin Berg wrote:
> > That said, it would be nice to know if other models also have this
> > hotkey, especially if it has a different meaning (in which case we just
> > special-case the keymap in the driver, so it is *not* a problem).
> 
> I believe this is not specific to the P52 but simply the keyboard
> version that includes a numpad. I only have the P52, but looking at
> photos of e.g. the T570 and T580 the keyboard looks identical there.

Hopefully we get a report from an user of these keyboards.  Identical is
good, the only issue would be if they were not identical...

> On a different note, these keyboards also have "=", "(" and ")" keys
> above the numpad. These keys emit the key combinations required for a
> US keyboard layout on the P52 I have. I do believe there is a way to
> set the keyboard layout through ACPI which I suspect changes the
> emitted keycodes to match the expected values for other layouts.
> Unfortunately supporting that seems quite involved.

Yikes.  Hopefully we won't need to mess with this.

-- 
  Henrique Holschuh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2018-06-20 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 15:51 [PATCH] platform/x86: thinkpad_acpi: Add support for calculator hotkey Benjamin Berg
     [not found] ` <20180619155152.4984-1-bberg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-06-19 18:12   ` Henrique de Moraes Holschuh
     [not found]     ` <20180619181236.4qcyc7qmziqiijn4-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2018-06-19 19:19       ` Benjamin Berg
     [not found]         ` <5b3d294cd3bfd1c8ce8ae955f13df4d3814109aa.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-06-20 12:51           ` Henrique de Moraes Holschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox