2020-07-17 11:42:39

by Hans de Goede

[permalink] [raw]
Subject: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

Hi All,

This is a simple patch-series adding support for 3 new hotkeys found
on various new Lenovo Thinkpad models.

There is one small complication, these 3 new hotkeys also require
the addition of new key-codes to include/uapi/linux/input-event-codes.h.

And those changes have to land first. It is probably easiest to just
merge everything through the platform/x86 tree, or alternatively we
would need an immutable branch from the input-subsys with the first
patch on there which the platform/x86 maintainers can then merge.

Dmitry, can you please let us know how you want to proceed with these
changes; And if you are ok with merging the input-event-codes.h changes
through the platform/x86 tree, may we have your Acked-by for that ?

Regards,

Hans


2020-07-17 11:42:42

by Hans de Goede

[permalink] [raw]
Subject: [PATCH 1/3] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone

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 baloon, 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.

Signed-off-by: Hans de Goede <[email protected]>
---
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 b6a835d37826..8d605a6df502 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.26.2

2020-07-17 11:42:55

by Hans de Goede

[permalink] [raw]
Subject: [PATCH 2/3] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14

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 baloon, 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"

This commit adds support for these 3 new hotkeys.

Signed-off-by: Hans de Goede <[email protected]>
---
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 7dd84cb4fcef..7fc44b6f8370 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1915,6 +1915,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_1316, /* 0x1316 scancode is unknown */
+ TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER,
+ TP_ACPI_HOTKEYSCAN_PICKUP_PHONE,
+ TP_ACPI_HOTKEYSCAN_HANGUP_PHONE,

/* Hotkey keymap size */
TPACPI_HOTKEY_MAP_LEN
@@ -3431,11 +3435,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_UNKNOWN, /* 0x316, unknown */
+ KEY_NOTIFICATION_CENTER, /* Notification Center */
+ KEY_PICKUP_PHONE, /* Answer incoming call */
+ KEY_HANGUP_PHONE, /* Decline incoming call */
},
};

--
2.26.2

2020-07-17 11:45:05

by Hans de Goede

[permalink] [raw]
Subject: [PATCH 3/3] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT

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.

Signed-off-by: Hans de Goede <[email protected]>
---
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 7fc44b6f8370..70d533b0c907 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3436,7 +3436,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.26.2

2020-07-17 12:22:47

by Bastien Nocera

[permalink] [raw]
Subject: Re: [PATCH 3/3] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT

On Fri, 2020-07-17 at 13:41 +0200, Hans de Goede wrote:
> 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.
>
> Signed-off-by: Hans de Goede <[email protected]>

Added 5 years ago for the Carbon X1 2014, and finally getting
a keycode ;)

Reviewed-by: Bastien Nocera <[email protected]>

> ---
> 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 7fc44b6f8370..70d533b0c907 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -3436,7 +3436,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 */

Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Fri, 17 Jul 2020, Hans de Goede wrote:
> This is a simple patch-series adding support for 3 new hotkeys found
> on various new Lenovo Thinkpad models.

For all three patches, pending an ack for the new keycodes by the input
maintainers:

Acked-by: Henrique de Moraes Holschuh <[email protected]>

--
Henrique Holschuh

2020-07-22 05:44:36

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
> On Fri, 17 Jul 2020, Hans de Goede wrote:
> > This is a simple patch-series adding support for 3 new hotkeys found
> > on various new Lenovo Thinkpad models.
>
> For all three patches, pending an ack for the new keycodes by the input
> maintainers:
>
> Acked-by: Henrique de Moraes Holschuh <[email protected]>

Do you want me to merge all 3 through input tree?

Thanks.

--
Dmitry

Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Tue, 21 Jul 2020, Dmitry Torokhov wrote:
> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
> > On Fri, 17 Jul 2020, Hans de Goede wrote:
> > > This is a simple patch-series adding support for 3 new hotkeys found
> > > on various new Lenovo Thinkpad models.
> >
> > For all three patches, pending an ack for the new keycodes by the input
> > maintainers:
> >
> > Acked-by: Henrique de Moraes Holschuh <[email protected]>
>
> Do you want me to merge all 3 through input tree?

Hans, Daren, Andy, what do you prefer?

--
Henrique Holschuh

2020-07-27 07:48:18

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

Hi,

On 7/27/20 2:50 AM, Henrique de Moraes Holschuh wrote:
> On Tue, 21 Jul 2020, Dmitry Torokhov wrote:
>> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
>>> On Fri, 17 Jul 2020, Hans de Goede wrote:
>>>> This is a simple patch-series adding support for 3 new hotkeys found
>>>> on various new Lenovo Thinkpad models.
>>>
>>> For all three patches, pending an ack for the new keycodes by the input
>>> maintainers:
>>>
>>> Acked-by: Henrique de Moraes Holschuh <[email protected]>
>>
>> Do you want me to merge all 3 through input tree?
>
> Hans, Daren, Andy, what do you prefer?

