summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorKuninori Morimoto2012-04-06 10:31:33 +0200
committerRafael J. Wysocki2012-05-12 22:33:04 +0200
commitf7e7d31a1299e11be780f8e2d235570792849e31 (patch)
tree66ce1da572e8eb6bd3632d18dfb5b5e1f67ea204 /arch/arm/mach-shmobile
parentARM: mach-shmobile: armadillo800eva: add support LCDC0 (diff)
downloadkernel-qcow2-linux-f7e7d31a1299e11be780f8e2d235570792849e31.tar.gz
kernel-qcow2-linux-f7e7d31a1299e11be780f8e2d235570792849e31.tar.xz
kernel-qcow2-linux-f7e7d31a1299e11be780f8e2d235570792849e31.zip
ARM: mach-shmobile: armadillo800eva: add support gpio_key
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 5cc17a89f600..0bce9b88b9c2 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -22,8 +22,10 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/kernel.h>
+#include <linux/input.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
+#include <linux/gpio_keys.h>
#include <linux/videodev2.h>
#include <mach/common.h>
#include <mach/irqs.h>
@@ -149,11 +151,35 @@ static struct platform_device lcdc0_device = {
},
};
+/* GPIO KEY */
+#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
+
+static struct gpio_keys_button gpio_buttons[] = {
+ GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"),
+ GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"),
+ GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"),
+ GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"),
+};
+
+static struct gpio_keys_platform_data gpio_key_info = {
+ .buttons = gpio_buttons,
+ .nbuttons = ARRAY_SIZE(gpio_buttons),
+};
+
+static struct platform_device gpio_keys_device = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_key_info,
+ },
+};
+
/*
* board devices
*/
static struct platform_device *eva_devices[] __initdata = {
&lcdc0_device,
+ &gpio_keys_device,
};
/*