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: 6424421 Return-Path: X-Original-To: patchwork-linux-spi@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 8F726C0432 for ; Sun, 17 May 2015 16:28:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEE712046F for ; Sun, 17 May 2015 16:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5D9E20602 for ; Sun, 17 May 2015 16:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751029AbbEQQ2s (ORCPT ); Sun, 17 May 2015 12:28:48 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:34383 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbbEQQ2q (ORCPT ); Sun, 17 May 2015 12:28:46 -0400 Received: by pdbnk13 with SMTP id nk13so16087948pdb.1; 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 Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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);