aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-16 05:48:15 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-03-14 22:13:13 -0400
commit03fb256df9c960b10c0e01b7e92d2f31433675fe (patch)
treeae65bbc3a539e674ef0c82f11d653ea1d386e16f /arch/arm/mach-shmobile
parentbca14dd14f3b0c5e3e2d1d314679f85b67871365 (diff)
ARM: mach-shmobile: G3EVM KEYSC platform data
This patch adds KEYSC platform data for the G3EVM board. 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-g3evm.c55
-rw-r--r--arch/arm/mach-shmobile/clock-sh7367.c7
2 files changed, 62 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index f36c9a94d326..9d326893a212 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -29,6 +29,8 @@
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/gpio.h> 31#include <linux/gpio.h>
32#include <linux/input.h>
33#include <linux/input/sh_keysc.h>
32#include <mach/sh7367.h> 34#include <mach/sh7367.h>
33#include <mach/common.h> 35#include <mach/common.h>
34#include <asm/mach-types.h> 36#include <asm/mach-types.h>
@@ -127,9 +129,47 @@ static struct platform_device usb_host_device = {
127 .resource = usb_host_resources, 129 .resource = usb_host_resources,
128}; 130};
129 131
132/* KEYSC */
133static struct sh_keysc_info keysc_info = {
134 .mode = SH_KEYSC_MODE_5,
135 .scan_timing = 3,
136 .delay = 100,
137 .keycodes = {
138 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
139 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
140 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
141 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
142 KEY_WAKEUP, KEY_COFFEE, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
143 KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
144 },
145};
146
147static struct resource keysc_resources[] = {
148 [0] = {
149 .name = "KEYSC",
150 .start = 0xe61b0000,
151 .end = 0xe61b000f,
152 .flags = IORESOURCE_MEM,
153 },
154 [1] = {
155 .start = 79,
156 .flags = IORESOURCE_IRQ,
157 },
158};
159
160static struct platform_device keysc_device = {
161 .name = "sh_keysc",
162 .num_resources = ARRAY_SIZE(keysc_resources),
163 .resource = keysc_resources,
164 .dev = {
165 .platform_data = &keysc_info,
166 },
167};
168
130static struct platform_device *g3evm_devices[] __initdata = { 169static struct platform_device *g3evm_devices[] __initdata = {
131 &nor_flash_device, 170 &nor_flash_device,
132 &usb_host_device, 171 &usb_host_device,
172 &keysc_device,
133}; 173};
134 174
135static struct map_desc g3evm_io_desc[] __initdata = { 175static struct map_desc g3evm_io_desc[] __initdata = {
@@ -196,6 +236,21 @@ static void __init g3evm_init(void)
196 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ 236 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
197 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ 237 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
198 238
239 /* KEYSC @ CN7 */
240 gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
241 gpio_request(GPIO_FN_PORT43_KEYOUT1, NULL);
242 gpio_request(GPIO_FN_PORT44_KEYOUT2, NULL);
243 gpio_request(GPIO_FN_PORT45_KEYOUT3, NULL);
244 gpio_request(GPIO_FN_PORT46_KEYOUT4, NULL);
245 gpio_request(GPIO_FN_PORT47_KEYOUT5, NULL);
246 gpio_request(GPIO_FN_PORT48_KEYIN0_PU, NULL);
247 gpio_request(GPIO_FN_PORT49_KEYIN1_PU, NULL);
248 gpio_request(GPIO_FN_PORT50_KEYIN2_PU, NULL);
249 gpio_request(GPIO_FN_PORT55_KEYIN3_PU, NULL);
250 gpio_request(GPIO_FN_PORT56_KEYIN4_PU, NULL);
251 gpio_request(GPIO_FN_PORT57_KEYIN5_PU, NULL);
252 gpio_request(GPIO_FN_PORT58_KEYIN6_PU, NULL);
253
199 sh7367_add_standard_devices(); 254 sh7367_add_standard_devices();
200 255
201 platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices)); 256 platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
index 58bd54e1113a..bb940c6e4e6c 100644
--- a/arch/arm/mach-shmobile/clock-sh7367.c
+++ b/arch/arm/mach-shmobile/clock-sh7367.c
@@ -75,6 +75,11 @@ static struct clk usb0_clk = {
75 .name = "usb0", 75 .name = "usb0",
76}; 76};
77 77
78/* a static keysc0 clk for now - enough to get sh_keysc working */
79static struct clk keysc0_clk = {
80 .name = "keysc0",
81};
82
78static struct clk_lookup lookups[] = { 83static struct clk_lookup lookups[] = {
79 { 84 {
80 .clk = &peripheral_clk, 85 .clk = &peripheral_clk,
@@ -82,6 +87,8 @@ static struct clk_lookup lookups[] = {
82 .clk = &r_clk, 87 .clk = &r_clk,
83 }, { 88 }, {
84 .clk = &usb0_clk, 89 .clk = &usb0_clk,
90 }, {
91 .clk = &keysc0_clk,
85 } 92 }
86}; 93};
87 94