diff options
Diffstat (limited to 'arch/arm/mach-exynos4/mach-nuri.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-nuri.c | 158 |
1 files changed, 151 insertions, 7 deletions
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index 2204911a24e9..236bbe187163 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <linux/pwm_backlight.h> | 27 | #include <linux/pwm_backlight.h> |
28 | 28 | ||
29 | #include <video/platform_lcd.h> | 29 | #include <video/platform_lcd.h> |
30 | #include <media/m5mols.h> | ||
31 | #include <media/s5p_fimc.h> | ||
32 | #include <media/v4l2-mediabus.h> | ||
30 | 33 | ||
31 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
32 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
@@ -45,6 +48,9 @@ | |||
45 | #include <plat/iic.h> | 48 | #include <plat/iic.h> |
46 | #include <plat/mfc.h> | 49 | #include <plat/mfc.h> |
47 | #include <plat/pd.h> | 50 | #include <plat/pd.h> |
51 | #include <plat/fimc-core.h> | ||
52 | #include <plat/camport.h> | ||
53 | #include <plat/mipi_csis.h> | ||
48 | 54 | ||
49 | #include <mach/map.h> | 55 | #include <mach/map.h> |
50 | 56 | ||
@@ -65,6 +71,8 @@ | |||
65 | enum fixed_regulator_id { | 71 | enum fixed_regulator_id { |
66 | FIXED_REG_ID_MMC = 0, | 72 | FIXED_REG_ID_MMC = 0, |
67 | FIXED_REG_ID_MAX8903, | 73 | FIXED_REG_ID_MAX8903, |
74 | FIXED_REG_ID_CAM_A28V, | ||
75 | FIXED_REG_ID_CAM_12V, | ||
68 | }; | 76 | }; |
69 | 77 | ||
70 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { | 78 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { |
@@ -1066,13 +1074,6 @@ static struct platform_device nuri_max8903_device = { | |||
1066 | }, | 1074 | }, |
1067 | }; | 1075 | }; |
1068 | 1076 | ||
1069 | static struct device *nuri_cm_devices[] = { | ||
1070 | &s3c_device_i2c5.dev, | ||
1071 | &s3c_device_adc.dev, | ||
1072 | NULL, /* Reserved for UART */ | ||
1073 | NULL, | ||
1074 | }; | ||
1075 | |||
1076 | static void __init nuri_power_init(void) | 1077 | static void __init nuri_power_init(void) |
1077 | { | 1078 | { |
1078 | int gpio; | 1079 | int gpio; |
@@ -1117,10 +1118,140 @@ static void __init nuri_ehci_init(void) | |||
1117 | s5p_ehci_set_platdata(pdata); | 1118 | s5p_ehci_set_platdata(pdata); |
1118 | } | 1119 | } |
1119 | 1120 | ||
1121 | /* CAMERA */ | ||
1122 | static struct regulator_consumer_supply cam_vdda_supply[] = { | ||
1123 | REGULATOR_SUPPLY("a_sensor", "0-001f"), | ||
1124 | }; | ||
1125 | |||
1126 | static struct regulator_init_data cam_vdda_reg_init_data = { | ||
1127 | .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS }, | ||
1128 | .num_consumer_supplies = ARRAY_SIZE(cam_vdda_supply), | ||
1129 | .consumer_supplies = cam_vdda_supply, | ||
1130 | }; | ||
1131 | |||
1132 | static struct fixed_voltage_config cam_vdda_fixed_voltage_cfg = { | ||
1133 | .supply_name = "CAM_IO_EN", | ||
1134 | .microvolts = 2800000, | ||
1135 | .gpio = EXYNOS4_GPE2(1), /* CAM_IO_EN */ | ||
1136 | .enable_high = 1, | ||
1137 | .init_data = &cam_vdda_reg_init_data, | ||
1138 | }; | ||
1139 | |||
1140 | static struct platform_device cam_vdda_fixed_rdev = { | ||
1141 | .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_A28V, | ||
1142 | .dev = { .platform_data = &cam_vdda_fixed_voltage_cfg }, | ||
1143 | }; | ||
1144 | |||
1145 | static struct regulator_consumer_supply camera_8m_12v_supply = | ||
1146 | REGULATOR_SUPPLY("dig_12", "0-001f"); | ||
1147 | |||
1148 | static struct regulator_init_data cam_8m_12v_reg_init_data = { | ||
1149 | .num_consumer_supplies = 1, | ||
1150 | .consumer_supplies = &camera_8m_12v_supply, | ||
1151 | .constraints = { | ||
1152 | .valid_ops_mask = REGULATOR_CHANGE_STATUS | ||
1153 | }, | ||
1154 | }; | ||
1155 | |||
1156 | static struct fixed_voltage_config cam_8m_12v_fixed_voltage_cfg = { | ||
1157 | .supply_name = "8M_1.2V", | ||
1158 | .microvolts = 1200000, | ||
1159 | .gpio = EXYNOS4_GPE2(5), /* 8M_1.2V_EN */ | ||
1160 | .enable_high = 1, | ||
1161 | .init_data = &cam_8m_12v_reg_init_data, | ||
1162 | }; | ||
1163 | |||
1164 | static struct platform_device cam_8m_12v_fixed_rdev = { | ||
1165 | .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_12V, | ||
1166 | .dev = { .platform_data = &cam_8m_12v_fixed_voltage_cfg }, | ||
1167 | }; | ||
1168 | |||
1169 | static struct s5p_platform_mipi_csis mipi_csis_platdata = { | ||
1170 | .clk_rate = 166000000UL, | ||
1171 | .lanes = 2, | ||
1172 | .alignment = 32, | ||
1173 | .hs_settle = 12, | ||
1174 | .phy_enable = s5p_csis_phy_enable, | ||
1175 | }; | ||
1176 | |||
1177 | #define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ | ||
1178 | #define GPIO_CAM_8M_ISP_INT EXYNOS4_GPL2(5) | ||
1179 | |||
1180 | static struct m5mols_platform_data m5mols_platdata = { | ||
1181 | .gpio_reset = GPIO_CAM_MEGA_RST, | ||
1182 | }; | ||
1183 | |||
1184 | static struct i2c_board_info m5mols_board_info = { | ||
1185 | I2C_BOARD_INFO("M5MOLS", 0x1F), | ||
1186 | .platform_data = &m5mols_platdata, | ||
1187 | }; | ||
1188 | |||
1189 | static struct s5p_fimc_isp_info nuri_camera_sensors[] = { | ||
1190 | { | ||
1191 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | | ||
1192 | V4L2_MBUS_VSYNC_ACTIVE_LOW, | ||
1193 | .bus_type = FIMC_MIPI_CSI2, | ||
1194 | .board_info = &m5mols_board_info, | ||
1195 | .clk_frequency = 24000000UL, | ||
1196 | .csi_data_align = 32, | ||
1197 | }, | ||
1198 | }; | ||
1199 | |||
1200 | static struct s5p_platform_fimc fimc_md_platdata = { | ||
1201 | .isp_info = nuri_camera_sensors, | ||
1202 | .num_clients = ARRAY_SIZE(nuri_camera_sensors), | ||
1203 | }; | ||
1204 | |||
1205 | static struct gpio nuri_camera_gpios[] = { | ||
1206 | { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, | ||
1207 | { GPIO_CAM_MEGA_RST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, | ||
1208 | }; | ||
1209 | |||
1210 | static void nuri_camera_init(void) | ||
1211 | { | ||
1212 | s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata), | ||
1213 | &s5p_device_mipi_csis0); | ||
1214 | s3c_set_platdata(&fimc_md_platdata, sizeof(fimc_md_platdata), | ||
1215 | &s5p_device_fimc_md); | ||
1216 | |||
1217 | if (gpio_request_array(nuri_camera_gpios, | ||
1218 | ARRAY_SIZE(nuri_camera_gpios))) { | ||
1219 | pr_err("%s: GPIO request failed\n", __func__); | ||
1220 | return; | ||
1221 | } | ||
1222 | |||
1223 | m5mols_board_info.irq = s5p_register_gpio_interrupt(GPIO_CAM_8M_ISP_INT); | ||
1224 | if (!IS_ERR_VALUE(m5mols_board_info.irq)) | ||
1225 | s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xF)); | ||
1226 | else | ||
1227 | pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__); | ||
1228 | |||
1229 | /* Free GPIOs controlled directly by the sensor drivers. */ | ||
1230 | gpio_free(GPIO_CAM_MEGA_RST); | ||
1231 | |||
1232 | if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) { | ||
1233 | pr_err("%s: Camera port A setup failed\n", __func__); | ||
1234 | return; | ||
1235 | } | ||
1236 | /* Increase drive strength of the sensor clock output */ | ||
1237 | s5p_gpio_set_drvstr(EXYNOS4_GPJ1(3), S5P_GPIO_DRVSTR_LV4); | ||
1238 | } | ||
1239 | |||
1240 | static struct s3c2410_platform_i2c nuri_i2c0_platdata __initdata = { | ||
1241 | .frequency = 400000U, | ||
1242 | .sda_delay = 200, | ||
1243 | }; | ||
1244 | |||
1120 | static struct platform_device *nuri_devices[] __initdata = { | 1245 | static struct platform_device *nuri_devices[] __initdata = { |
1121 | /* Samsung Platform Devices */ | 1246 | /* Samsung Platform Devices */ |
1122 | &s3c_device_i2c5, /* PMIC should initialize first */ | 1247 | &s3c_device_i2c5, /* PMIC should initialize first */ |
1248 | &s3c_device_i2c0, | ||
1123 | &emmc_fixed_voltage, | 1249 | &emmc_fixed_voltage, |
1250 | &s5p_device_mipi_csis0, | ||
1251 | &s5p_device_fimc0, | ||
1252 | &s5p_device_fimc1, | ||
1253 | &s5p_device_fimc2, | ||
1254 | &s5p_device_fimc3, | ||
1124 | &s5p_device_fimd0, | 1255 | &s5p_device_fimd0, |
1125 | &s3c_device_hsmmc0, | 1256 | &s3c_device_hsmmc0, |
1126 | &s3c_device_hsmmc2, | 1257 | &s3c_device_hsmmc2, |
@@ -1137,6 +1268,8 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
1137 | &s5p_device_mfc_r, | 1268 | &s5p_device_mfc_r, |
1138 | &exynos4_device_pd[PD_MFC], | 1269 | &exynos4_device_pd[PD_MFC], |
1139 | &exynos4_device_pd[PD_LCD0], | 1270 | &exynos4_device_pd[PD_LCD0], |
1271 | &exynos4_device_pd[PD_CAM], | ||
1272 | &s5p_device_fimc_md, | ||
1140 | 1273 | ||
1141 | /* NURI Devices */ | 1274 | /* NURI Devices */ |
1142 | &nuri_gpio_keys, | 1275 | &nuri_gpio_keys, |
@@ -1144,6 +1277,8 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
1144 | &nuri_backlight_device, | 1277 | &nuri_backlight_device, |
1145 | &max8903_fixed_reg_dev, | 1278 | &max8903_fixed_reg_dev, |
1146 | &nuri_max8903_device, | 1279 | &nuri_max8903_device, |
1280 | &cam_vdda_fixed_rdev, | ||
1281 | &cam_8m_12v_fixed_rdev, | ||
1147 | }; | 1282 | }; |
1148 | 1283 | ||
1149 | static void __init nuri_map_io(void) | 1284 | static void __init nuri_map_io(void) |
@@ -1164,6 +1299,7 @@ static void __init nuri_machine_init(void) | |||
1164 | nuri_tsp_init(); | 1299 | nuri_tsp_init(); |
1165 | nuri_power_init(); | 1300 | nuri_power_init(); |
1166 | 1301 | ||
1302 | s3c_i2c0_set_platdata(&nuri_i2c0_platdata); | ||
1167 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 1303 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
1168 | s3c_i2c3_set_platdata(&i2c3_data); | 1304 | s3c_i2c3_set_platdata(&i2c3_data); |
1169 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); | 1305 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); |
@@ -1175,6 +1311,8 @@ static void __init nuri_machine_init(void) | |||
1175 | 1311 | ||
1176 | s5p_fimd0_set_platdata(&nuri_fb_pdata); | 1312 | s5p_fimd0_set_platdata(&nuri_fb_pdata); |
1177 | 1313 | ||
1314 | nuri_camera_init(); | ||
1315 | |||
1178 | nuri_ehci_init(); | 1316 | nuri_ehci_init(); |
1179 | clk_xusbxti.rate = 24000000; | 1317 | clk_xusbxti.rate = 24000000; |
1180 | 1318 | ||
@@ -1182,6 +1320,12 @@ static void __init nuri_machine_init(void) | |||
1182 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); | 1320 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); |
1183 | s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; | 1321 | s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; |
1184 | s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev; | 1322 | s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev; |
1323 | |||
1324 | s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev; | ||
1325 | s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev; | ||
1326 | s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev; | ||
1327 | s5p_device_fimc3.dev.parent = &exynos4_device_pd[PD_CAM].dev; | ||
1328 | s5p_device_mipi_csis0.dev.parent = &exynos4_device_pd[PD_CAM].dev; | ||
1185 | } | 1329 | } |
1186 | 1330 | ||
1187 | MACHINE_START(NURI, "NURI") | 1331 | MACHINE_START(NURI, "NURI") |