Taking all this upstream through Dmitry's input tree is fine with
me, but this really is up to Andy and/or Daren.

Regards,

Hans

2020-07-27 07:51:10

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Mon, Jul 27, 2020 at 10:45 AM Hans de Goede <[email protected]> wrote:
>
> Hi,
>
> On 7/27/20 2:50 AM, Henrique de Moraes Holschuh wrote:
> > On Tue, 21 Jul 2020, Dmitry Torokhov wrote:
> >> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
> >>> On Fri, 17 Jul 2020, Hans de Goede wrote:
> >>>> This is a simple patch-series adding support for 3 new hotkeys found
> >>>> on various new Lenovo Thinkpad models.
> >>>
> >>> For all three patches, pending an ack for the new keycodes by the input
> >>> maintainers:
> >>>
> >>> Acked-by: Henrique de Moraes Holschuh <[email protected]>
> >>
> >> Do you want me to merge all 3 through input tree?
> >
> > Hans, Daren, Andy, what do you prefer?
>
> Taking all this upstream through Dmitry's input tree is fine with
> me, but this really is up to Andy and/or Daren.

Fine with me.

--
With Best Regards,
Andy Shevchenko

2020-07-27 11:02:08

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Mon, Jul 27, 2020 at 10:49 AM Andy Shevchenko
<[email protected]> wrote:
>
> On Mon, Jul 27, 2020 at 10:45 AM Hans de Goede <[email protected]> wrote:
> >
> > Hi,
> >
> > On 7/27/20 2:50 AM, Henrique de Moraes Holschuh wrote:
> > > On Tue, 21 Jul 2020, Dmitry Torokhov wrote:
> > >> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
> > >>> On Fri, 17 Jul 2020, Hans de Goede wrote:
> > >>>> This is a simple patch-series adding support for 3 new hotkeys found
> > >>>> on various new Lenovo Thinkpad models.
> > >>>
> > >>> For all three patches, pending an ack for the new keycodes by the input
> > >>> maintainers:
> > >>>
> > >>> Acked-by: Henrique de Moraes Holschuh <[email protected]>
> > >>
> > >> Do you want me to merge all 3 through input tree?
> > >
> > > Hans, Daren, Andy, what do you prefer?
> >
> > Taking all this upstream through Dmitry's input tree is fine with
> > me, but this really is up to Andy and/or Daren.
>
> Fine with me.

To be clear, I assume it will go thru input tree.
If my formal tag needed, use
Acked-by: Andy Shevchenko <[email protected]>

--
With Best Regards,
Andy Shevchenko

Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

On Mon, 27 Jul 2020, Andy Shevchenko wrote:
> On Mon, Jul 27, 2020 at 10:49 AM Andy Shevchenko
> <[email protected]> wrote:
> > On Mon, Jul 27, 2020 at 10:45 AM Hans de Goede <[email protected]> wrote:
> > >
> > > Hi,
> > >
> > > On 7/27/20 2:50 AM, Henrique de Moraes Holschuh wrote:
> > > > On Tue, 21 Jul 2020, Dmitry Torokhov wrote:
> > > >> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
> > > >>> On Fri, 17 Jul 2020, Hans de Goede wrote:
> > > >>>> This is a simple patch-series adding support for 3 new hotkeys found
> > > >>>> on various new Lenovo Thinkpad models.
> > > >>>
> > > >>> For all three patches, pending an ack for the new keycodes by the input
> > > >>> maintainers:
> > > >>>
> > > >>> Acked-by: Henrique de Moraes Holschuh <[email protected]>
> > > >>
> > > >> Do you want me to merge all 3 through input tree?
> > > >
> > > > Hans, Daren, Andy, what do you prefer?
> > >
> > > Taking all this upstream through Dmitry's input tree is fine with
> > > me, but this really is up to Andy and/or Daren.
> >
> > Fine with me.
>
> To be clear, I assume it will go thru input tree.
> If my formal tag needed, use
> Acked-by: Andy Shevchenko <[email protected]>

Also,
Acked-by: Henrique de Moraes Holschuh <[email protected]>

--
Henrique Holschuh

2020-08-26 15:15:07

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add 3 new keycodes and use them for 3 new hotkeys on new Lenovo Thinkpads

Hi Dmitry,

On 7/22/20 7:41 AM, Dmitry Torokhov wrote:
> On Sun, Jul 19, 2020 at 07:56:49PM -0300, Henrique de Moraes Holschuh wrote:
>> On Fri, 17 Jul 2020, Hans de Goede wrote:
>>> This is a simple patch-series adding support for 3 new hotkeys found
>>> on various new Lenovo Thinkpad models.
>>
>> For all three patches, pending an ack for the new keycodes by the input
>> maintainers:
>>
>> Acked-by: Henrique de Moraes Holschuh <[email protected]>
>
> Do you want me to merge all 3 through input tree?

Despite Andy's acked-by:

Acked-by: Andy Shevchenko <[email protected]>

For merging these through the input tree I'm not seeing these in 5.9-rc2 ?

Regards,

Hans