From patchwork Mon Apr 27 23:55:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6284821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A9D4BEEE1 for ; Tue, 28 Apr 2015 00:01:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F7AD20376 for ; Tue, 28 Apr 2015 00:01:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D9E120304 for ; Tue, 28 Apr 2015 00:01:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YmsvQ-0007Uj-0V; Mon, 27 Apr 2015 23:58:56 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ymstj-0006pp-0T for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2015 23:57:11 +0000 Received: by pabtp1 with SMTP id tp1so145489307pab.2 for ; Mon, 27 Apr 2015 16:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/f4IOO5SKXEGs8Ecwlx7oNiJy7xs81frAO753pyKMZo=; b=SV3I0zLIl0NMlSizPE6iExi3x9OwOXxolusMXzBF9ucx7ObKzZAFHIY5HiPHQN9ur3 QwSnTZ18rg0GzRT9tey2ENDOG5OnrwEul68RqqVbPkf0XNlmUoF+a7N7FLIw2H6eBnF9 DOZoe8yWf2OuDO8Pf3jywjPvMO5vguEUAqGpxrIY1K4h/h4rsG4X20UEp+4r9UcUgH3H dA7EAQT5GAWQmNJSwjBmUVAZuuR4R/zNz16EpHilTJftnAEnZy54+kiqhfbJbStYBTvr 7YhluCVzG2U3KTOp636rrBJ8iuNXnOlCelSSeHAKD9xWNB4coP1LTdymbkJuG4caWPWm d+XA== X-Received: by 10.66.242.79 with SMTP id wo15mr27208620pac.6.1430179009492; Mon, 27 Apr 2015 16:56:49 -0700 (PDT) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id pv2sm20428375pbb.12.2015.04.27.16.56.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Apr 2015 16:56:48 -0700 (PDT) From: Dmitry Eremin-Solenikov To: Russell King , Daniel Mack , Robert Jarzmik , Linus Walleij , Alexandre Courbot , Wolfram Sang , Dmitry Torokhov , Bryan Wu , Richard Purdie , Samuel Ortiz , Lee Jones , Mark Brown , Jingoo Han , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Liam Girdwood , Andrea Adami Subject: [PATCH v2 04/17] input: locomokbd: provide an Alt-SysRQ combination Date: Tue, 28 Apr 2015 02:55:41 +0300 Message-Id: <1430178954-11138-5-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com> References: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150427_165711_097537_769D21EB X-CRM114-Status: GOOD ( 14.76 ) X-Spam-Score: -0.8 (/) Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is usefull sometimes to have an Alt-SysRQ combo on the keyboard to be able to trigger sysrq functions directly. Add an option providing sysrq mapping for Contact-Home keys. Signed-off-by: Dmitry Eremin-Solenikov --- drivers/input/keyboard/Kconfig | 7 +++++++ drivers/input/keyboard/locomokbd.c | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 0a3d875..eb8b11b 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -343,6 +343,13 @@ config KEYBOARD_LOCOMO To compile this driver as a module, choose M here: the module will be called locomokbd. +config KEYBOARD_LOCOMO_SYSRQ + bool "Provide SysRQ key on LoCoMo keyboard" + depends on KEYBOARD_LOCOMO + help + Say Y here to be able to use Contact-Home as Alt-Sysrq combo. + Say N if you want to use them as usual keys. + config KEYBOARD_LPC32XX tristate "LPC32XX matrix key scanner support" depends on ARCH_LPC32XX && OF diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index eed0a94..eb8dbe2 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -40,6 +40,14 @@ #define KEY_CONTACT KEY_F18 #define KEY_CENTER KEY_F15 +#ifdef CONFIG_KEYBOARD_LOCOMOKBD_SYSRQ +#define LOCOMO_KEY_CONTACT KEY_LEFTALT +#define LOCOMO_KEY_HOME KEY_SYSRQ +#else +#define LOCOMO_KEY_CONTACT KEY_CONTACT +#define LOCOMO_KEY_HOME KEY_HOME +#endif + #define KB_ROWS 16 #define KB_COLS 8 #define LOCOMOKBD_NUMKEYS (KB_ROWS * KB_COLS) @@ -48,7 +56,7 @@ static const unsigned char locomokbd_keycode[LOCOMOKBD_NUMKEYS] = { 0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */ - 0, 0, 0, 0, 0, 0, 0, KEY_MENU, 0, KEY_CONTACT, /* 10 - 19 */ + 0, 0, 0, 0, 0, 0, 0, KEY_MENU, 0, LOCOMO_KEY_CONTACT, /* 10 - 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */ 0, 0, 0, KEY_CENTER, 0, KEY_MAIL, 0, 0, 0, 0, /* 30 - 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_RIGHT, /* 40 - 49 */ @@ -280,9 +288,9 @@ static int locomokbd_probe(struct platform_device *dev) sizeof(locomokbd->keycode)); if (machine_is_collie()) - locomokbd->keycode[18] = KEY_HOME; + locomokbd->keycode[18] = LOCOMO_KEY_HOME; else - locomokbd->keycode[3] = KEY_HOME; + locomokbd->keycode[3] = LOCOMO_KEY_HOME; for (i = 0; i < LOCOMOKBD_NUMKEYS; i++) input_set_capability(input_dev, EV_KEY, locomokbd->keycode[i]);