aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNISHIMOTO Hiroki <nishimoto.hiroki@renesas.com>2010-02-23 05:55:10 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-03-14 23:06:45 -0400
commit6676a1701b0b135dacbb7cfeef48004315300df0 (patch)
tree3aea85e99b81ba25412e530e50f3ae654a7fdaad /arch
parent3e862c05ca1bf5bd4cb703bc257d180a4583bc41 (diff)
ARM: mach-shmobile: G4EVM KEYSC platform data
This patch adds KEYSC platform data for the G4EVM board. Signed-off-by: NISHIMOTO Hiroki <nishimoto.hiroki@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index 5acd623f93e7..10673a90be52 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -28,6 +28,8 @@
28#include <linux/mtd/physmap.h> 28#include <linux/mtd/physmap.h>
29#include <linux/usb/r8a66597.h> 29#include <linux/usb/r8a66597.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/input.h>
32#include <linux/input/sh_keysc.h>
31#include <linux/gpio.h> 33#include <linux/gpio.h>
32#include <mach/sh7377.h> 34#include <mach/sh7377.h>
33#include <mach/common.h> 35#include <mach/common.h>
@@ -128,9 +130,49 @@ static struct platform_device usb_host_device = {
128 .resource = usb_host_resources, 130 .resource = usb_host_resources,
129}; 131};
130 132
133/* KEYSC */
134static struct sh_keysc_info keysc_info = {
135 .mode = SH_KEYSC_MODE_5,
136 .scan_timing = 3,
137 .delay = 100,
138 .keycodes = {
139 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
140 KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
141 KEY_M, KEY_N, KEY_U, KEY_P, KEY_Q, KEY_R,
142 KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X,
143 KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE,
144 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
145 KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
146 },
147};
148
149static struct resource keysc_resources[] = {
150 [0] = {
151 .name = "KEYSC",
152 .start = 0xe61b0000,
153 .end = 0xe61b000f,
154 .flags = IORESOURCE_MEM,
155 },
156 [1] = {
157 .start = 79,
158 .flags = IORESOURCE_IRQ,
159 },
160};
161
162static struct platform_device keysc_device = {
163 .name = "sh_keysc",
164 .id = 0, /* keysc0 clock */
165 .num_resources = ARRAY_SIZE(keysc_resources),
166 .resource = keysc_resources,
167 .dev = {
168 .platform_data = &keysc_info,
169 },
170};
171
131static struct platform_device *g4evm_devices[] __initdata = { 172static struct platform_device *g4evm_devices[] __initdata = {
132 &nor_flash_device, 173 &nor_flash_device,
133 &usb_host_device, 174 &usb_host_device,
175 &keysc_device,
134}; 176};
135 177
136static struct map_desc g4evm_io_desc[] __initdata = { 178static struct map_desc g4evm_io_desc[] __initdata = {
@@ -196,6 +238,21 @@ static void __init g4evm_init(void)
196 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ 238 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
197 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ 239 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
198 240
241 /* KEYSC @ CN31 */
242 gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
243 gpio_request(GPIO_FN_PORT61_KEYOUT4, NULL);
244 gpio_request(GPIO_FN_PORT62_KEYOUT3, NULL);
245 gpio_request(GPIO_FN_PORT63_KEYOUT2, NULL);
246 gpio_request(GPIO_FN_PORT64_KEYOUT1, NULL);
247 gpio_request(GPIO_FN_PORT65_KEYOUT0, NULL);
248 gpio_request(GPIO_FN_PORT66_KEYIN0_PU, NULL);
249 gpio_request(GPIO_FN_PORT67_KEYIN1_PU, NULL);
250 gpio_request(GPIO_FN_PORT68_KEYIN2_PU, NULL);
251 gpio_request(GPIO_FN_PORT69_KEYIN3_PU, NULL);
252 gpio_request(GPIO_FN_PORT70_KEYIN4_PU, NULL);
253 gpio_request(GPIO_FN_PORT71_KEYIN5_PU, NULL);
254 gpio_request(GPIO_FN_PORT72_KEYIN6_PU, NULL);
255
199 sh7377_add_standard_devices(); 256 sh7377_add_standard_devices();
200 257
201 platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices)); 258 platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));