diff options
Diffstat (limited to 'arch/arm/mach-exynos4/mach-universal_c210.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-universal_c210.c | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c index 97d329fff2cf..0e280d12301e 100644 --- a/arch/arm/mach-exynos4/mach-universal_c210.c +++ b/arch/arm/mach-exynos4/mach-universal_c210.c | |||
@@ -18,6 +18,9 @@ | |||
18 | #include <linux/regulator/fixed.h> | 18 | #include <linux/regulator/fixed.h> |
19 | #include <linux/regulator/max8952.h> | 19 | #include <linux/regulator/max8952.h> |
20 | #include <linux/mmc/host.h> | 20 | #include <linux/mmc/host.h> |
21 | #include <linux/i2c-gpio.h> | ||
22 | #include <linux/i2c/mcs.h> | ||
23 | #include <linux/i2c/atmel_mxt_ts.h> | ||
21 | 24 | ||
22 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
23 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
@@ -27,7 +30,10 @@ | |||
27 | #include <plat/cpu.h> | 30 | #include <plat/cpu.h> |
28 | #include <plat/devs.h> | 31 | #include <plat/devs.h> |
29 | #include <plat/iic.h> | 32 | #include <plat/iic.h> |
33 | #include <plat/gpio-cfg.h> | ||
34 | #include <plat/mfc.h> | ||
30 | #include <plat/sdhci.h> | 35 | #include <plat/sdhci.h> |
36 | #include <plat/pd.h> | ||
31 | 37 | ||
32 | #include <mach/map.h> | 38 | #include <mach/map.h> |
33 | 39 | ||
@@ -477,6 +483,96 @@ static struct i2c_board_info i2c5_devs[] __initdata = { | |||
477 | }, | 483 | }, |
478 | }; | 484 | }; |
479 | 485 | ||
486 | /* I2C3 (TSP) */ | ||
487 | static struct mxt_platform_data qt602240_platform_data = { | ||
488 | .x_line = 19, | ||
489 | .y_line = 11, | ||
490 | .x_size = 800, | ||
491 | .y_size = 480, | ||
492 | .blen = 0x11, | ||
493 | .threshold = 0x28, | ||
494 | .voltage = 2800000, /* 2.8V */ | ||
495 | .orient = MXT_DIAGONAL, | ||
496 | }; | ||
497 | |||
498 | static struct i2c_board_info i2c3_devs[] __initdata = { | ||
499 | { | ||
500 | I2C_BOARD_INFO("qt602240_ts", 0x4a), | ||
501 | .platform_data = &qt602240_platform_data, | ||
502 | }, | ||
503 | }; | ||
504 | |||
505 | static void __init universal_tsp_init(void) | ||
506 | { | ||
507 | int gpio; | ||
508 | |||
509 | /* TSP_LDO_ON: XMDMADDR_11 */ | ||
510 | gpio = EXYNOS4_GPE2(3); | ||
511 | gpio_request(gpio, "TSP_LDO_ON"); | ||
512 | gpio_direction_output(gpio, 1); | ||
513 | gpio_export(gpio, 0); | ||
514 | |||
515 | /* TSP_INT: XMDMADDR_7 */ | ||
516 | gpio = EXYNOS4_GPE1(7); | ||
517 | gpio_request(gpio, "TSP_INT"); | ||
518 | |||
519 | s5p_register_gpio_interrupt(gpio); | ||
520 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
521 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); | ||
522 | i2c3_devs[0].irq = gpio_to_irq(gpio); | ||
523 | } | ||
524 | |||
525 | |||
526 | /* GPIO I2C 12 (3 Touchkey) */ | ||
527 | static uint32_t touchkey_keymap[] = { | ||
528 | /* MCS_KEY_MAP(value, keycode) */ | ||
529 | MCS_KEY_MAP(0, KEY_MENU), /* KEY_SEND */ | ||
530 | MCS_KEY_MAP(1, KEY_BACK), /* KEY_END */ | ||
531 | }; | ||
532 | |||
533 | static struct mcs_platform_data touchkey_data = { | ||
534 | .keymap = touchkey_keymap, | ||
535 | .keymap_size = ARRAY_SIZE(touchkey_keymap), | ||
536 | .key_maxval = 2, | ||
537 | }; | ||
538 | |||
539 | /* GPIO I2C 3_TOUCH 2.8V */ | ||
540 | #define I2C_GPIO_BUS_12 12 | ||
541 | static struct i2c_gpio_platform_data i2c_gpio12_data = { | ||
542 | .sda_pin = EXYNOS4_GPE4(0), /* XMDMDATA_8 */ | ||
543 | .scl_pin = EXYNOS4_GPE4(1), /* XMDMDATA_9 */ | ||
544 | }; | ||
545 | |||
546 | static struct platform_device i2c_gpio12 = { | ||
547 | .name = "i2c-gpio", | ||
548 | .id = I2C_GPIO_BUS_12, | ||
549 | .dev = { | ||
550 | .platform_data = &i2c_gpio12_data, | ||
551 | }, | ||
552 | }; | ||
553 | |||
554 | static struct i2c_board_info i2c_gpio12_devs[] __initdata = { | ||
555 | { | ||
556 | I2C_BOARD_INFO("mcs5080_touchkey", 0x20), | ||
557 | .platform_data = &touchkey_data, | ||
558 | }, | ||
559 | }; | ||
560 | |||
561 | static void __init universal_touchkey_init(void) | ||
562 | { | ||
563 | int gpio; | ||
564 | |||
565 | gpio = EXYNOS4_GPE3(7); /* XMDMDATA_7 */ | ||
566 | gpio_request(gpio, "3_TOUCH_INT"); | ||
567 | s5p_register_gpio_interrupt(gpio); | ||
568 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
569 | i2c_gpio12_devs[0].irq = gpio_to_irq(gpio); | ||
570 | |||
571 | gpio = EXYNOS4_GPE3(3); /* XMDMDATA_3 */ | ||
572 | gpio_request(gpio, "3_TOUCH_EN"); | ||
573 | gpio_direction_output(gpio, 1); | ||
574 | } | ||
575 | |||
480 | /* GPIO KEYS */ | 576 | /* GPIO KEYS */ |
481 | static struct gpio_keys_button universal_gpio_keys_tables[] = { | 577 | static struct gpio_keys_button universal_gpio_keys_tables[] = { |
482 | { | 578 | { |
@@ -608,15 +704,25 @@ static struct i2c_board_info i2c1_devs[] __initdata = { | |||
608 | 704 | ||
609 | static struct platform_device *universal_devices[] __initdata = { | 705 | static struct platform_device *universal_devices[] __initdata = { |
610 | /* Samsung Platform Devices */ | 706 | /* Samsung Platform Devices */ |
707 | &s5p_device_fimc0, | ||
708 | &s5p_device_fimc1, | ||
709 | &s5p_device_fimc2, | ||
710 | &s5p_device_fimc3, | ||
611 | &mmc0_fixed_voltage, | 711 | &mmc0_fixed_voltage, |
612 | &s3c_device_hsmmc0, | 712 | &s3c_device_hsmmc0, |
613 | &s3c_device_hsmmc2, | 713 | &s3c_device_hsmmc2, |
614 | &s3c_device_hsmmc3, | 714 | &s3c_device_hsmmc3, |
715 | &s3c_device_i2c3, | ||
615 | &s3c_device_i2c5, | 716 | &s3c_device_i2c5, |
616 | 717 | ||
617 | /* Universal Devices */ | 718 | /* Universal Devices */ |
719 | &i2c_gpio12, | ||
618 | &universal_gpio_keys, | 720 | &universal_gpio_keys, |
619 | &s5p_device_onenand, | 721 | &s5p_device_onenand, |
722 | &s5p_device_mfc, | ||
723 | &s5p_device_mfc_l, | ||
724 | &s5p_device_mfc_r, | ||
725 | &exynos4_device_pd[PD_MFC], | ||
620 | }; | 726 | }; |
621 | 727 | ||
622 | static void __init universal_map_io(void) | 728 | static void __init universal_map_io(void) |
@@ -626,6 +732,11 @@ static void __init universal_map_io(void) | |||
626 | s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); | 732 | s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); |
627 | } | 733 | } |
628 | 734 | ||
735 | static void __init universal_reserve(void) | ||
736 | { | ||
737 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); | ||
738 | } | ||
739 | |||
629 | static void __init universal_machine_init(void) | 740 | static void __init universal_machine_init(void) |
630 | { | 741 | { |
631 | universal_sdhci_init(); | 742 | universal_sdhci_init(); |
@@ -633,11 +744,20 @@ static void __init universal_machine_init(void) | |||
633 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); | 744 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); |
634 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 745 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
635 | 746 | ||
747 | universal_tsp_init(); | ||
748 | s3c_i2c3_set_platdata(NULL); | ||
749 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); | ||
750 | |||
636 | s3c_i2c5_set_platdata(NULL); | 751 | s3c_i2c5_set_platdata(NULL); |
637 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 752 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
638 | 753 | ||
754 | universal_touchkey_init(); | ||
755 | i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs, | ||
756 | ARRAY_SIZE(i2c_gpio12_devs)); | ||
757 | |||
639 | /* Last */ | 758 | /* Last */ |
640 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); | 759 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); |
760 | s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; | ||
641 | } | 761 | } |
642 | 762 | ||
643 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | 763 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") |
@@ -647,4 +767,5 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | |||
647 | .map_io = universal_map_io, | 767 | .map_io = universal_map_io, |
648 | .init_machine = universal_machine_init, | 768 | .init_machine = universal_machine_init, |
649 | .timer = &exynos4_timer, | 769 | .timer = &exynos4_timer, |
770 | .reserve = &universal_reserve, | ||
650 | MACHINE_END | 771 | MACHINE_END |