linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads
@ 2020-09-08 13:51 Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 1/4] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Hans de Goede @ 2020-09-08 13:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Darren Hart, Andy Shevchenko,
	Henrique de Moraes Holschuh
  Cc: Hans de Goede, linux-input, Mark Pearson, ibm-acpi-devel,
	platform-driver-x86, Andy Shevchenko

Hi All,

Here is a v2 of my series to get a couple of new hotkeys, and matching
thinkpad_acpi hkey event codes seen on the last 2 generations of
Thinkpads supported.

New in this version that Lenovo got back to me and explained that the 0x1316
hkey event belongs to Fn + right Shift, so that is mapped now too.

Since these make both include/uapi/linux/input-event-codes.h and
drivers/platform/x86 changes one open question with this series is how to
merge it.

Dmitry, for v1 of this series you suggested you could merge them all
through the input tree ? Andy, one of the drivers/platform/x86 maintainers
gave his Acked-by for this:

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Alternatively the entire series could be merged through the
linux-platform-drivers-x86 repo:

https://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git/shortlog/refs/heads/review-andy

Regards,

Hans


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

* [PATCH v2 1/4] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone
  2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
@ 2020-09-08 13:51 ` Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 2/4] Input: allocate keycode for Fn + right shift Hans de Goede
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-09-08 13:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Darren Hart, Andy Shevchenko,
	Henrique de Moraes Holschuh
  Cc: Hans de Goede, linux-input, Mark Pearson, ibm-acpi-devel,
	platform-driver-x86, Henrique de Moraes Holschuh

New Lenovo Thinkpad models, e.g. the X1 Carbon 8th gen and the new T14 gen1
models have 3 new symbols / shortcuts on their F9-F11 keys (and the
thinkpad_acpi driver receives 3 new "scancodes" for these):

F9:  Has a symbol resembling a rectangular speech balloon, the manual says
     the hotkey functions shows or hides the notification center
F10: Has a symbol of a telephone horn which has been picked up from the
     receiver, the manual says: "Answer incoming calls"
F11: Has a symbol of a telephone horn which is resting on the receiver,
     the manual says: "Decline incoming calls"

We have no existing keycodes which are a good match for these, so
add 3 new keycodes for these.

I noticed that we have a hole in our keycodes between 0x1ba and 0x1c0
which does not seem to be reserved for any specific purpose, so these
new 3 codes use 0x1bc - 0x1be, instead of starting at 0x27b.

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/uapi/linux/input-event-codes.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 0c2e27d28e0a..b74821d09145 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -515,6 +515,9 @@
 #define KEY_10CHANNELSUP	0x1b8	/* 10 channels up (10+) */
 #define KEY_10CHANNELSDOWN	0x1b9	/* 10 channels down (10-) */
 #define KEY_IMAGES		0x1ba	/* AL Image Browser */
+#define KEY_NOTIFICATION_CENTER	0x1bc	/* Show/hide the notification center */
+#define KEY_PICKUP_PHONE	0x1bd	/* Answer incoming call */
+#define KEY_HANGUP_PHONE	0x1be	/* Decline incoming call */
 
 #define KEY_DEL_EOL		0x1c0
 #define KEY_DEL_EOS		0x1c1
-- 
2.28.0


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

* [PATCH v2 2/4] Input: allocate keycode for Fn + right shift
  2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 1/4] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone Hans de Goede
@ 2020-09-08 13:51 ` Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 3/4] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14 Hans de Goede
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-09-08 13:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Darren Hart, Andy Shevchenko,
	Henrique de Moraes Holschuh
  Cc: Hans de Goede, linux-input, Mark Pearson, ibm-acpi-devel,
	platform-driver-x86

The last 2 generations of Lenovo Thinkpads send an acpi_thinkpad event when
Fn + right shift is pressed.  This is intended for use with "Lenovo Quick
Clean" software, which disables the touchpad + kbd for 2 minutes on this
key-combo so that healthcare workes can disinfect it.

