aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-handheld-4.0/poodle/0002-ARM-pxa-poodle-add-gpio-keys-configuration.patch
blob: 6d67268ba930d1f047de85b4181abfeef271772d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 0939a5b7a9711457895655467dfb6f0fe6933834 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Wed, 24 Dec 2014 01:42:55 +0300
Subject: [PATCH 02/04] ARM: pxa: poodle: add gpio-keys configuration

Support setting wakeup sources through the two gpio keys - On button and
'Sync' key present on cradle.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/poodle.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 4dd29a7..596e756 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -35,6 +35,8 @@
 #include <linux/memblock.h>
 #include <linux/iio/machine.h>
 #include <linux/mfd/locomo.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -161,6 +163,38 @@ static struct scoop_pcmcia_config poodle_pcmcia_config = {
 
 EXPORT_SYMBOL(poodle_scoop_device);
 
+static struct gpio_keys_button poodle_gpio_keys[] = {
+	{
+		.type	= EV_PWR,
+		.code	= KEY_RESERVED,
+		.gpio	= POODLE_GPIO_ON_KEY,
+		.desc	= "On key",
+		.wakeup	= 1,
+		.active_low = 1,
+	},
+	{
+		.type	= EV_PWR,
+		.code	= KEY_WAKEUP,
+		.gpio	= POODLE_GPIO_WAKEUP,
+		.desc	= "Sync",
+		.wakeup = 1,
+		.active_low = 1,
+	},
+};
+
+static struct gpio_keys_platform_data poodle_gpio_keys_data = {
+	.buttons	= poodle_gpio_keys,
+	.nbuttons	= ARRAY_SIZE(poodle_gpio_keys),
+};
+
+static struct platform_device poodle_gpio_keys_device = {
+	.name	= "gpio-keys",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &poodle_gpio_keys_data,
+	},
+};
+
 
 static struct platform_device poodle_audio_device = {
 	.name	= "poodle-audio",
@@ -436,6 +470,7 @@ static struct platform_device *devices[] __initdata = {
 	&poodle_locomo_device,
 	&poodle_scoop_device,
 	&poodle_audio_device,
+	&poodle_gpio_keys_device,
 	&sharpsl_nand_device,
 	&sharpsl_rom_device,
 	&poodle_power_device,
-- 
1.9.1