aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch')
-rw-r--r--recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch b/recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch
new file mode 100644
index 0000000..9dacb53
--- /dev/null
+++ b/recipes-kernel/linux/linux-handheld-4.4/locomo/0017-input-make-LoCoMo-keyboard-driver-support-both-poodl.patch
@@ -0,0 +1,55 @@
+From d04257820435b5cb8bd0710a71d40297b59463ff Mon Sep 17 00:00:00 2001
+From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+Date: Wed, 13 May 2015 23:13:51 +0300
+Subject: [PATCH 17/44] input: make LoCoMo keyboard driver support both poodle
+ and collie
+
+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 <dbaryshkov@gmail.com>
+Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+---
+ 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 <linux/slab.h>
+ #include <linux/mfd/locomo.h>
+
++/* There is one minor difference between mappings on poodle and collie */
++#include <asm/mach-types.h>
++
+ #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);
+--
+1.9.1
+