From patchwork Sun May 17 16:27:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6424931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 614489F1C1 for ; Sun, 17 May 2015 16:33:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90196205D4 for ; Sun, 17 May 2015 16:33:11 +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 BEE09205FF for ; Sun, 17 May 2015 16:33:10 +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 1Yu1ST-0006LL-MM; Sun, 17 May 2015 16:30:33 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yu1R5-0004ag-Ba for linux-arm-kernel@lists.infradead.org; Sun, 17 May 2015 16:29:08 +0000 Received: by pdbnk13 with SMTP id nk13so16087947pdb.1 for ; Sun, 17 May 2015 09:28:46 -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=2Fgmkbf68kMKjZJxzYg38E4ULNkE6KkNzUzvxcs28oI=; b=ghvDoXGfB3IPLwPVSMvQ3Egq0tDtqIBRNFLNy4XJjX4qXD7PFnTBNAYGVrQe6SADFy lLVNpCprddN/r88eQA6mrs8HokFUxchUt+uSerBzlbc/bcwC/WhYAdmdmkofLIAADpeN oTJ3tPH6ub1PoVYyyHL/eOfv0aLNi0TuSMiuoYnyq/YLc2S9WuX0Oy+2UKsD7nS7Rw3e ikwL/OMFZ4mHilPHD4Ekziyk2NVkcNph+TmRuWaUZGT1LUekwPJnYDywmciYKKOOYq3p xgAEhZPWz3KBFcwVnJgornLcexwpCb31CAuAr8yHNl9moui/yj1NmTPnH5/7yYJ/Tubw nYgg== X-Received: by 10.70.101.231 with SMTP id fj7mr37334695pdb.84.1431880126358; Sun, 17 May 2015 09:28:46 -0700 (PDT) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id pw9sm7574264pac.27.2015.05.17.09.28.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 09:28:45 -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 v3 04/17] input: make LoCoMo keyboard driver support both poodle and collie Date: Sun, 17 May 2015 19:27:44 +0300 Message-Id: <1431880077-26321-5-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com> References: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150517_092907_459226_2D3D0CA7 X-CRM114-Status: GOOD ( 13.56 ) X-Spam-Score: -0.8 (/) Cc: linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.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 Keyboards on collie and poodle differ only in wiring of 'Home' key. Instead of complicating the driver with platform data, just check for the machine for the time being. This will be converted to DTS property sometime in the future. Signed-off-by: Dmitry Eremin-Solenikov Acked-by: Dmitry Torokhov --- drivers/input/keyboard/locomokbd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index 1657bc0..b422608 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -33,6 +33,9 @@ #include #include +/* There is one minor difference between mappings on poodle and collie */ +#include + #define KEY_ACTIVITY KEY_F16 #define KEY_CONTACT KEY_F18 #define KEY_CENTER KEY_F15 @@ -45,7 +48,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, KEY_HOME, KEY_CONTACT, /* 10 - 19 */ + 0, 0, 0, 0, 0, 0, 0, KEY_MENU, 0, 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 */ @@ -278,6 +281,11 @@ static int locomokbd_probe(struct platform_device *dev) locomokbd_keycode, sizeof(locomokbd->keycode)); + if (machine_is_collie()) + locomokbd->keycode[18] = KEY_HOME; + else + locomokbd->keycode[3] = KEY_HOME; + for (i = 0; i < LOCOMOKBD_NUMKEYS; i++) input_set_capability(input_dev, EV_KEY, locomokbd->keycode[i]); input_set_capability(input_dev, EV_PWR, KEY_SUSPEND);