But there is no silkscreen print on the right-keyboard to indicate this,
so add a KEY_FN_RIGHT_SHIFT keycode define to use for this key-combo.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- New patch in v2 of this patch-set
---
 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 b74821d09145..ee93428ced9a 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -545,6 +545,7 @@
 #define KEY_FN_F		0x1e2
 #define KEY_FN_S		0x1e3
 #define KEY_FN_B		0x1e4
+#define KEY_FN_RIGHT_SHIFT	0x1e5
 
 #define KEY_BRL_DOT1		0x1f1
 #define KEY_BRL_DOT2		0x1f2
-- 
2.28.0


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

* [PATCH v2 3/4] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14
  2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 1/4] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 2/4] Input: allocate keycode for Fn + right shift Hans de Goede
@ 2020-09-08 13:51 ` Hans de Goede
  2020-09-08 13:51 ` [PATCH v2 4/4] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT Hans de Goede
  2020-09-08 23:39 ` [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Dmitry Torokhov
  4 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-09-08 13:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Darren Hart, Andy Shevchenko,
	Henrique de Moraes Holschuh
  Cc: Hans de Goede, linux-input, Mark Pearson, ibm-acpi-devel,
	platform-driver-x86, Henrique de Moraes Holschuh

New Lenovo Thinkpad models, e.g. the X1 Carbon 8th gen and the new T14 gen1
models have 3 new symbols / shortcuts on their F9-F11 keys (and the
thinkpad_acpi driver receives 3 new hkey events for these):

F9:  Has a symbol resembling a rectangular speech balloon, the manual says
     the hotkey functions shows or hides the notification center
F10: Has a symbol of a telephone horn which has been picked up from the
     receiver, the manual says: "Answer incoming calls"
F11: Has a symbol of a telephone horn which is resting on the receiver,
     the manual says: "Decline incoming calls"

And these Thinkpad models also send a new 0x1316 hkey events when the
Fn + right Shift key-combo is pressed.

This commit adds support for these 4 new hkey events.

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Map 0x1316 to KEY_FN_RIGHT_SHIFT instead of to KEY_UNKNOWN (now that we
  know what it does)
---
 drivers/platform/x86/thinkpad_acpi.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9c4df41687a3..4b701e9a0392 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1913,6 +1913,10 @@ enum {	/* hot key scan codes (derived from ACPI DSDT) */
 	TP_ACPI_HOTKEYSCAN_CALCULATOR,
 	TP_ACPI_HOTKEYSCAN_BLUETOOTH,
 	TP_ACPI_HOTKEYSCAN_KEYBOARD,
+	TP_ACPI_HOTKEYSCAN_FN_RIGHT_SHIFT, /* Used by "Lenovo Quick Clean" */
+	TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER,
+	TP_ACPI_HOTKEYSCAN_PICKUP_PHONE,
+	TP_ACPI_HOTKEYSCAN_HANGUP_PHONE,
 
 	/* Hotkey keymap size */
 	TPACPI_HOTKEY_MAP_LEN
@@ -3429,11 +3433,15 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
 		KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
 		KEY_UNKNOWN,
 
-		KEY_BOOKMARKS,       /* Favorite app, 0x311 */
-		KEY_RESERVED,        /* Clipping tool */
-		KEY_CALC,            /* Calculator (above numpad, P52) */
-		KEY_BLUETOOTH,       /* Bluetooth */
-		KEY_KEYBOARD         /* Keyboard, 0x315 */
+		KEY_BOOKMARKS,			/* Favorite app, 0x311 */
+		KEY_RESERVED,			/* Clipping tool */
+		KEY_CALC,			/* Calculator (above numpad, P52) */
+		KEY_BLUETOOTH,			/* Bluetooth */
+		KEY_KEYBOARD,			/* Keyboard, 0x315 */
+		KEY_FN_RIGHT_SHIFT,		/* Fn + right Shift */
+		KEY_NOTIFICATION_CENTER,	/* Notification Center */
+		KEY_PICKUP_PHONE,		/* Answer incoming call */
+		KEY_HANGUP_PHONE,		/* Decline incoming call */
 		},
 	};
 
-- 
2.28.0


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

* [PATCH v2 4/4] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT
  2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
                   ` (2 preceding siblings ...)
  2020-09-08 13:51 ` [PATCH v2 3/4] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14 Hans de Goede
@ 2020-09-08 13:51 ` Hans de Goede
  2020-09-08 23:39 ` [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Dmitry Torokhov
  4 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-09-08 13:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Darren Hart, Andy Shevchenko,
	Henrique de Moraes Holschuh
  Cc: Hans de Goede, linux-input, Mark Pearson, ibm-acpi-devel,
	platform-driver-x86, Bastien Nocera, Henrique de Moraes Holschuh

Commit 696c6523ec8f ("platform/x86: thinkpad_acpi: add mapping for new
hotkeys") added support for a bunch of new hotkeys, but the
clipping/snipping tool hotkey got ignored because there was no good
key-code to map it to.

Recently a new KEY_SELECTIVE_SCREENSHOT keycode was added by commit
3b059da9835c ("Input: allocate keycode for "Selective Screenshot" key")
quoting from the commit message:

"New Chrome OS keyboards have a "snip" key that is basically a selective
screenshot (allows a user to select an area of screen to be copied).
Allocate a keycode for it."

Support for this "snip" key seems like it is also a good match for the
clipping/snipping tool hotkey, so map this hotkey to the new
KEY_SELECTIVE_SCREENSHOT key-code.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 4b701e9a0392..47925c319d7b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3434,7 +3434,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
 		KEY_UNKNOWN,
 
 		KEY_BOOKMARKS,			/* Favorite app, 0x311 */
-		KEY_RESERVED,			/* Clipping tool */
+		KEY_SELECTIVE_SCREENSHOT,	/* Clipping tool */
 		KEY_CALC,			/* Calculator (above numpad, P52) */
 		KEY_BLUETOOTH,			/* Bluetooth */
 		KEY_KEYBOARD,			/* Keyboard, 0x315 */
-- 
2.28.0


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

* Re: [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads
  2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
                   ` (3 preceding siblings ...)
  2020-09-08 13:51 ` [PATCH v2 4/4] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT Hans de Goede
@ 2020-09-08 23:39 ` Dmitry Torokhov
  4 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2020-09-08 23:39 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Darren Hart, Andy Shevchenko, Henrique de Moraes Holschuh,
	linux-input, Mark Pearson, ibm-acpi-devel, platform-driver-x86,
	Andy Shevchenko

