From patchwork Fri Jul 17 11:41:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11670005 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D30360D for ; Fri, 17 Jul 2020 11:42:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F3CB204EA for ; Fri, 17 Jul 2020 11:42:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IJDyP4wR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725950AbgGQLmI (ORCPT ); Fri, 17 Jul 2020 07:42:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:38445 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726221AbgGQLmH (ORCPT ); Fri, 17 Jul 2020 07:42:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594986126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6VHlyn1KenVDEYKIzV8zC+5Gv4fsMDeZkh4zk/VQPYw=; b=IJDyP4wR/rP/IO2/kedfLvvd/AkG5hzeYmP1pHeASzkjeSljWj5/L+nPkgBqTLsoZ0yrLu IFyI9IiY+j33wpDYF8JtWxZHpP4F+eDW21lFn1oD15wE/xqqaJaLe1LVWC6kD1rLA6II1E tJo1Qwi1eZjyj5rZdNjbOIk3SAKF7i0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-363-2U3geSUNNIWgCjq6qweQZg-1; Fri, 17 Jul 2020 07:42:04 -0400 X-MC-Unique: 2U3geSUNNIWgCjq6qweQZg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35123106B243; Fri, 17 Jul 2020 11:42:03 +0000 (UTC) Received: from x1.localdomain.com (ovpn-112-162.ams2.redhat.com [10.36.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id C284E5D9E7; Fri, 17 Jul 2020 11:42:00 +0000 (UTC) From: Hans de Goede To: Dmitry Torokhov , Darren Hart , Andy Shevchenko , Henrique de Moraes Holschuh Cc: Hans de Goede , linux-input@vger.kernel.org, Marco Trevisan , Mark Pearson , Christian Kellner , Benjamin Berg , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] Input: allocate keycodes for notification-center, pickup-phone and hangup-phone Date: Fri, 17 Jul 2020 13:41:53 +0200 Message-Id: <20200717114155.56222-2-hdegoede@redhat.com> In-Reply-To: <20200717114155.56222-1-hdegoede@redhat.com> References: <20200717114155.56222-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 --- 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 From patchwork Fri Jul 17 11:41:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11670011 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AC5514E3 for ; Fri, 17 Jul 2020 11:42:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40D2C204EA for ; Fri, 17 Jul 2020 11:42:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IZp+RNgv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgGQLmL (ORCPT ); Fri, 17 Jul 2020 07:42:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29424 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726221AbgGQLmK (ORCPT ); Fri, 17 Jul 2020 07:42:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594986129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qiiTCNya4knXKs5AxhGGf8x1TgrdQl/qReA9nncjnNg=; b=IZp+RNgvDooooZfhJHpUWxMal+4XSBkk4fhpCqaHMeqRYHEWXLeu7mWJi0PeB14PHNPl1Q 1lOTcA3YEbSxOveD53ivV28lW06GGjxUUCW+Gli/BBlPsZDW7kru0Gh8JgYVHisd3iE0dp K5EGn1y47+lOSz1Nk3pqWAFq5pl3OuM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-DVYQz0QJMGWeCsjNLwWN5A-1; Fri, 17 Jul 2020 07:42:07 -0400 X-MC-Unique: DVYQz0QJMGWeCsjNLwWN5A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B97D2C7465; Fri, 17 Jul 2020 11:42:05 +0000 (UTC) Received: from x1.localdomain.com (ovpn-112-162.ams2.redhat.com [10.36.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B65F5D9E7; Fri, 17 Jul 2020 11:42:03 +0000 (UTC) From: Hans de Goede To: Dmitry Torokhov , Darren Hart , Andy Shevchenko , Henrique de Moraes Holschuh Cc: Hans de Goede , linux-input@vger.kernel.org, Marco Trevisan , Mark Pearson , Christian Kellner , Benjamin Berg , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] platform/x86: thinkpad_acpi: Add support for new hotkeys found on X1C8 / T14 Date: Fri, 17 Jul 2020 13:41:54 +0200 Message-Id: <20200717114155.56222-3-hdegoede@redhat.com> In-Reply-To: <20200717114155.56222-1-hdegoede@redhat.com> References: <20200717114155.56222-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 --- 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 */ }, }; From patchwork Fri Jul 17 11:41:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11670009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B52060D for ; Fri, 17 Jul 2020 11:42:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2257A204EA for ; Fri, 17 Jul 2020 11:42:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WnBL+2sz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbgGQLmS (ORCPT ); Fri, 17 Jul 2020 07:42:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27722 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726832AbgGQLmN (ORCPT ); Fri, 17 Jul 2020 07:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594986131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P+tmySyYwC+RAUr3jiRtntADuMTAWZTMpRNx+zgwWY0=; b=WnBL+2szhZtccqTdAeuCJJ4f0o7EqqZxSQJDLKRcyyf/bwSubkXR8ZiZ/LOm218OrMDxac T0nlHR2OtS9O5hY0NPJkGosF7fN2x6LQ2fxEYlz9GcZJ0PPPDt9K/CGf5SBiD+jsjPWVnl w2tkNfK/3kOFwFQAXS8FmsTYnnIP+j4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-SGpgbV4wPlS_ZTh7C4RDIA-1; Fri, 17 Jul 2020 07:42:10 -0400 X-MC-Unique: SGpgbV4wPlS_ZTh7C4RDIA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68EA7106B242; Fri, 17 Jul 2020 11:42:08 +0000 (UTC) Received: from x1.localdomain.com (ovpn-112-162.ams2.redhat.com [10.36.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0955A5D9E7; Fri, 17 Jul 2020 11:42:05 +0000 (UTC) From: Hans de Goede To: Dmitry Torokhov , Darren Hart , Andy Shevchenko , Henrique de Moraes Holschuh Cc: Hans de Goede , linux-input@vger.kernel.org, Marco Trevisan , Mark Pearson , Christian Kellner , Benjamin Berg , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] platform/x86: thinkpad_acpi: Map Clipping tool hotkey to KEY_SELECTIVE_SCREENSHOT Date: Fri, 17 Jul 2020 13:41:55 +0200 Message-Id: <20200717114155.56222-4-hdegoede@redhat.com> In-Reply-To: <20200717114155.56222-1-hdegoede@redhat.com> References: <20200717114155.56222-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 Reviewed-by: Bastien Nocera --- 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 */