aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorManjunath Hadli <manjunath.hadli@ti.com>2012-07-23 07:00:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-05 20:59:16 -0400
commit1e046d17b59046ac1333b59f8bab6db140ca5d56 (patch)
tree01de081d7e299ad50ac54a9fc06a102a58d178f7 /arch
parent154d54a8ce9953197a662ffd24f4bb6aaeb236f4 (diff)
[media] ARM: davinci: da850 evm: Add EVM specific code for VPIF to work
Include the expander settings to select VPIF peripheral on UI card and add registration call in EVM init. Also add platform data to configure display and capture devices. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-davinci/Kconfig7
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c156
2 files changed, 163 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index ab99c3c3b752..026b4b277ae5 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -186,6 +186,13 @@ config DA850_UI_RMII
186 NOTE: Please take care while choosing this option, MII PHY will 186 NOTE: Please take care while choosing this option, MII PHY will
187 not be functional if RMII mode is selected. 187 not be functional if RMII mode is selected.
188 188
189config DA850_UI_SD_VIDEO_PORT
190 bool "Video Port Interface"
191 help
192 Say Y if you want to use Video Port Interface (VPIF) on the
193 DA850/OMAP-L138 EVM. The Video decoders/encoders are found on the
194 UI daughter card that is supplied with the EVM.
195
189endchoice 196endchoice
190 197
191config DA850_WL12XX 198config DA850_WL12XX
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 0149fb453be3..d0954a29d742 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -45,6 +45,8 @@
45#include <mach/aemif.h> 45#include <mach/aemif.h>
46#include <mach/spi.h> 46#include <mach/spi.h>
47 47
48#include <media/tvp514x.h>
49
48#define DA850_EVM_PHY_ID "davinci_mdio-0:00" 50#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
49#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 51#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
50#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) 52#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
@@ -452,6 +454,15 @@ static void da850_evm_ui_keys_init(unsigned gpio)
452 } 454 }
453} 455}
454 456
457#ifdef CONFIG_DA850_UI_SD_VIDEO_PORT
458static inline void da850_evm_setup_video_port(int video_sel)
459{
460 gpio_set_value_cansleep(video_sel, 0);
461}
462#else
463static inline void da850_evm_setup_video_port(int video_sel) { }
464#endif
465
455static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, 466static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
456 unsigned ngpio, void *c) 467 unsigned ngpio, void *c)
457{ 468{
@@ -497,6 +508,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
497 508
498 da850_evm_setup_emac_rmii(sel_a); 509 da850_evm_setup_emac_rmii(sel_a);
499 510
511 da850_evm_setup_video_port(sel_c);
512
500 return 0; 513 return 0;
501 514
502exp_setup_keys_fail: 515exp_setup_keys_fail:
@@ -1149,6 +1162,147 @@ static __init int da850_evm_init_cpufreq(void)
1149static __init int da850_evm_init_cpufreq(void) { return 0; } 1162static __init int da850_evm_init_cpufreq(void) { return 0; }
1150#endif 1163#endif
1151 1164
1165#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
1166
1167#define TVP5147_CH0 "tvp514x-0"
1168#define TVP5147_CH1 "tvp514x-1"
1169
1170/* VPIF capture configuration */
1171static struct tvp514x_platform_data tvp5146_pdata = {
1172 .clk_polarity = 0,
1173 .hs_polarity = 1,
1174 .vs_polarity = 1,
1175};
1176
1177#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
1178
1179static const struct vpif_input da850_ch0_inputs[] = {
1180 {
1181 .input = {
1182 .index = 0,
1183 .name = "Composite",
1184 .type = V4L2_INPUT_TYPE_CAMERA,
1185 .std = TVP514X_STD_ALL,
1186 },
1187 .subdev_name = TVP5147_CH0,
1188 },
1189};
1190
1191static const struct vpif_input da850_ch1_inputs[] = {
1192 {
1193 .input = {
1194 .index = 0,
1195 .name = "S-Video",
1196 .type = V4L2_INPUT_TYPE_CAMERA,
1197 .std = TVP514X_STD_ALL,
1198 },
1199 .subdev_name = TVP5147_CH1,
1200 },
1201};
1202
1203static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
1204 {
1205 .name = TVP5147_CH0,
1206 .board_info = {
1207 I2C_BOARD_INFO("tvp5146", 0x5d),
1208 .platform_data = &tvp5146_pdata,
1209 },
1210 .input = INPUT_CVBS_VI2B,
1211 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1212 .can_route = 1,
1213 .vpif_if = {
1214 .if_type = VPIF_IF_BT656,
1215 .hd_pol = 1,
1216 .vd_pol = 1,
1217 .fid_pol = 0,
1218 },
1219 },
1220 {
1221 .name = TVP5147_CH1,
1222 .board_info = {
1223 I2C_BOARD_INFO("tvp5146", 0x5c),
1224 .platform_data = &tvp5146_pdata,
1225 },
1226 .input = INPUT_SVIDEO_VI2C_VI1C,
1227 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1228 .can_route = 1,
1229 .vpif_if = {
1230 .if_type = VPIF_IF_BT656,
1231 .hd_pol = 1,
1232 .vd_pol = 1,
1233 .fid_pol = 0,
1234 },
1235 },
1236};
1237
1238static struct vpif_capture_config da850_vpif_capture_config = {
1239 .subdev_info = da850_vpif_capture_sdev_info,
1240 .subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
1241 .chan_config[0] = {
1242 .inputs = da850_ch0_inputs,
1243 .input_count = ARRAY_SIZE(da850_ch0_inputs),
1244 },
1245 .chan_config[1] = {
1246 .inputs = da850_ch1_inputs,
1247 .input_count = ARRAY_SIZE(da850_ch1_inputs),
1248 },
1249 .card_name = "DA850/OMAP-L138 Video Capture",
1250};
1251
1252/* VPIF display configuration */
1253static struct vpif_subdev_info da850_vpif_subdev[] = {
1254 {
1255 .name = "adv7343",
1256 .board_info = {
1257 I2C_BOARD_INFO("adv7343", 0x2a),
1258 },
1259 },
1260};
1261
1262static const char const *vpif_output[] = {
1263 "Composite",
1264 "S-Video",
1265};
1266
1267static struct vpif_display_config da850_vpif_display_config = {
1268 .subdevinfo = da850_vpif_subdev,
1269 .subdev_count = ARRAY_SIZE(da850_vpif_subdev),
1270 .output = vpif_output,
1271 .output_count = ARRAY_SIZE(vpif_output),
1272 .card_name = "DA850/OMAP-L138 Video Display",
1273};
1274
1275static __init void da850_vpif_init(void)
1276{
1277 int ret;
1278
1279 ret = da850_register_vpif();
1280 if (ret)
1281 pr_warn("da850_evm_init: VPIF setup failed: %d\n", ret);
1282
1283 ret = davinci_cfg_reg_list(da850_vpif_capture_pins);
1284 if (ret)
1285 pr_warn("da850_evm_init: VPIF capture mux setup failed: %d\n",
1286 ret);
1287
1288 ret = da850_register_vpif_capture(&da850_vpif_capture_config);
1289 if (ret)
1290 pr_warn("da850_evm_init: VPIF capture setup failed: %d\n", ret);
1291
1292 ret = davinci_cfg_reg_list(da850_vpif_display_pins);
1293 if (ret)
1294 pr_warn("da850_evm_init: VPIF display mux setup failed: %d\n",
1295 ret);
1296
1297 ret = da850_register_vpif_display(&da850_vpif_display_config);
1298 if (ret)
1299 pr_warn("da850_evm_init: VPIF display setup failed: %d\n", ret);
1300}
1301
1302#else
1303static __init void da850_vpif_init(void) {}
1304#endif
1305
1152#ifdef CONFIG_DA850_WL12XX 1306#ifdef CONFIG_DA850_WL12XX
1153 1307
1154static void wl12xx_set_power(int index, bool power_on) 1308static void wl12xx_set_power(int index, bool power_on)
@@ -1375,6 +1529,8 @@ static __init void da850_evm_init(void)
1375 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1529 pr_warning("da850_evm_init: suspend registration failed: %d\n",
1376 ret); 1530 ret);
1377 1531
1532 da850_vpif_init();
1533
1378 ret = da8xx_register_spi(1, da850evm_spi_info, 1534 ret = da8xx_register_spi(1, da850evm_spi_info,
1379 ARRAY_SIZE(da850evm_spi_info)); 1535 ARRAY_SIZE(da850evm_spi_info));
1380 if (ret) 1536 if (ret)