diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-01-30 23:26:58 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-01-30 23:26:58 -0500 |
commit | 9c01c96caaea89088b9c461a0013ed770b586fbd (patch) | |
tree | 8acee52769ac6dc5f04a8b168814c7667dadc6b7 /arch | |
parent | bcd7bd377393cccf58a2cf010bc8227fc7df1413 (diff) |
ARM: EXYNOS: Add support for S5K6AAFX image sensor on Universal C210 board
Add voltage regulator and platform data definitions for S5K6AAFX
image sensor driver.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos/mach-universal_c210.c | 74 |
1 files changed, 70 insertions, 4 deletions
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 0e01f047be5e..44fc43e06a6a 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <media/v4l2-mediabus.h> | 46 | #include <media/v4l2-mediabus.h> |
47 | #include <media/s5p_fimc.h> | 47 | #include <media/s5p_fimc.h> |
48 | #include <media/m5mols.h> | 48 | #include <media/m5mols.h> |
49 | #include <media/s5k6aa.h> | ||
49 | 50 | ||
50 | #include "common.h" | 51 | #include "common.h" |
51 | 52 | ||
@@ -122,8 +123,10 @@ static struct regulator_consumer_supply lp3974_buck1_consumer = | |||
122 | static struct regulator_consumer_supply lp3974_buck2_consumer = | 123 | static struct regulator_consumer_supply lp3974_buck2_consumer = |
123 | REGULATOR_SUPPLY("vddg3d", NULL); | 124 | REGULATOR_SUPPLY("vddg3d", NULL); |
124 | 125 | ||
125 | static struct regulator_consumer_supply lp3974_buck3_consumer = | 126 | static struct regulator_consumer_supply lp3974_buck3_consumer[] = { |
126 | REGULATOR_SUPPLY("vdet", "s5p-sdo"); | 127 | REGULATOR_SUPPLY("vdet", "s5p-sdo"), |
128 | REGULATOR_SUPPLY("vdd_reg", "0-003c"), | ||
129 | }; | ||
127 | 130 | ||
128 | static struct regulator_init_data lp3974_buck1_data = { | 131 | static struct regulator_init_data lp3974_buck1_data = { |
129 | .constraints = { | 132 | .constraints = { |
@@ -168,8 +171,8 @@ static struct regulator_init_data lp3974_buck3_data = { | |||
168 | .enabled = 1, | 171 | .enabled = 1, |
169 | }, | 172 | }, |
170 | }, | 173 | }, |
171 | .num_consumer_supplies = 1, | 174 | .num_consumer_supplies = ARRAY_SIZE(lp3974_buck3_consumer), |
172 | .consumer_supplies = &lp3974_buck3_consumer, | 175 | .consumer_supplies = lp3974_buck3_consumer, |
173 | }; | 176 | }; |
174 | 177 | ||
175 | static struct regulator_init_data lp3974_buck4_data = { | 178 | static struct regulator_init_data lp3974_buck4_data = { |
@@ -302,6 +305,9 @@ static struct regulator_init_data lp3974_ldo8_data = { | |||
302 | .consumer_supplies = lp3974_ldo8_consumer, | 305 | .consumer_supplies = lp3974_ldo8_consumer, |
303 | }; | 306 | }; |
304 | 307 | ||
308 | static struct regulator_consumer_supply lp3974_ldo9_consumer = | ||
309 | REGULATOR_SUPPLY("vddio", "0-003c"); | ||
310 | |||
305 | static struct regulator_init_data lp3974_ldo9_data = { | 311 | static struct regulator_init_data lp3974_ldo9_data = { |
306 | .constraints = { | 312 | .constraints = { |
307 | .name = "VCC_2.8V", | 313 | .name = "VCC_2.8V", |
@@ -313,6 +319,8 @@ static struct regulator_init_data lp3974_ldo9_data = { | |||
313 | .enabled = 1, | 319 | .enabled = 1, |
314 | }, | 320 | }, |
315 | }, | 321 | }, |
322 | .num_consumer_supplies = 1, | ||
323 | .consumer_supplies = &lp3974_ldo9_consumer, | ||
316 | }; | 324 | }; |
317 | 325 | ||
318 | static struct regulator_init_data lp3974_ldo10_data = { | 326 | static struct regulator_init_data lp3974_ldo10_data = { |
@@ -411,6 +419,7 @@ static struct regulator_init_data lp3974_ldo15_data = { | |||
411 | }; | 419 | }; |
412 | 420 | ||
413 | static struct regulator_consumer_supply lp3974_ldo16_consumer[] = { | 421 | static struct regulator_consumer_supply lp3974_ldo16_consumer[] = { |
422 | REGULATOR_SUPPLY("vdda", "0-003c"), | ||
414 | REGULATOR_SUPPLY("a_sensor", "0-001f"), | 423 | REGULATOR_SUPPLY("a_sensor", "0-001f"), |
415 | }; | 424 | }; |
416 | 425 | ||
@@ -830,6 +839,28 @@ static struct s3c_fb_platdata universal_lcd_pdata __initdata = { | |||
830 | .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, | 839 | .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, |
831 | }; | 840 | }; |
832 | 841 | ||
842 | static struct regulator_consumer_supply cam_vt_dio_supply = | ||
843 | REGULATOR_SUPPLY("vdd_core", "0-003c"); | ||
844 | |||
845 | static struct regulator_init_data cam_vt_dio_reg_init_data = { | ||
846 | .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS }, | ||
847 | .num_consumer_supplies = 1, | ||
848 | .consumer_supplies = &cam_vt_dio_supply, | ||
849 | }; | ||
850 | |||
851 | static struct fixed_voltage_config cam_vt_dio_fixed_voltage_cfg = { | ||
852 | .supply_name = "CAM_VT_D_IO", | ||
853 | .microvolts = 2800000, | ||
854 | .gpio = EXYNOS4_GPE2(1), /* CAM_PWR_EN2 */ | ||
855 | .enable_high = 1, | ||
856 | .init_data = &cam_vt_dio_reg_init_data, | ||
857 | }; | ||
858 | |||
859 | static struct platform_device cam_vt_dio_fixed_reg_dev = { | ||
860 | .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_VT_DIO, | ||
861 | .dev = { .platform_data = &cam_vt_dio_fixed_voltage_cfg }, | ||
862 | }; | ||
863 | |||
833 | static struct regulator_consumer_supply cam_i_core_supply = | 864 | static struct regulator_consumer_supply cam_i_core_supply = |
834 | REGULATOR_SUPPLY("core", "0-001f"); | 865 | REGULATOR_SUPPLY("core", "0-001f"); |
835 | 866 | ||
@@ -885,6 +916,28 @@ static struct s5p_platform_mipi_csis mipi_csis_platdata = { | |||
885 | #define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3) | 916 | #define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3) |
886 | #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */ | 917 | #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */ |
887 | #define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5) | 918 | #define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5) |
919 | #define GPIO_CAM_VGA_NRST EXYNOS4_GPE4(7) | ||
920 | #define GPIO_CAM_VGA_NSTBY EXYNOS4_GPE4(6) | ||
921 | |||
922 | static int s5k6aa_set_power(int on) | ||
923 | { | ||
924 | gpio_set_value(GPIO_CAM_LEVEL_EN(2), !!on); | ||
925 | return 0; | ||
926 | } | ||
927 | |||
928 | static struct s5k6aa_platform_data s5k6aa_platdata = { | ||
929 | .mclk_frequency = 21600000UL, | ||
930 | .gpio_reset = { GPIO_CAM_VGA_NRST, 0 }, | ||
931 | .gpio_stby = { GPIO_CAM_VGA_NSTBY, 0 }, | ||
932 | .bus_type = V4L2_MBUS_PARALLEL, | ||
933 | .horiz_flip = 1, | ||
934 | .set_power = s5k6aa_set_power, | ||
935 | }; | ||
936 | |||
937 | static struct i2c_board_info s5k6aa_board_info = { | ||
938 | I2C_BOARD_INFO("S5K6AA", 0x3C), | ||
939 | .platform_data = &s5k6aa_platdata, | ||
940 | }; | ||
888 | 941 | ||
889 | static int m5mols_set_power(struct device *dev, int on) | 942 | static int m5mols_set_power(struct device *dev, int on) |
890 | { | 943 | { |
@@ -909,6 +962,14 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = { | |||
909 | .mux_id = 0, | 962 | .mux_id = 0, |
910 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | | 963 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | |
911 | V4L2_MBUS_VSYNC_ACTIVE_LOW, | 964 | V4L2_MBUS_VSYNC_ACTIVE_LOW, |
965 | .bus_type = FIMC_ITU_601, | ||
966 | .board_info = &s5k6aa_board_info, | ||
967 | .i2c_bus_num = 0, | ||
968 | .clk_frequency = 24000000UL, | ||
969 | }, { | ||
970 | .mux_id = 0, | ||
971 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | | ||
972 | V4L2_MBUS_VSYNC_ACTIVE_LOW, | ||
912 | .bus_type = FIMC_MIPI_CSI2, | 973 | .bus_type = FIMC_MIPI_CSI2, |
913 | .board_info = &m5mols_board_info, | 974 | .board_info = &m5mols_board_info, |
914 | .i2c_bus_num = 0, | 975 | .i2c_bus_num = 0, |
@@ -927,6 +988,8 @@ static struct gpio universal_camera_gpios[] = { | |||
927 | { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" }, | 988 | { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" }, |
928 | { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, | 989 | { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, |
929 | { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, | 990 | { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, |
991 | { GPIO_CAM_VGA_NRST, GPIOF_OUT_INIT_LOW, "CAM_VGA_NRST" }, | ||
992 | { GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" }, | ||
930 | }; | 993 | }; |
931 | 994 | ||
932 | static void universal_camera_init(void) | 995 | static void universal_camera_init(void) |
@@ -950,6 +1013,8 @@ static void universal_camera_init(void) | |||
950 | /* Free GPIOs controlled directly by the sensor drivers. */ | 1013 | /* Free GPIOs controlled directly by the sensor drivers. */ |
951 | gpio_free(GPIO_CAM_MEGA_nRST); | 1014 | gpio_free(GPIO_CAM_MEGA_nRST); |
952 | gpio_free(GPIO_CAM_8M_ISP_INT); | 1015 | gpio_free(GPIO_CAM_8M_ISP_INT); |
1016 | gpio_free(GPIO_CAM_VGA_NRST); | ||
1017 | gpio_free(GPIO_CAM_VGA_NSTBY); | ||
953 | 1018 | ||
954 | if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) | 1019 | if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) |
955 | pr_err("Camera port A setup failed\n"); | 1020 | pr_err("Camera port A setup failed\n"); |
@@ -988,6 +1053,7 @@ static struct platform_device *universal_devices[] __initdata = { | |||
988 | &exynos4_device_pd[PD_MFC], | 1053 | &exynos4_device_pd[PD_MFC], |
989 | &exynos4_device_pd[PD_LCD0], | 1054 | &exynos4_device_pd[PD_LCD0], |
990 | &exynos4_device_pd[PD_CAM], | 1055 | &exynos4_device_pd[PD_CAM], |
1056 | &cam_vt_dio_fixed_reg_dev, | ||
991 | &cam_i_core_fixed_reg_dev, | 1057 | &cam_i_core_fixed_reg_dev, |
992 | &cam_s_if_fixed_reg_dev, | 1058 | &cam_s_if_fixed_reg_dev, |
993 | &s5p_device_fimc_md, | 1059 | &s5p_device_fimc_md, |