From patchwork Thu Nov 9 22:44:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Br=C3=BCns?= X-Patchwork-Id: 10052055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D2A360631 for ; Thu, 9 Nov 2017 22:46:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50C482AD75 for ; Thu, 9 Nov 2017 22:46:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4581F2AD8E; Thu, 9 Nov 2017 22:46:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C63CA2AD75 for ; Thu, 9 Nov 2017 22:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbdKIWqE (ORCPT ); Thu, 9 Nov 2017 17:46:04 -0500 Received: from mail-out-2.itc.rwth-aachen.de ([134.130.5.47]:28857 "EHLO mail-out-2.itc.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbdKIWo4 (ORCPT ); Thu, 9 Nov 2017 17:44:56 -0500 X-IronPort-AV: E=Sophos;i="5.44,371,1505772000"; d="scan'208";a="22985817" Received: from rwthex-w2-a.rwth-ad.de ([134.130.26.158]) by mail-in-2.itc.rwth-aachen.de with ESMTP; 09 Nov 2017 23:44:53 +0100 Received: from pebbles.fritz.box (78.49.52.200) by rwthex-w2-a.rwth-ad.de (2002:8682:1a9e::8682:1a9e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Thu, 9 Nov 2017 23:44:49 +0100 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= To: CC: , =?UTF-8?q?Stefan=20Br=C3=BCns?= , AceLan Kao , "Andy Shevchenko" , Darren Hart , Subject: [PATCH v2 1/5] platform/x86: intel-vbtn: support SW_TABLET_MODE Date: Thu, 9 Nov 2017 23:44:32 +0100 X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171109224436.16472-1-stefan.bruens@rwth-aachen.de> References: <20171109224436.16472-1-stefan.bruens@rwth-aachen.de> MIME-Version: 1.0 X-Originating-IP: [78.49.52.200] X-ClientProxiedBy: rwthex-w2-b.rwth-ad.de (2002:8682:1a9f::8682:1a9f) To rwthex-w2-a.rwth-ad.de (2002:8682:1a9e::8682:1a9e) Message-ID: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Event code 0xcc is emitted by several convertibles (Dell XPS 12 9Q33 BIOS A8, Dell XPS 13 2in1 9365, HP Spectre x360, Lenovo Thinkpad Helix) when entering tablet mode, and 0xcd on return to laptop mode. Signed-off-by: Stefan BrĂ¼ns --- Changes in v2: - Correct whitespace in key_entry struct The changes where tested on an XPS 12 with BIOS version A8 (2015-03-03). An earlier BIOS version (A2, ~2013) did not report event, at least not using the INT33D6 plattform device. There are other convertible laptops apparenly using the same event codes: https://wiki.gentoo.org/wiki/HP_Spectre_x360_(2015) https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1678200 https://forums.opensuse.org/showthread.php/526850-Touchpad-and-trackpoint-no-longer-working-after-reattaching-convertible-keyboard --- drivers/platform/x86/intel-vbtn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 58c5ff36523a..ae55be91a64b 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -42,6 +42,8 @@ static const struct key_entry intel_vbtn_keymap[] = { { KE_IGNORE, 0xC5, { KEY_VOLUMEUP } }, /* volume-up key release */ { KE_KEY, 0xC6, { KEY_VOLUMEDOWN } }, /* volume-down key press */ { KE_IGNORE, 0xC7, { KEY_VOLUMEDOWN } }, /* volume-down key release */ + { KE_SW, 0xCC, { .sw = { SW_TABLET_MODE, 1 } } }, /* Tablet */ + { KE_SW, 0xCD, { .sw = { SW_TABLET_MODE, 0 } } }, /* Laptop */ { KE_END }, };