diff options
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 5f9881e16e2f..3b1ceb46fa54 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -18,6 +18,7 @@ | |||
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/i2c/tsc2007.h> | ||
21 | #include <linux/input.h> | 22 | #include <linux/input.h> |
22 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
23 | #include <media/sh_mobile_ceu.h> | 24 | #include <media/sh_mobile_ceu.h> |
@@ -38,6 +39,20 @@ | |||
38 | * 0x1800_0000 MFI 16bit | 39 | * 0x1800_0000 MFI 16bit |
39 | */ | 40 | */ |
40 | 41 | ||
42 | /* SWITCH | ||
43 | *------------------------------ | ||
44 | * DS2[1] = FlashROM write protect ON : write protect | ||
45 | * OFF : No write protect | ||
46 | * DS2[2] = RMII / TS, SCIF ON : RMII | ||
47 | * OFF : TS, SCIF3 | ||
48 | * DS2[3] = Camera / Video ON : Camera | ||
49 | * OFF : NTSC/PAL (IN) | ||
50 | * DS2[5] = NTSC_OUT Clock ON : On board OSC | ||
51 | * OFF : SH7724 DV_CLK | ||
52 | * DS2[6-7] = MMC / SD ON-OFF : SD | ||
53 | * OFF-ON : MMC | ||
54 | */ | ||
55 | |||
41 | /* Heartbeat */ | 56 | /* Heartbeat */ |
42 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; | 57 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; |
43 | static struct heartbeat_data heartbeat_data = { | 58 | static struct heartbeat_data heartbeat_data = { |
@@ -70,7 +85,7 @@ static struct mtd_partition nor_flash_partitions[] = { | |||
70 | .name = "boot loader", | 85 | .name = "boot loader", |
71 | .offset = 0, | 86 | .offset = 0, |
72 | .size = (5 * 1024 * 1024), | 87 | .size = (5 * 1024 * 1024), |
73 | .mask_flags = MTD_CAP_ROM, | 88 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
74 | }, { | 89 | }, { |
75 | .name = "free-area", | 90 | .name = "free-area", |
76 | .offset = MTDPART_OFS_APPEND, | 91 | .offset = MTDPART_OFS_APPEND, |
@@ -376,6 +391,43 @@ static struct platform_device keysc_device = { | |||
376 | }, | 391 | }, |
377 | }; | 392 | }; |
378 | 393 | ||
394 | /* TouchScreen */ | ||
395 | #define IRQ0 32 | ||
396 | static int ts_get_pendown_state(void) | ||
397 | { | ||
398 | int val = 0; | ||
399 | gpio_free(GPIO_FN_INTC_IRQ0); | ||
400 | gpio_request(GPIO_PTZ0, NULL); | ||
401 | gpio_direction_input(GPIO_PTZ0); | ||
402 | |||
403 | val = gpio_get_value(GPIO_PTZ0); | ||
404 | |||
405 | gpio_free(GPIO_PTZ0); | ||
406 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | ||
407 | |||
408 | return val ? 0 : 1; | ||
409 | } | ||
410 | |||
411 | static int ts_init(void) | ||
412 | { | ||
413 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | ||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | struct tsc2007_platform_data tsc2007_info = { | ||
418 | .model = 2007, | ||
419 | .x_plate_ohms = 180, | ||
420 | .get_pendown_state = ts_get_pendown_state, | ||
421 | .init_platform_hw = ts_init, | ||
422 | }; | ||
423 | |||
424 | static struct i2c_board_info ts_i2c_clients = { | ||
425 | I2C_BOARD_INFO("tsc2007", 0x48), | ||
426 | .type = "tsc2007", | ||
427 | .platform_data = &tsc2007_info, | ||
428 | .irq = IRQ0, | ||
429 | }; | ||
430 | |||
379 | static struct platform_device *ecovec_devices[] __initdata = { | 431 | static struct platform_device *ecovec_devices[] __initdata = { |
380 | &heartbeat_device, | 432 | &heartbeat_device, |
381 | &nor_flash_device, | 433 | &nor_flash_device, |
@@ -460,6 +512,11 @@ static void __init sh_eth_init(void) | |||
460 | #define IODRIVEA 0xA405018A | 512 | #define IODRIVEA 0xA405018A |
461 | static int __init arch_setup(void) | 513 | static int __init arch_setup(void) |
462 | { | 514 | { |
515 | /* enable STATUS0, STATUS2 and PDSTATUS */ | ||
516 | gpio_request(GPIO_FN_STATUS0, NULL); | ||
517 | gpio_request(GPIO_FN_STATUS2, NULL); | ||
518 | gpio_request(GPIO_FN_PDSTATUS, NULL); | ||
519 | |||
463 | /* enable SCIFA0 */ | 520 | /* enable SCIFA0 */ |
464 | gpio_request(GPIO_FN_SCIF0_TXD, NULL); | 521 | gpio_request(GPIO_FN_SCIF0_TXD, NULL); |
465 | gpio_request(GPIO_FN_SCIF0_RXD, NULL); | 522 | gpio_request(GPIO_FN_SCIF0_RXD, NULL); |
@@ -590,6 +647,10 @@ static int __init arch_setup(void) | |||
590 | */ | 647 | */ |
591 | gpio_request(GPIO_PTF4, NULL); | 648 | gpio_request(GPIO_PTF4, NULL); |
592 | gpio_direction_output(GPIO_PTF4, 1); | 649 | gpio_direction_output(GPIO_PTF4, 1); |
650 | |||
651 | /* enable TouchScreen */ | ||
652 | i2c_register_board_info(0, &ts_i2c_clients, 1); | ||
653 | set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW); | ||
593 | } | 654 | } |
594 | 655 | ||
595 | /* enable CEU0 */ | 656 | /* enable CEU0 */ |