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: 473190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 266C51402B5 for ; Mon, 18 May 2015 02:28:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ghvDoXGf; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbbEQQ2s (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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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);