diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-09-14 07:23:00 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-09-14 20:30:46 -0400 |
commit | e9103e74907d748f3cfe1b75b9d895f61c4ebc17 (patch) | |
tree | 77bdc0511dc77c0de7ab2e4b5e7fab45d2a544c0 /arch/sh/boards | |
parent | 1f85d381062a046fd8f3ddb654a5276266daf72c (diff) |
sh: Add KEYSC support for EcoVec24
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 4d6d5884c67f..b89e47920b52 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -18,10 +18,12 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/usb/r8a66597.h> | 19 | #include <linux/usb/r8a66597.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/input.h> | ||
21 | #include <video/sh_mobile_lcdc.h> | 22 | #include <video/sh_mobile_lcdc.h> |
22 | #include <media/sh_mobile_ceu.h> | 23 | #include <media/sh_mobile_ceu.h> |
23 | #include <asm/heartbeat.h> | 24 | #include <asm/heartbeat.h> |
24 | #include <asm/sh_eth.h> | 25 | #include <asm/sh_eth.h> |
26 | #include <asm/sh_keysc.h> | ||
25 | #include <cpu/sh7724.h> | 27 | #include <cpu/sh7724.h> |
26 | 28 | ||
27 | /* | 29 | /* |
@@ -332,6 +334,46 @@ static struct i2c_board_info i2c1_devices[] = { | |||
332 | }, | 334 | }, |
333 | }; | 335 | }; |
334 | 336 | ||
337 | /* KEYSC */ | ||
338 | static struct sh_keysc_info keysc_info = { | ||
339 | .mode = SH_KEYSC_MODE_1, | ||
340 | .scan_timing = 3, | ||
341 | .delay = 50, | ||
342 | .kycr2_delay = 100, | ||
343 | .keycodes = { KEY_1, 0, 0, 0, 0, | ||
344 | KEY_2, 0, 0, 0, 0, | ||
345 | KEY_3, 0, 0, 0, 0, | ||
346 | KEY_4, 0, 0, 0, 0, | ||
347 | KEY_5, 0, 0, 0, 0, | ||
348 | KEY_6, 0, 0, 0, 0, }, | ||
349 | }; | ||
350 | |||
351 | static struct resource keysc_resources[] = { | ||
352 | [0] = { | ||
353 | .name = "KEYSC", | ||
354 | .start = 0x044b0000, | ||
355 | .end = 0x044b000f, | ||
356 | .flags = IORESOURCE_MEM, | ||
357 | }, | ||
358 | [1] = { | ||
359 | .start = 79, | ||
360 | .flags = IORESOURCE_IRQ, | ||
361 | }, | ||
362 | }; | ||
363 | |||
364 | static struct platform_device keysc_device = { | ||
365 | .name = "sh_keysc", | ||
366 | .id = 0, /* keysc0 clock */ | ||
367 | .num_resources = ARRAY_SIZE(keysc_resources), | ||
368 | .resource = keysc_resources, | ||
369 | .dev = { | ||
370 | .platform_data = &keysc_info, | ||
371 | }, | ||
372 | .archdata = { | ||
373 | .hwblk_id = HWBLK_KEYSC, | ||
374 | }, | ||
375 | }; | ||
376 | |||
335 | static struct platform_device *ecovec_devices[] __initdata = { | 377 | static struct platform_device *ecovec_devices[] __initdata = { |
336 | &heartbeat_device, | 378 | &heartbeat_device, |
337 | &nor_flash_device, | 379 | &nor_flash_device, |
@@ -341,6 +383,7 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
341 | &lcdc_device, | 383 | &lcdc_device, |
342 | &ceu0_device, | 384 | &ceu0_device, |
343 | &ceu1_device, | 385 | &ceu1_device, |
386 | &keysc_device, | ||
344 | }; | 387 | }; |
345 | 388 | ||
346 | #define EEPROM_ADDR 0x50 | 389 | #define EEPROM_ADDR 0x50 |
@@ -584,6 +627,15 @@ static int __init arch_setup(void) | |||
584 | gpio_request(GPIO_FN_VIO1_CLK, NULL); | 627 | gpio_request(GPIO_FN_VIO1_CLK, NULL); |
585 | platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20); | 628 | platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20); |
586 | 629 | ||
630 | /* enable KEYSC */ | ||
631 | gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); | ||
632 | gpio_request(GPIO_FN_KEYOUT4_IN6, NULL); | ||
633 | gpio_request(GPIO_FN_KEYOUT3, NULL); | ||
634 | gpio_request(GPIO_FN_KEYOUT2, NULL); | ||
635 | gpio_request(GPIO_FN_KEYOUT1, NULL); | ||
636 | gpio_request(GPIO_FN_KEYOUT0, NULL); | ||
637 | gpio_request(GPIO_FN_KEYIN0, NULL); | ||
638 | |||
587 | /* enable I2C device */ | 639 | /* enable I2C device */ |
588 | i2c_register_board_info(1, i2c1_devices, | 640 | i2c_register_board_info(1, i2c1_devices, |
589 | ARRAY_SIZE(i2c1_devices)); | 641 | ARRAY_SIZE(i2c1_devices)); |