Hi Hans,

On Tue, Sep 08, 2020 at 03:51:43PM +0200, Hans de Goede wrote:
> Hi All,
> 
> Here is a v2 of my series to get a couple of new hotkeys, and matching
> thinkpad_acpi hkey event codes seen on the last 2 generations of
> Thinkpads supported.
> 
> New in this version that Lenovo got back to me and explained that the 0x1316
> hkey event belongs to Fn + right Shift, so that is mapped now too.
> 
> Since these make both include/uapi/linux/input-event-codes.h and
> drivers/platform/x86 changes one open question with this series is how to
> merge it.
> 
> Dmitry, for v1 of this series you suggested you could merge them all
> through the input tree ? Andy, one of the drivers/platform/x86 maintainers
> gave his Acked-by for this:
> 
> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

I queued up the series, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2020-09-08 23:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 13:51 [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Hans de Goede
2020-09-08 13:51 ` [PATCH v2 1/4] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone Hans de Goede
2020-09-08 13:51 ` [PATCH v2 2/4] Input: allocate keycode for Fn + right shift Hans de Goede
2020-09-08 13:51 ` [PATCH v2 3/4] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14 Hans de Goede
2020-09-08 13:51 ` [PATCH v2 4/4] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT Hans de Goede
2020-09-08 23:39 ` [PATCH v2 0/4] Add 4 new keycodes and use them for 4 new hotkeys on new Lenovo Thinkpads Dmitry Torokhov

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).