aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c179
1 files changed, 179 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 1295e616ceee..32ee3f895967 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -45,6 +45,9 @@
45#include <linux/platform_data/mtd-davinci-aemif.h> 45#include <linux/platform_data/mtd-davinci-aemif.h>
46#include <linux/platform_data/spi-davinci.h> 46#include <linux/platform_data/spi-davinci.h>
47 47
48#include <media/tvp514x.h>
49#include <media/adv7343.h>
50
48#define DA850_EVM_PHY_ID "davinci_mdio-0:00" 51#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
49#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 52#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
50#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) 53#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
@@ -452,6 +455,15 @@ static void da850_evm_ui_keys_init(unsigned gpio)
452 } 455 }
453} 456}
454 457
458#ifdef CONFIG_DA850_UI_SD_VIDEO_PORT
459static inline void da850_evm_setup_video_port(int video_sel)
460{
461 gpio_set_value_cansleep(video_sel, 0);
462}
463#else
464static inline void da850_evm_setup_video_port(int video_sel) { }
465#endif
466
455static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, 467static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
456 unsigned ngpio, void *c) 468 unsigned ngpio, void *c)
457{ 469{
@@ -497,6 +509,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
497 509
498 da850_evm_setup_emac_rmii(sel_a); 510 da850_evm_setup_emac_rmii(sel_a);
499 511
512 da850_evm_setup_video_port(sel_c);
513
500 return 0; 514 return 0;
501 515
502exp_setup_keys_fail: 516exp_setup_keys_fail:
@@ -1149,6 +1163,169 @@ static __init int da850_evm_init_cpufreq(void)
1149static __init int da850_evm_init_cpufreq(void) { return 0; } 1163static __init int da850_evm_init_cpufreq(void) { return 0; }
1150#endif 1164#endif
1151 1165
1166#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
1167
1168#define TVP5147_CH0 "tvp514x-0"
1169#define TVP5147_CH1 "tvp514x-1"
1170
1171/* VPIF capture configuration */
1172static struct tvp514x_platform_data tvp5146_pdata = {
1173 .clk_polarity = 0,
1174 .hs_polarity = 1,
1175 .vs_polarity = 1,
1176};
1177
1178#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
1179
1180static const struct vpif_input da850_ch0_inputs[] = {
1181 {
1182 .input = {
1183 .index = 0,
1184 .name = "Composite",
1185 .type = V4L2_INPUT_TYPE_CAMERA,
1186 .capabilities = V4L2_IN_CAP_STD,
1187 .std = TVP514X_STD_ALL,
1188 },
1189 .input_route = INPUT_CVBS_VI2B,
1190 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1191 .subdev_name = TVP5147_CH0,
1192 },
1193};
1194
1195static const struct vpif_input da850_ch1_inputs[] = {
1196 {
1197 .input = {
1198 .index = 0,
1199 .name = "S-Video",
1200 .type = V4L2_INPUT_TYPE_CAMERA,
1201 .capabilities = V4L2_IN_CAP_STD,
1202 .std = TVP514X_STD_ALL,
1203 },
1204 .input_route = INPUT_SVIDEO_VI2C_VI1C,
1205 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1206 .subdev_name = TVP5147_CH1,
1207 },
1208};
1209
1210static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
1211 {
1212 .name = TVP5147_CH0,
1213 .board_info = {
1214 I2C_BOARD_INFO("tvp5146", 0x5d),
1215 .platform_data = &tvp5146_pdata,
1216 },
1217 },
1218 {
1219 .name = TVP5147_CH1,
1220 .board_info = {
1221 I2C_BOARD_INFO("tvp5146", 0x5c),
1222 .platform_data = &tvp5146_pdata,
1223 },
1224 },
1225};
1226
1227static struct vpif_capture_config da850_vpif_capture_config = {
1228 .subdev_info = da850_vpif_capture_sdev_info,
1229 .subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
1230 .chan_config[0] = {
1231 .inputs = da850_ch0_inputs,
1232 .input_count = ARRAY_SIZE(da850_ch0_inputs),
1233 .vpif_if = {
1234 .if_type = VPIF_IF_BT656,
1235 .hd_pol = 1,
1236 .vd_pol = 1,
1237 .fid_pol = 0,
1238 },
1239 },
1240 .chan_config[1] = {
1241 .inputs = da850_ch1_inputs,
1242 .input_count = ARRAY_SIZE(da850_ch1_inputs),
1243 .vpif_if = {
1244 .if_type = VPIF_IF_BT656,
1245 .hd_pol = 1,
1246 .vd_pol = 1,
1247 .fid_pol = 0,
1248 },
1249 },
1250 .card_name = "DA850/OMAP-L138 Video Capture",
1251};
1252
1253/* VPIF display configuration */
1254static struct vpif_subdev_info da850_vpif_subdev[] = {
1255 {
1256 .name = "adv7343",
1257 .board_info = {
1258 I2C_BOARD_INFO("adv7343", 0x2a),
1259 },
1260 },
1261};
1262
1263static const struct vpif_output da850_ch0_outputs[] = {
1264 {
1265 .output = {
1266 .index = 0,
1267 .name = "Composite",
1268 .type = V4L2_OUTPUT_TYPE_ANALOG,
1269 .capabilities = V4L2_OUT_CAP_STD,
1270 .std = V4L2_STD_ALL,
1271 },
1272 .subdev_name = "adv7343",
1273 .output_route = ADV7343_COMPOSITE_ID,
1274 },
1275 {
1276 .output = {
1277 .index = 1,
1278 .name = "S-Video",
1279 .type = V4L2_OUTPUT_TYPE_ANALOG,
1280 .capabilities = V4L2_OUT_CAP_STD,
1281 .std = V4L2_STD_ALL,
1282 },
1283 .subdev_name = "adv7343",
1284 .output_route = ADV7343_SVIDEO_ID,
1285 },
1286};
1287
1288static struct vpif_display_config da850_vpif_display_config = {
1289 .subdevinfo = da850_vpif_subdev,
1290 .subdev_count = ARRAY_SIZE(da850_vpif_subdev),
1291 .chan_config[0] = {
1292 .outputs = da850_ch0_outputs,
1293 .output_count = ARRAY_SIZE(da850_ch0_outputs),
1294 },
1295 .card_name = "DA850/OMAP-L138 Video Display",
1296};
1297
1298static __init void da850_vpif_init(void)
1299{
1300 int ret;
1301
1302 ret = da850_register_vpif();
1303 if (ret)
1304 pr_warn("da850_evm_init: VPIF setup failed: %d\n", ret);
1305
1306 ret = davinci_cfg_reg_list(da850_vpif_capture_pins);
1307 if (ret)
1308 pr_warn("da850_evm_init: VPIF capture mux setup failed: %d\n",
1309 ret);
1310
1311 ret = da850_register_vpif_capture(&da850_vpif_capture_config);
1312 if (ret)
1313 pr_warn("da850_evm_init: VPIF capture setup failed: %d\n", ret);
1314
1315 ret = davinci_cfg_reg_list(da850_vpif_display_pins);
1316 if (ret)
1317 pr_warn("da850_evm_init: VPIF display mux setup failed: %d\n",
1318 ret);
1319
1320 ret = da850_register_vpif_display(&da850_vpif_display_config);
1321 if (ret)
1322 pr_warn("da850_evm_init: VPIF display setup failed: %d\n", ret);
1323}
1324
1325#else
1326static __init void da850_vpif_init(void) {}
1327#endif
1328
1152#ifdef CONFIG_DA850_WL12XX 1329#ifdef CONFIG_DA850_WL12XX
1153 1330
1154static void wl12xx_set_power(int index, bool power_on) 1331static void wl12xx_set_power(int index, bool power_on)
@@ -1375,6 +1552,8 @@ static __init void da850_evm_init(void)
1375 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1552 pr_warning("da850_evm_init: suspend registration failed: %d\n",
1376 ret); 1553 ret);
1377 1554
1555 da850_vpif_init();
1556
1378 ret = da8xx_register_spi(1, da850evm_spi_info, 1557 ret = da8xx_register_spi(1, da850evm_spi_info,
1379 ARRAY_SIZE(da850evm_spi_info)); 1558 ARRAY_SIZE(da850evm_spi_info));
1380 if (ret) 1559 if (ret)