diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2010-02-23 02:07:01 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-25 02:58:34 -0500 |
commit | 17ccb834d517c66c09123c24ba8553c5b14e0f78 (patch) | |
tree | 7f8e208c220dfb75c021b4af8febe7d05660cbaf /arch/arm/mach-shmobile | |
parent | 41dcc17c735d4e99a91002b09850d0f09ee4ab4b (diff) |
ARM: mach-shmobile: ap4evb: Add KEYSC support
Because AP4 board has capacitor for KEYSC,
we need much time for waiting.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index d9a46d0ce01c..a0463d926447 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/smsc911x.h> | 30 | #include <linux/smsc911x.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/common.h> | 34 | #include <mach/common.h> |
33 | #include <mach/sh7372.h> | 35 | #include <mach/sh7372.h> |
34 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
@@ -77,6 +79,15 @@ | |||
77 | * OFF access enable | 79 | * OFF access enable |
78 | */ | 80 | */ |
79 | 81 | ||
82 | /* | ||
83 | * KEYSC | ||
84 | * | ||
85 | * SW43 KEYSC | ||
86 | * ------------------------- | ||
87 | * ON enable | ||
88 | * OFF disable | ||
89 | */ | ||
90 | |||
80 | /* MTD */ | 91 | /* MTD */ |
81 | static struct mtd_partition nor_flash_partitions[] = { | 92 | static struct mtd_partition nor_flash_partitions[] = { |
82 | { | 93 | { |
@@ -158,9 +169,47 @@ static struct platform_device smc911x_device = { | |||
158 | }, | 169 | }, |
159 | }; | 170 | }; |
160 | 171 | ||
172 | /* KEYSC (Needs SW43 set to ON) */ | ||
173 | static struct sh_keysc_info keysc_info = { | ||
174 | .mode = SH_KEYSC_MODE_1, | ||
175 | .scan_timing = 3, | ||
176 | .delay = 2500, | ||
177 | .keycodes = { | ||
178 | KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, | ||
179 | KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, | ||
180 | KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, | ||
181 | KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, | ||
182 | KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, | ||
183 | }, | ||
184 | }; | ||
185 | |||
186 | static struct resource keysc_resources[] = { | ||
187 | [0] = { | ||
188 | .name = "KEYSC", | ||
189 | .start = 0xe61b0000, | ||
190 | .end = 0xe61b0063, | ||
191 | .flags = IORESOURCE_MEM, | ||
192 | }, | ||
193 | [1] = { | ||
194 | .start = 79, | ||
195 | .flags = IORESOURCE_IRQ, | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | static struct platform_device keysc_device = { | ||
200 | .name = "sh_keysc", | ||
201 | .id = 0, /* "keysc0" clock */ | ||
202 | .num_resources = ARRAY_SIZE(keysc_resources), | ||
203 | .resource = keysc_resources, | ||
204 | .dev = { | ||
205 | .platform_data = &keysc_info, | ||
206 | }, | ||
207 | }; | ||
208 | |||
161 | static struct platform_device *ap4evb_devices[] __initdata = { | 209 | static struct platform_device *ap4evb_devices[] __initdata = { |
162 | &nor_flash_device, | 210 | &nor_flash_device, |
163 | &smc911x_device, | 211 | &smc911x_device, |
212 | &keysc_device, | ||
164 | }; | 213 | }; |
165 | 214 | ||
166 | static struct map_desc ap4evb_io_desc[] __initdata = { | 215 | static struct map_desc ap4evb_io_desc[] __initdata = { |
@@ -225,6 +274,18 @@ static void __init ap4evb_init(void) | |||
225 | gpio_export(GPIO_PORT34, 0); | 274 | gpio_export(GPIO_PORT34, 0); |
226 | gpio_export(GPIO_PORT35, 0); | 275 | gpio_export(GPIO_PORT35, 0); |
227 | 276 | ||
277 | /* enable KEYSC */ | ||
278 | gpio_request(GPIO_FN_KEYOUT0, NULL); | ||
279 | gpio_request(GPIO_FN_KEYOUT1, NULL); | ||
280 | gpio_request(GPIO_FN_KEYOUT2, NULL); | ||
281 | gpio_request(GPIO_FN_KEYOUT3, NULL); | ||
282 | gpio_request(GPIO_FN_KEYOUT4, NULL); | ||
283 | gpio_request(GPIO_FN_KEYIN0_136, NULL); | ||
284 | gpio_request(GPIO_FN_KEYIN1_135, NULL); | ||
285 | gpio_request(GPIO_FN_KEYIN2_134, NULL); | ||
286 | gpio_request(GPIO_FN_KEYIN3_133, NULL); | ||
287 | gpio_request(GPIO_FN_KEYIN4, NULL); | ||
288 | |||
228 | sh7372_add_standard_devices(); | 289 | sh7372_add_standard_devices(); |
229 | 290 | ||
230 | platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices)); | 291 | platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices)); |