1 /* linux/arch/arm/mach-exynos4/mach-universal_c210.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
10 #include <linux/platform_device.h>
11 #include <linux/serial_core.h>
12 #include <linux/input.h>
13 #include <linux/i2c.h>
14 #include <linux/gpio_keys.h>
15 #include <linux/gpio.h>
16 #include <linux/interrupt.h>
18 #include <linux/mfd/max8998.h>
19 #include <linux/regulator/machine.h>
20 #include <linux/regulator/fixed.h>
21 #include <linux/regulator/max8952.h>
22 #include <linux/mmc/host.h>
23 #include <linux/i2c-gpio.h>
24 #include <linux/i2c/mcs.h>
25 #include <linux/i2c/atmel_mxt_ts.h>
27 #include <asm/mach/arch.h>
28 #include <asm/hardware/gic.h>
29 #include <asm/mach-types.h>
31 #include <plat/regs-serial.h>
33 #include <plat/devs.h>
35 #include <plat/gpio-cfg.h>
38 #include <plat/sdhci.h>
40 #include <plat/regs-fb-v4.h>
41 #include <plat/fimc-core.h>
42 #include <plat/camport.h>
43 #include <plat/mipi_csis.h>
47 #include <media/v4l2-mediabus.h>
48 #include <media/s5p_fimc.h>
49 #include <media/m5mols.h>
53 /* Following are default values for UCON, ULCON and UFCON UART registers */
54 #define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
55 S3C2410_UCON_RXILEVEL | \
56 S3C2410_UCON_TXIRQMODE | \
57 S3C2410_UCON_RXIRQMODE | \
58 S3C2410_UCON_RXFIFO_TOI | \
59 S3C2443_UCON_RXERR_IRQEN)
61 #define UNIVERSAL_ULCON_DEFAULT S3C2410_LCON_CS8
63 #define UNIVERSAL_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
64 S5PV210_UFCON_TXTRIG256 | \
65 S5PV210_UFCON_RXTRIG256)
67 static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
70 .ucon = UNIVERSAL_UCON_DEFAULT,
71 .ulcon = UNIVERSAL_ULCON_DEFAULT,
72 .ufcon = UNIVERSAL_UFCON_DEFAULT,
76 .ucon = UNIVERSAL_UCON_DEFAULT,
77 .ulcon = UNIVERSAL_ULCON_DEFAULT,
78 .ufcon = UNIVERSAL_UFCON_DEFAULT,
82 .ucon = UNIVERSAL_UCON_DEFAULT,
83 .ulcon = UNIVERSAL_ULCON_DEFAULT,
84 .ufcon = UNIVERSAL_UFCON_DEFAULT,
88 .ucon = UNIVERSAL_UCON_DEFAULT,
89 .ulcon = UNIVERSAL_ULCON_DEFAULT,
90 .ufcon = UNIVERSAL_UFCON_DEFAULT,
94 static struct regulator_consumer_supply max8952_consumer =
95 REGULATOR_SUPPLY("vdd_arm", NULL);
97 static struct max8952_platform_data universal_max8952_pdata __initdata = {
98 .gpio_vid0 = EXYNOS4_GPX0(3),
99 .gpio_vid1 = EXYNOS4_GPX0(4),
100 .gpio_en = -1, /* Not controllable, set "Always High" */
101 .default_mode = 0, /* vid0 = 0, vid1 = 0 */
102 .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
103 .sync_freq = 0, /* default: fastest */
104 .ramp_speed = 0, /* default: fastest */
111 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
115 .num_consumer_supplies = 1,
116 .consumer_supplies = &max8952_consumer,
120 static struct regulator_consumer_supply lp3974_buck1_consumer =
121 REGULATOR_SUPPLY("vdd_int", NULL);
123 static struct regulator_consumer_supply lp3974_buck2_consumer =
124 REGULATOR_SUPPLY("vddg3d", NULL);
126 static struct regulator_consumer_supply lp3974_buck3_consumer =
127 REGULATOR_SUPPLY("vdet", "s5p-sdo");
129 static struct regulator_init_data lp3974_buck1_data = {
134 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
135 REGULATOR_CHANGE_STATUS,
141 .num_consumer_supplies = 1,
142 .consumer_supplies = &lp3974_buck1_consumer,
145 static struct regulator_init_data lp3974_buck2_data = {
150 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
151 REGULATOR_CHANGE_STATUS,
157 .num_consumer_supplies = 1,
158 .consumer_supplies = &lp3974_buck2_consumer,
161 static struct regulator_init_data lp3974_buck3_data = {
172 .num_consumer_supplies = 1,
173 .consumer_supplies = &lp3974_buck3_consumer,
176 static struct regulator_init_data lp3974_buck4_data = {
181 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
189 static struct regulator_init_data lp3974_ldo2_data = {
191 .name = "VALIVE_1.2V",
202 static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
203 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"),
204 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"),
205 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"),
208 static struct regulator_init_data lp3974_ldo3_data = {
210 .name = "VUSB+MIPI_1.1V",
214 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
219 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo3_consumer),
220 .consumer_supplies = lp3974_ldo3_consumer,
223 static struct regulator_consumer_supply lp3974_ldo4_consumer[] = {
224 REGULATOR_SUPPLY("vdd_osc", "exynos4-hdmi"),
227 static struct regulator_init_data lp3974_ldo4_data = {
233 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
238 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo4_consumer),
239 .consumer_supplies = lp3974_ldo4_consumer,
242 static struct regulator_init_data lp3974_ldo5_data = {
248 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
255 static struct regulator_init_data lp3974_ldo6_data = {
261 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
268 static struct regulator_consumer_supply lp3974_ldo7_consumer[] = {
269 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"),
272 static struct regulator_init_data lp3974_ldo7_data = {
274 .name = "VLCD+VMIPI_1.8V",
278 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
283 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo7_consumer),
284 .consumer_supplies = lp3974_ldo7_consumer,
287 static struct regulator_consumer_supply lp3974_ldo8_consumer[] = {
288 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
291 static struct regulator_init_data lp3974_ldo8_data = {
293 .name = "VUSB+VDAC_3.3V",
297 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
302 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo8_consumer),
303 .consumer_supplies = lp3974_ldo8_consumer,
306 static struct regulator_init_data lp3974_ldo9_data = {
319 static struct regulator_init_data lp3974_ldo10_data = {
326 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
333 static struct regulator_consumer_supply lp3974_ldo11_consumer =
334 REGULATOR_SUPPLY("dig_28", "0-001f");
336 static struct regulator_init_data lp3974_ldo11_data = {
338 .name = "CAM_AF_3.3V",
342 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
347 .num_consumer_supplies = 1,
348 .consumer_supplies = &lp3974_ldo11_consumer,
351 static struct regulator_init_data lp3974_ldo12_data = {
357 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
364 static struct regulator_init_data lp3974_ldo13_data = {
370 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
377 static struct regulator_consumer_supply lp3974_ldo14_consumer =
378 REGULATOR_SUPPLY("dig_18", "0-001f");
380 static struct regulator_init_data lp3974_ldo14_data = {
382 .name = "CAM_I_HOST_1.8V",
386 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
391 .num_consumer_supplies = 1,
392 .consumer_supplies = &lp3974_ldo14_consumer,
396 static struct regulator_consumer_supply lp3974_ldo15_consumer =
397 REGULATOR_SUPPLY("dig_12", "0-001f");
399 static struct regulator_init_data lp3974_ldo15_data = {
401 .name = "CAM_S_DIG+FM33_CORE_1.2V",
405 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
410 .num_consumer_supplies = 1,
411 .consumer_supplies = &lp3974_ldo15_consumer,
414 static struct regulator_consumer_supply lp3974_ldo16_consumer[] = {
415 REGULATOR_SUPPLY("a_sensor", "0-001f"),
418 static struct regulator_init_data lp3974_ldo16_data = {
420 .name = "CAM_S_ANA_2.8V",
424 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
429 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo16_consumer),
430 .consumer_supplies = lp3974_ldo16_consumer,
433 static struct regulator_init_data lp3974_ldo17_data = {
435 .name = "VCC_3.0V_LCD",
439 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
447 static struct regulator_init_data lp3974_32khz_ap_data = {
457 static struct regulator_init_data lp3974_32khz_cp_data = {
466 static struct regulator_init_data lp3974_vichg_data = {
475 static struct regulator_init_data lp3974_esafeout1_data = {
478 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
485 static struct regulator_init_data lp3974_esafeout2_data = {
489 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
496 static struct max8998_regulator_data lp3974_regulators[] = {
497 { MAX8998_LDO2, &lp3974_ldo2_data },
498 { MAX8998_LDO3, &lp3974_ldo3_data },
499 { MAX8998_LDO4, &lp3974_ldo4_data },
500 { MAX8998_LDO5, &lp3974_ldo5_data },
501 { MAX8998_LDO6, &lp3974_ldo6_data },
502 { MAX8998_LDO7, &lp3974_ldo7_data },
503 { MAX8998_LDO8, &lp3974_ldo8_data },
504 { MAX8998_LDO9, &lp3974_ldo9_data },
505 { MAX8998_LDO10, &lp3974_ldo10_data },
506 { MAX8998_LDO11, &lp3974_ldo11_data },
507 { MAX8998_LDO12, &lp3974_ldo12_data },
508 { MAX8998_LDO13, &lp3974_ldo13_data },
509 { MAX8998_LDO14, &lp3974_ldo14_data },
510 { MAX8998_LDO15, &lp3974_ldo15_data },
511 { MAX8998_LDO16, &lp3974_ldo16_data },
512 { MAX8998_LDO17, &lp3974_ldo17_data },
513 { MAX8998_BUCK1, &lp3974_buck1_data },
514 { MAX8998_BUCK2, &lp3974_buck2_data },
515 { MAX8998_BUCK3, &lp3974_buck3_data },
516 { MAX8998_BUCK4, &lp3974_buck4_data },
517 { MAX8998_EN32KHZ_AP, &lp3974_32khz_ap_data },
518 { MAX8998_EN32KHZ_CP, &lp3974_32khz_cp_data },
519 { MAX8998_ENVICHG, &lp3974_vichg_data },
520 { MAX8998_ESAFEOUT1, &lp3974_esafeout1_data },
521 { MAX8998_ESAFEOUT2, &lp3974_esafeout2_data },
524 static struct max8998_platform_data universal_lp3974_pdata = {
525 .num_regulators = ARRAY_SIZE(lp3974_regulators),
526 .regulators = lp3974_regulators,
527 .buck1_voltage1 = 1100000, /* INT */
528 .buck1_voltage2 = 1000000,
529 .buck1_voltage3 = 1100000,
530 .buck1_voltage4 = 1000000,
531 .buck1_set1 = EXYNOS4_GPX0(5),
532 .buck1_set2 = EXYNOS4_GPX0(6),
533 .buck2_voltage1 = 1200000, /* G3D */
534 .buck2_voltage2 = 1100000,
535 .buck1_default_idx = 0,
536 .buck2_set3 = EXYNOS4_GPE2(0),
537 .buck2_default_idx = 0,
542 enum fixed_regulator_id {
544 FIXED_REG_ID_HDMI_5V,
545 FIXED_REG_ID_CAM_S_IF,
546 FIXED_REG_ID_CAM_I_CORE,
547 FIXED_REG_ID_CAM_VT_DIO,
550 static struct regulator_consumer_supply hdmi_fixed_consumer =
551 REGULATOR_SUPPLY("hdmi-en", "exynos4-hdmi");
553 static struct regulator_init_data hdmi_fixed_voltage_init_data = {
556 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
558 .num_consumer_supplies = 1,
559 .consumer_supplies = &hdmi_fixed_consumer,
562 static struct fixed_voltage_config hdmi_fixed_voltage_config = {
563 .supply_name = "HDMI_EN1",
564 .microvolts = 5000000,
565 .gpio = EXYNOS4_GPE0(1),
567 .init_data = &hdmi_fixed_voltage_init_data,
570 static struct platform_device hdmi_fixed_voltage = {
571 .name = "reg-fixed-voltage",
572 .id = FIXED_REG_ID_HDMI_5V,
574 .platform_data = &hdmi_fixed_voltage_config,
578 /* GPIO I2C 5 (PMIC) */
579 static struct i2c_board_info i2c5_devs[] __initdata = {
581 I2C_BOARD_INFO("max8952", 0xC0 >> 1),
582 .platform_data = &universal_max8952_pdata,
584 I2C_BOARD_INFO("lp3974", 0xCC >> 1),
585 .platform_data = &universal_lp3974_pdata,
590 static struct mxt_platform_data qt602240_platform_data = {
597 .voltage = 2800000, /* 2.8V */
598 .orient = MXT_DIAGONAL,
599 .irqflags = IRQF_TRIGGER_FALLING,
602 static struct i2c_board_info i2c3_devs[] __initdata = {
604 I2C_BOARD_INFO("qt602240_ts", 0x4a),
605 .platform_data = &qt602240_platform_data,
609 static void __init universal_tsp_init(void)
613 /* TSP_LDO_ON: XMDMADDR_11 */
614 gpio = EXYNOS4_GPE2(3);
615 gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON");
616 gpio_export(gpio, 0);
618 /* TSP_INT: XMDMADDR_7 */
619 gpio = EXYNOS4_GPE1(7);
620 gpio_request(gpio, "TSP_INT");
622 s5p_register_gpio_interrupt(gpio);
623 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
624 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
625 i2c3_devs[0].irq = gpio_to_irq(gpio);
629 /* GPIO I2C 12 (3 Touchkey) */
630 static uint32_t touchkey_keymap[] = {
631 /* MCS_KEY_MAP(value, keycode) */
632 MCS_KEY_MAP(0, KEY_MENU), /* KEY_SEND */
633 MCS_KEY_MAP(1, KEY_BACK), /* KEY_END */
636 static struct mcs_platform_data touchkey_data = {
637 .keymap = touchkey_keymap,
638 .keymap_size = ARRAY_SIZE(touchkey_keymap),
642 /* GPIO I2C 3_TOUCH 2.8V */
643 #define I2C_GPIO_BUS_12 12
644 static struct i2c_gpio_platform_data i2c_gpio12_data = {
645 .sda_pin = EXYNOS4_GPE4(0), /* XMDMDATA_8 */
646 .scl_pin = EXYNOS4_GPE4(1), /* XMDMDATA_9 */
649 static struct platform_device i2c_gpio12 = {
651 .id = I2C_GPIO_BUS_12,
653 .platform_data = &i2c_gpio12_data,
657 static struct i2c_board_info i2c_gpio12_devs[] __initdata = {
659 I2C_BOARD_INFO("mcs5080_touchkey", 0x20),
660 .platform_data = &touchkey_data,
664 static void __init universal_touchkey_init(void)
668 gpio = EXYNOS4_GPE3(7); /* XMDMDATA_7 */
669 gpio_request(gpio, "3_TOUCH_INT");
670 s5p_register_gpio_interrupt(gpio);
671 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
672 i2c_gpio12_devs[0].irq = gpio_to_irq(gpio);
674 gpio = EXYNOS4_GPE3(3); /* XMDMDATA_3 */
675 gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "3_TOUCH_EN");
678 static struct s3c2410_platform_i2c universal_i2c0_platdata __initdata = {
679 .frequency = 300 * 1000,
684 static struct gpio_keys_button universal_gpio_keys_tables[] = {
686 .code = KEY_VOLUMEUP,
687 .gpio = EXYNOS4_GPX2(0), /* XEINT16 */
688 .desc = "gpio-keys: KEY_VOLUMEUP",
691 .debounce_interval = 1,
693 .code = KEY_VOLUMEDOWN,
694 .gpio = EXYNOS4_GPX2(1), /* XEINT17 */
695 .desc = "gpio-keys: KEY_VOLUMEDOWN",
698 .debounce_interval = 1,
701 .gpio = EXYNOS4_GPX2(2), /* XEINT18 */
702 .desc = "gpio-keys: KEY_CONFIG",
705 .debounce_interval = 1,
708 .gpio = EXYNOS4_GPX2(3), /* XEINT19 */
709 .desc = "gpio-keys: KEY_CAMERA",
712 .debounce_interval = 1,
715 .gpio = EXYNOS4_GPX3(5), /* XEINT29 */
716 .desc = "gpio-keys: KEY_OK",
719 .debounce_interval = 1,
723 static struct gpio_keys_platform_data universal_gpio_keys_data = {
724 .buttons = universal_gpio_keys_tables,
725 .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables),
728 static struct platform_device universal_gpio_keys = {
731 .platform_data = &universal_gpio_keys_data,
736 static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
738 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
739 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
741 .cd_type = S3C_SDHCI_CD_PERMANENT,
742 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
745 static struct regulator_consumer_supply mmc0_supplies[] = {
746 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
749 static struct regulator_init_data mmc0_fixed_voltage_init_data = {
751 .name = "VMEM_VDD_2.8V",
752 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
754 .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies),
755 .consumer_supplies = mmc0_supplies,
758 static struct fixed_voltage_config mmc0_fixed_voltage_config = {
759 .supply_name = "MASSMEMORY_EN",
760 .microvolts = 2800000,
761 .gpio = EXYNOS4_GPE1(3),
763 .init_data = &mmc0_fixed_voltage_init_data,
766 static struct platform_device mmc0_fixed_voltage = {
767 .name = "reg-fixed-voltage",
768 .id = FIXED_REG_ID_MMC0,
770 .platform_data = &mmc0_fixed_voltage_config,
775 static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
777 .host_caps = MMC_CAP_4_BIT_DATA |
778 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
780 .ext_cd_gpio = EXYNOS4_GPX3(4), /* XEINT_28 */
781 .ext_cd_gpio_invert = 1,
782 .cd_type = S3C_SDHCI_CD_GPIO,
783 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
787 static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
789 .host_caps = MMC_CAP_4_BIT_DATA |
790 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
792 .cd_type = S3C_SDHCI_CD_EXTERNAL,
795 static void __init universal_sdhci_init(void)
797 s3c_sdhci0_set_platdata(&universal_hsmmc0_data);
798 s3c_sdhci2_set_platdata(&universal_hsmmc2_data);
799 s3c_sdhci3_set_platdata(&universal_hsmmc3_data);
803 static struct i2c_board_info i2c1_devs[] __initdata = {
804 /* Gyro, To be updated */
808 static struct s3c_fb_pd_win universal_fb_win0 = {
824 static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
825 .win[0] = &universal_fb_win0,
826 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
828 .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
829 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
830 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
833 static struct regulator_consumer_supply cam_i_core_supply =
834 REGULATOR_SUPPLY("core", "0-001f");
836 static struct regulator_init_data cam_i_core_reg_init_data = {
837 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
838 .num_consumer_supplies = 1,
839 .consumer_supplies = &cam_i_core_supply,
842 static struct fixed_voltage_config cam_i_core_fixed_voltage_cfg = {
843 .supply_name = "CAM_I_CORE_1.2V",
844 .microvolts = 1200000,
845 .gpio = EXYNOS4_GPE2(2), /* CAM_8M_CORE_EN */
847 .init_data = &cam_i_core_reg_init_data,
850 static struct platform_device cam_i_core_fixed_reg_dev = {
851 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_I_CORE,
852 .dev = { .platform_data = &cam_i_core_fixed_voltage_cfg },
855 static struct regulator_consumer_supply cam_s_if_supply =
856 REGULATOR_SUPPLY("d_sensor", "0-001f");
858 static struct regulator_init_data cam_s_if_reg_init_data = {
859 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
860 .num_consumer_supplies = 1,
861 .consumer_supplies = &cam_s_if_supply,
864 static struct fixed_voltage_config cam_s_if_fixed_voltage_cfg = {
865 .supply_name = "CAM_S_IF_1.8V",
866 .microvolts = 1800000,
867 .gpio = EXYNOS4_GPE3(0), /* CAM_PWR_EN1 */
869 .init_data = &cam_s_if_reg_init_data,
872 static struct platform_device cam_s_if_fixed_reg_dev = {
873 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_S_IF,
874 .dev = { .platform_data = &cam_s_if_fixed_voltage_cfg },
877 static struct s5p_platform_mipi_csis mipi_csis_platdata = {
878 .clk_rate = 166000000UL,
882 .phy_enable = s5p_csis_phy_enable,
885 #define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3)
886 #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */
887 #define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5)
889 static int m5mols_set_power(struct device *dev, int on)
891 gpio_set_value(GPIO_CAM_LEVEL_EN(1), !on);
892 gpio_set_value(GPIO_CAM_LEVEL_EN(2), !!on);
896 static struct m5mols_platform_data m5mols_platdata = {
897 .gpio_reset = GPIO_CAM_MEGA_nRST,
899 .set_power = m5mols_set_power,
902 static struct i2c_board_info m5mols_board_info = {
903 I2C_BOARD_INFO("M5MOLS", 0x1F),
904 .platform_data = &m5mols_platdata,
907 static struct s5p_fimc_isp_info universal_camera_sensors[] = {
910 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
911 V4L2_MBUS_VSYNC_ACTIVE_LOW,
912 .bus_type = FIMC_MIPI_CSI2,
913 .board_info = &m5mols_board_info,
915 .clk_frequency = 24000000UL,
916 .csi_data_align = 32,
920 static struct s5p_platform_fimc fimc_md_platdata = {
921 .isp_info = universal_camera_sensors,
922 .num_clients = ARRAY_SIZE(universal_camera_sensors),
925 static struct gpio universal_camera_gpios[] = {
926 { GPIO_CAM_LEVEL_EN(1), GPIOF_OUT_INIT_HIGH, "CAM_LVL_EN1" },
927 { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" },
928 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" },
929 { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" },
932 static void universal_camera_init(void)
934 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
935 &s5p_device_mipi_csis0);
936 s3c_set_platdata(&fimc_md_platdata, sizeof(fimc_md_platdata),
937 &s5p_device_fimc_md);
939 if (gpio_request_array(universal_camera_gpios,
940 ARRAY_SIZE(universal_camera_gpios))) {
941 pr_err("%s: GPIO request failed\n", __func__);
945 if (!s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xf)))
946 m5mols_board_info.irq = gpio_to_irq(GPIO_CAM_8M_ISP_INT);
948 pr_err("Failed to configure 8M_ISP_INT GPIO\n");
950 /* Free GPIOs controlled directly by the sensor drivers. */
951 gpio_free(GPIO_CAM_MEGA_nRST);
952 gpio_free(GPIO_CAM_8M_ISP_INT);
954 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A))
955 pr_err("Camera port A setup failed\n");
958 static struct platform_device *universal_devices[] __initdata = {
959 /* Samsung Platform Devices */
960 &s5p_device_mipi_csis0,
972 &s5p_device_i2c_hdmiphy,
978 /* Universal Devices */
980 &universal_gpio_keys,
986 &cam_i_core_fixed_reg_dev,
987 &cam_s_if_fixed_reg_dev,
991 static void __init universal_map_io(void)
993 exynos_init_io(NULL, 0);
994 s3c24xx_init_clocks(24000000);
995 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
998 void s5p_tv_setup(void)
1000 /* direct HPD to HDMI chip */
1001 gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug");
1002 s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3));
1003 s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE);
1006 static void __init universal_reserve(void)
1008 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
1011 static void __init universal_machine_init(void)
1013 universal_sdhci_init();
1016 s3c_i2c0_set_platdata(&universal_i2c0_platdata);
1017 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
1019 universal_tsp_init();
1020 s3c_i2c3_set_platdata(NULL);
1021 i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
1023 s3c_i2c5_set_platdata(NULL);
1024 s5p_i2c_hdmiphy_set_platdata(NULL);
1025 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
1027 s5p_fimd0_set_platdata(&universal_lcd_pdata);
1029 universal_touchkey_init();
1030 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
1031 ARRAY_SIZE(i2c_gpio12_devs));
1033 universal_camera_init();
1036 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
1039 MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1040 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
1041 .atag_offset = 0x100,
1042 .init_irq = exynos4_init_irq,
1043 .map_io = universal_map_io,
1044 .handle_irq = gic_handle_irq,
1045 .init_machine = universal_machine_init,
1046 .timer = &exynos4_timer,
1047 .reserve = &universal_reserve,
1048 .restart = exynos4_restart,