aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2011-08-18 01:44:25 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-08-29 03:50:17 -0400
commit6b7c0ea21226972e08ebb71e134fbebdf7459d1a (patch)
tree5aca409900bdc58ebaf10b8566a0eb4c019c07da /arch/arm/mach-shmobile
parentef4f994ae11c0a587e2554b1a6b8b0e1dfa07c4e (diff)
ARM: mach-shmobile: Kota2 GPIO Keys support
This patch ties in GPIO Keys support on the Kota2 board. For now the keys are used in polling mode, but after extending the sh73a0 PFC with IRQ support we should be able to switch to the IRQ driven driver. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index 8a6b85a52cb7..849423cddca9 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -31,6 +31,7 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/input.h> 32#include <linux/input.h>
33#include <linux/input/sh_keysc.h> 33#include <linux/input/sh_keysc.h>
34#include <linux/gpio_keys.h>
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35#include <mach/sh73a0.h> 36#include <mach/sh73a0.h>
36#include <mach/common.h> 37#include <mach/common.h>
@@ -114,9 +115,40 @@ static struct platform_device keysc_device = {
114 }, 115 },
115}; 116};
116 117
118#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
119
120static struct gpio_keys_button gpio_buttons[] = {
121 GPIO_KEY(KEY_VOLUMEUP, GPIO_PORT56, "+"), /* S2: VOL+ [IRQ9] */
122 GPIO_KEY(KEY_VOLUMEDOWN, GPIO_PORT54, "-"), /* S3: VOL- [IRQ10] */
123 GPIO_KEY(KEY_MENU, GPIO_PORT27, "Menu"), /* S4: MENU [IRQ30] */
124 GPIO_KEY(KEY_HOMEPAGE, GPIO_PORT26, "Home"), /* S5: HOME [IRQ31] */
125 GPIO_KEY(KEY_BACK, GPIO_PORT11, "Back"), /* S6: BACK [IRQ0] */
126 GPIO_KEY(KEY_PHONE, GPIO_PORT238, "Tel"), /* S7: TEL [IRQ11] */
127 GPIO_KEY(KEY_POWER, GPIO_PORT239, "C1"), /* S8: CAM [IRQ13] */
128 GPIO_KEY(KEY_MAIL, GPIO_PORT224, "Mail"), /* S9: MAIL [IRQ3] */
129 /* Omitted button "C3?": GPIO_PORT223 - S10: CUST [IRQ8] */
130 GPIO_KEY(KEY_CAMERA, GPIO_PORT164, "C2"), /* S11: CAM_HALF [IRQ25] */
131 /* Omitted button "?": GPIO_PORT152 - S12: CAM_FULL [No IRQ] */
132};
133
134static struct gpio_keys_platform_data gpio_key_info = {
135 .buttons = gpio_buttons,
136 .nbuttons = ARRAY_SIZE(gpio_buttons),
137 .poll_interval = 250, /* polled for now */
138};
139
140static struct platform_device gpio_keys_device = {
141 .name = "gpio-keys-polled", /* polled for now */
142 .id = -1,
143 .dev = {
144 .platform_data = &gpio_key_info,
145 },
146};
147
117static struct platform_device *kota2_devices[] __initdata = { 148static struct platform_device *kota2_devices[] __initdata = {
118 &eth_device, 149 &eth_device,
119 &keysc_device, 150 &keysc_device,
151 &gpio_keys_device,
120}; 152};
121 153
122static struct map_desc kota2_io_desc[] __initdata = { 154static struct map_desc kota2_io_desc[] __initdata = {