diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-01-30 23:27:02 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-01-30 23:27:02 -0500 |
commit | 8f114e6eb1c3bb1ed6cd4904a8925a6d75a0a21e (patch) | |
tree | 75dd6f201ce5d945f76d2450d02553ceb7530fb8 /arch/arm/mach-exynos/mach-nuri.c | |
parent | 9c01c96caaea89088b9c461a0013ed770b586fbd (diff) |
ARM: SAMSUNG: Add support for S5K6AAFX camera on Nuri board
Add voltage regulator and platform data definitions for S5K6AAFX
sensor driver and configure I2C6 bus timings.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: HeungJun Kim <riverful.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos/mach-nuri.c')
-rw-r--r-- | arch/arm/mach-exynos/mach-nuri.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 165c87638895..cc8d2f6bab2b 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <video/platform_lcd.h> | 29 | #include <video/platform_lcd.h> |
30 | #include <media/m5mols.h> | 30 | #include <media/m5mols.h> |
31 | #include <media/s5k6aa.h> | ||
31 | #include <media/s5p_fimc.h> | 32 | #include <media/s5p_fimc.h> |
32 | #include <media/v4l2-mediabus.h> | 33 | #include <media/v4l2-mediabus.h> |
33 | 34 | ||
@@ -75,6 +76,7 @@ enum fixed_regulator_id { | |||
75 | FIXED_REG_ID_MAX8903, | 76 | FIXED_REG_ID_MAX8903, |
76 | FIXED_REG_ID_CAM_A28V, | 77 | FIXED_REG_ID_CAM_A28V, |
77 | FIXED_REG_ID_CAM_12V, | 78 | FIXED_REG_ID_CAM_12V, |
79 | FIXED_REG_ID_CAM_VT_15V, | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { | 82 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { |
@@ -399,6 +401,9 @@ static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { | |||
399 | static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { | 401 | static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { |
400 | REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */ | 402 | REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */ |
401 | }; | 403 | }; |
404 | static struct regulator_consumer_supply nuri_max8997_ldo6_consumer[] = { | ||
405 | REGULATOR_SUPPLY("vdd_reg", "6-003c"), /* S5K6AA camera */ | ||
406 | }; | ||
402 | static struct regulator_consumer_supply __initdata max8997_ldo7_[] = { | 407 | static struct regulator_consumer_supply __initdata max8997_ldo7_[] = { |
403 | REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ | 408 | REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ |
404 | }; | 409 | }; |
@@ -546,6 +551,8 @@ static struct regulator_init_data __initdata max8997_ldo6_data = { | |||
546 | .enabled = 1, | 551 | .enabled = 1, |
547 | }, | 552 | }, |
548 | }, | 553 | }, |
554 | .num_consumer_supplies = ARRAY_SIZE(nuri_max8997_ldo6_consumer), | ||
555 | .consumer_supplies = nuri_max8997_ldo6_consumer, | ||
549 | }; | 556 | }; |
550 | 557 | ||
551 | static struct regulator_init_data __initdata max8997_ldo7_data = { | 558 | static struct regulator_init_data __initdata max8997_ldo7_data = { |
@@ -1116,7 +1123,30 @@ static void __init nuri_ehci_init(void) | |||
1116 | } | 1123 | } |
1117 | 1124 | ||
1118 | /* CAMERA */ | 1125 | /* CAMERA */ |
1126 | static struct regulator_consumer_supply cam_vt_cam15_supply = | ||
1127 | REGULATOR_SUPPLY("vdd_core", "6-003c"); | ||
1128 | |||
1129 | static struct regulator_init_data cam_vt_cam15_reg_init_data = { | ||
1130 | .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS }, | ||
1131 | .num_consumer_supplies = 1, | ||
1132 | .consumer_supplies = &cam_vt_cam15_supply, | ||
1133 | }; | ||
1134 | |||
1135 | static struct fixed_voltage_config cam_vt_cam15_fixed_voltage_cfg = { | ||
1136 | .supply_name = "VT_CAM_1.5V", | ||
1137 | .microvolts = 1500000, | ||
1138 | .gpio = EXYNOS4_GPE2(2), /* VT_CAM_1.5V_EN */ | ||
1139 | .enable_high = 1, | ||
1140 | .init_data = &cam_vt_cam15_reg_init_data, | ||
1141 | }; | ||
1142 | |||
1143 | static struct platform_device cam_vt_cam15_fixed_rdev = { | ||
1144 | .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_VT_15V, | ||
1145 | .dev = { .platform_data = &cam_vt_cam15_fixed_voltage_cfg }, | ||
1146 | }; | ||
1147 | |||
1119 | static struct regulator_consumer_supply cam_vdda_supply[] = { | 1148 | static struct regulator_consumer_supply cam_vdda_supply[] = { |
1149 | REGULATOR_SUPPLY("vdda", "6-003c"), | ||
1120 | REGULATOR_SUPPLY("a_sensor", "0-001f"), | 1150 | REGULATOR_SUPPLY("a_sensor", "0-001f"), |
1121 | }; | 1151 | }; |
1122 | 1152 | ||
@@ -1173,6 +1203,21 @@ static struct s5p_platform_mipi_csis mipi_csis_platdata = { | |||
1173 | 1203 | ||
1174 | #define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ | 1204 | #define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ |
1175 | #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPL2(5) | 1205 | #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPL2(5) |
1206 | #define GPIO_CAM_VT_NSTBY EXYNOS4_GPL2(0) | ||
1207 | #define GPIO_CAM_VT_NRST EXYNOS4_GPL2(1) | ||
1208 | |||
1209 | static struct s5k6aa_platform_data s5k6aa_pldata = { | ||
1210 | .mclk_frequency = 24000000UL, | ||
1211 | .gpio_reset = { GPIO_CAM_VT_NRST, 0 }, | ||
1212 | .gpio_stby = { GPIO_CAM_VT_NSTBY, 0 }, | ||
1213 | .bus_type = V4L2_MBUS_PARALLEL, | ||
1214 | .horiz_flip = 1, | ||
1215 | }; | ||
1216 | |||
1217 | static struct i2c_board_info s5k6aa_board_info = { | ||
1218 | I2C_BOARD_INFO("S5K6AA", 0x3c), | ||
1219 | .platform_data = &s5k6aa_pldata, | ||
1220 | }; | ||
1176 | 1221 | ||
1177 | static struct m5mols_platform_data m5mols_platdata = { | 1222 | static struct m5mols_platform_data m5mols_platdata = { |
1178 | .gpio_reset = GPIO_CAM_MEGA_RST, | 1223 | .gpio_reset = GPIO_CAM_MEGA_RST, |
@@ -1185,6 +1230,13 @@ static struct i2c_board_info m5mols_board_info = { | |||
1185 | 1230 | ||
1186 | static struct s5p_fimc_isp_info nuri_camera_sensors[] = { | 1231 | static struct s5p_fimc_isp_info nuri_camera_sensors[] = { |
1187 | { | 1232 | { |
1233 | .flags = V4L2_MBUS_PCLK_SAMPLE_RISING | | ||
1234 | V4L2_MBUS_VSYNC_ACTIVE_LOW, | ||
1235 | .bus_type = FIMC_ITU_601, | ||
1236 | .board_info = &s5k6aa_board_info, | ||
1237 | .clk_frequency = 24000000UL, | ||
1238 | .i2c_bus_num = 6, | ||
1239 | }, { | ||
1188 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | | 1240 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | |
1189 | V4L2_MBUS_VSYNC_ACTIVE_LOW, | 1241 | V4L2_MBUS_VSYNC_ACTIVE_LOW, |
1190 | .bus_type = FIMC_MIPI_CSI2, | 1242 | .bus_type = FIMC_MIPI_CSI2, |
@@ -1200,6 +1252,8 @@ static struct s5p_platform_fimc fimc_md_platdata = { | |||
1200 | }; | 1252 | }; |
1201 | 1253 | ||
1202 | static struct gpio nuri_camera_gpios[] = { | 1254 | static struct gpio nuri_camera_gpios[] = { |
1255 | { GPIO_CAM_VT_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" }, | ||
1256 | { GPIO_CAM_VT_NRST, GPIOF_OUT_INIT_LOW, "CAM_VGA_NRST" }, | ||
1203 | { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, | 1257 | { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, |
1204 | { GPIO_CAM_MEGA_RST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, | 1258 | { GPIO_CAM_MEGA_RST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, |
1205 | }; | 1259 | }; |
@@ -1224,6 +1278,8 @@ static void nuri_camera_init(void) | |||
1224 | pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__); | 1278 | pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__); |
1225 | 1279 | ||
1226 | /* Free GPIOs controlled directly by the sensor drivers. */ | 1280 | /* Free GPIOs controlled directly by the sensor drivers. */ |
1281 | gpio_free(GPIO_CAM_VT_NRST); | ||
1282 | gpio_free(GPIO_CAM_VT_NSTBY); | ||
1227 | gpio_free(GPIO_CAM_MEGA_RST); | 1283 | gpio_free(GPIO_CAM_MEGA_RST); |
1228 | 1284 | ||
1229 | if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) { | 1285 | if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) { |
@@ -1234,6 +1290,12 @@ static void nuri_camera_init(void) | |||
1234 | s5p_gpio_set_drvstr(EXYNOS4_GPJ1(3), S5P_GPIO_DRVSTR_LV4); | 1290 | s5p_gpio_set_drvstr(EXYNOS4_GPJ1(3), S5P_GPIO_DRVSTR_LV4); |
1235 | } | 1291 | } |
1236 | 1292 | ||
1293 | static struct s3c2410_platform_i2c nuri_i2c6_platdata __initdata = { | ||
1294 | .frequency = 400000U, | ||
1295 | .sda_delay = 200, | ||
1296 | .bus_num = 6, | ||
1297 | }; | ||
1298 | |||
1237 | static struct s3c2410_platform_i2c nuri_i2c0_platdata __initdata = { | 1299 | static struct s3c2410_platform_i2c nuri_i2c0_platdata __initdata = { |
1238 | .frequency = 400000U, | 1300 | .frequency = 400000U, |
1239 | .sda_delay = 200, | 1301 | .sda_delay = 200, |
@@ -1243,6 +1305,7 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
1243 | /* Samsung Platform Devices */ | 1305 | /* Samsung Platform Devices */ |
1244 | &s3c_device_i2c5, /* PMIC should initialize first */ | 1306 | &s3c_device_i2c5, /* PMIC should initialize first */ |
1245 | &s3c_device_i2c0, | 1307 | &s3c_device_i2c0, |
1308 | &s3c_device_i2c6, | ||
1246 | &emmc_fixed_voltage, | 1309 | &emmc_fixed_voltage, |
1247 | &s5p_device_mipi_csis0, | 1310 | &s5p_device_mipi_csis0, |
1248 | &s5p_device_fimc0, | 1311 | &s5p_device_fimc0, |
@@ -1275,6 +1338,7 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
1275 | &nuri_backlight_device, | 1338 | &nuri_backlight_device, |
1276 | &max8903_fixed_reg_dev, | 1339 | &max8903_fixed_reg_dev, |
1277 | &nuri_max8903_device, | 1340 | &nuri_max8903_device, |
1341 | &cam_vt_cam15_fixed_rdev, | ||
1278 | &cam_vdda_fixed_rdev, | 1342 | &cam_vdda_fixed_rdev, |
1279 | &cam_8m_12v_fixed_rdev, | 1343 | &cam_8m_12v_fixed_rdev, |
1280 | }; | 1344 | }; |
@@ -1306,6 +1370,7 @@ static void __init nuri_machine_init(void) | |||
1306 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 1370 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
1307 | i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); | 1371 | i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); |
1308 | i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); | 1372 | i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); |
1373 | s3c_i2c6_set_platdata(&nuri_i2c6_platdata); | ||
1309 | 1374 | ||
1310 | s5p_fimd0_set_platdata(&nuri_fb_pdata); | 1375 | s5p_fimd0_set_platdata(&nuri_fb_pdata); |
1311 | 1376 | ||