From patchwork Mon May 25 11:41:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6473401 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 D503EC0020 for ; Mon, 25 May 2015 11:43:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75FB9204A7 for ; Mon, 25 May 2015 11:43:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2998C2034A for ; Mon, 25 May 2015 11:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455AbbEYLmd (ORCPT ); Mon, 25 May 2015 07:42:33 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:33015 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398AbbEYLm1 (ORCPT ); Mon, 25 May 2015 07:42:27 -0400 Received: by lbbzk7 with SMTP id zk7so50230034lbb.0; Mon, 25 May 2015 04:42:25 -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=/yY0Qo2vCCLOVdlCJejLNC/848C/GD5MYoLScfgPCHY=; b=BimpTdm0mCRu6XaDFPDNfLZUn1Z1Ize6j+3sIOWqzYT71D51HeEQ+F1hRZHklyiyrK c7/eUQX6UGEdFUTE9ipDhnmYfmkykkP1wMR2fSYzGPxDKBjgOL1rVv+2/CG+x8rEpmJ4 F2ic06tbEK6NAxItlk7+9iO3Pfpzya1K4b7PDPBOc6PCO/7t9UtM0IiavszD1BpBSGGf Zs3gEgLGpIblHNGW1iP5kAHIpShm+mHMzfb6jshwl6LOmArX3r/Lu8l7uxMYT6R2beJw g++PoLEcNT59ajKYTJieg6c0e29AHeCEDSftgaGUecROU2zhKoVac54Z/ed9+03Zgvzr frAQ== X-Received: by 10.112.157.100 with SMTP id wl4mr17963390lbb.20.1432554145757; Mon, 25 May 2015 04:42:25 -0700 (PDT) Received: from anuminas.rup.mentorg.com (ppp89-110-13-209.pppoe.avangarddsl.ru. [89.110.13.209]) by mx.google.com with ESMTPSA id si3sm2315895lbb.32.2015.05.25.04.42.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 May 2015 04:42:24 -0700 (PDT) From: Dmitry Eremin-Solenikov To: Russell King , Daniel Mack , Robert Jarzmik , Linus Walleij , Alexandre Courbot , Dmitry Torokhov , Samuel Ortiz , Lee Jones , Mark Brown , Jingoo Han , Liam Girdwood , Andrea Adami Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH v4 05/18] input: make LoCoMo keyboard driver support both poodle and collie Date: Mon, 25 May 2015 14:41:40 +0300 Message-Id: <1432554113-26280-6-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1432554113-26280-1-git-send-email-dbaryshkov@gmail.com> References: <1432554113-26280-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=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 7645053..73d6e58 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);