diff options
| -rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 33 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/board-dm646x-evm.c | 44 | ||||
| -rw-r--r-- | drivers/media/platform/davinci/vpif_display.c | 141 | ||||
| -rw-r--r-- | include/media/davinci/vpif_types.h | 19 |
4 files changed, 192 insertions, 45 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 8663df3d2a58..bc6b8c7b86c3 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #include <mach/spi.h> | 46 | #include <mach/spi.h> |
| 47 | 47 | ||
| 48 | #include <media/tvp514x.h> | 48 | #include <media/tvp514x.h> |
| 49 | #include <media/adv7343.h> | ||
| 49 | 50 | ||
| 50 | #define DA850_EVM_PHY_ID "davinci_mdio-0:00" | 51 | #define DA850_EVM_PHY_ID "davinci_mdio-0:00" |
| 51 | #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) | 52 | #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) |
| @@ -1259,16 +1260,38 @@ static struct vpif_subdev_info da850_vpif_subdev[] = { | |||
| 1259 | }, | 1260 | }, |
| 1260 | }; | 1261 | }; |
| 1261 | 1262 | ||
| 1262 | static const char const *vpif_output[] = { | 1263 | static const struct vpif_output da850_ch0_outputs[] = { |
| 1263 | "Composite", | 1264 | { |
| 1264 | "S-Video", | 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 | }, | ||
| 1265 | }; | 1286 | }; |
| 1266 | 1287 | ||
| 1267 | static struct vpif_display_config da850_vpif_display_config = { | 1288 | static struct vpif_display_config da850_vpif_display_config = { |
| 1268 | .subdevinfo = da850_vpif_subdev, | 1289 | .subdevinfo = da850_vpif_subdev, |
| 1269 | .subdev_count = ARRAY_SIZE(da850_vpif_subdev), | 1290 | .subdev_count = ARRAY_SIZE(da850_vpif_subdev), |
| 1270 | .output = vpif_output, | 1291 | .chan_config[0] = { |
| 1271 | .output_count = ARRAY_SIZE(vpif_output), | 1292 | .outputs = da850_ch0_outputs, |
| 1293 | .output_count = ARRAY_SIZE(da850_ch0_outputs), | ||
| 1294 | }, | ||
| 1272 | .card_name = "DA850/OMAP-L138 Video Display", | 1295 | .card_name = "DA850/OMAP-L138 Video Display", |
| 1273 | }; | 1296 | }; |
| 1274 | 1297 | ||
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 2647b8966dd2..fac92f539daa 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/i2c/pcf857x.h> | 26 | #include <linux/i2c/pcf857x.h> |
| 27 | 27 | ||
| 28 | #include <media/tvp514x.h> | 28 | #include <media/tvp514x.h> |
| 29 | #include <media/adv7343.h> | ||
| 29 | 30 | ||
| 30 | #include <linux/mtd/mtd.h> | 31 | #include <linux/mtd/mtd.h> |
| 31 | #include <linux/mtd/nand.h> | 32 | #include <linux/mtd/nand.h> |
| @@ -496,18 +497,49 @@ static struct vpif_subdev_info dm646x_vpif_subdev[] = { | |||
| 496 | }, | 497 | }, |
| 497 | }; | 498 | }; |
| 498 | 499 | ||
| 499 | static const char *output[] = { | 500 | static const struct vpif_output dm6467_ch0_outputs[] = { |
| 500 | "Composite", | 501 | { |
| 501 | "Component", | 502 | .output = { |
| 502 | "S-Video", | 503 | .index = 0, |
| 504 | .name = "Composite", | ||
| 505 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
| 506 | .capabilities = V4L2_OUT_CAP_STD, | ||
| 507 | .std = V4L2_STD_ALL, | ||
| 508 | }, | ||
| 509 | .subdev_name = "adv7343", | ||
| 510 | .output_route = ADV7343_COMPOSITE_ID, | ||
| 511 | }, | ||
| 512 | { | ||
| 513 | .output = { | ||
| 514 | .index = 1, | ||
| 515 | .name = "Component", | ||
| 516 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
| 517 | .capabilities = V4L2_OUT_CAP_CUSTOM_TIMINGS, | ||
| 518 | }, | ||
| 519 | .subdev_name = "adv7343", | ||
| 520 | .output_route = ADV7343_COMPONENT_ID, | ||
| 521 | }, | ||
| 522 | { | ||
| 523 | .output = { | ||
| 524 | .index = 2, | ||
| 525 | .name = "S-Video", | ||
| 526 | .type = V4L2_OUTPUT_TYPE_ANALOG, | ||
| 527 | .capabilities = V4L2_OUT_CAP_STD, | ||
| 528 | .std = V4L2_STD_ALL, | ||
| 529 | }, | ||
| 530 | .subdev_name = "adv7343", | ||
| 531 | .output_route = ADV7343_SVIDEO_ID, | ||
| 532 | }, | ||
| 503 | }; | 533 | }; |
| 504 | 534 | ||
| 505 | static struct vpif_display_config dm646x_vpif_display_config = { | 535 | static struct vpif_display_config dm646x_vpif_display_config = { |
| 506 | .set_clock = set_vpif_clock, | 536 | .set_clock = set_vpif_clock, |
| 507 | .subdevinfo = dm646x_vpif_subdev, | 537 | .subdevinfo = dm646x_vpif_subdev, |
| 508 | .subdev_count = ARRAY_SIZE(dm646x_vpif_subdev), | 538 | .subdev_count = ARRAY_SIZE(dm646x_vpif_subdev), |
| 509 | .output = output, | 539 | .chan_config[0] = { |
| 510 | .output_count = ARRAY_SIZE(output), | 540 | .outputs = dm6467_ch0_outputs, |
| 541 | .output_count = ARRAY_SIZE(dm6467_ch0_outputs), | ||
| 542 | }, | ||
| 511 | .card_name = "DM646x EVM", | 543 | .card_name = "DM646x EVM", |
| 512 | }; | 544 | }; |
| 513 | 545 | ||
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 6229e4844bed..ae8329d79242 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
| @@ -308,7 +308,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) | |||
| 308 | channel2_intr_assert(); | 308 | channel2_intr_assert(); |
| 309 | channel2_intr_enable(1); | 309 | channel2_intr_enable(1); |
| 310 | enable_channel2(1); | 310 | enable_channel2(1); |
| 311 | if (vpif_config_data->ch2_clip_en) | 311 | if (vpif_config_data->chan_config[VPIF_CHANNEL2_VIDEO].clip_en) |
| 312 | channel2_clipping_enable(1); | 312 | channel2_clipping_enable(1); |
| 313 | } | 313 | } |
| 314 | 314 | ||
| @@ -317,7 +317,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) | |||
| 317 | channel3_intr_assert(); | 317 | channel3_intr_assert(); |
| 318 | channel3_intr_enable(1); | 318 | channel3_intr_enable(1); |
| 319 | enable_channel3(1); | 319 | enable_channel3(1); |
| 320 | if (vpif_config_data->ch3_clip_en) | 320 | if (vpif_config_data->chan_config[VPIF_CHANNEL3_VIDEO].clip_en) |
| 321 | channel3_clipping_enable(1); | 321 | channel3_clipping_enable(1); |
| 322 | } | 322 | } |
| 323 | 323 | ||
| @@ -1174,14 +1174,16 @@ static int vpif_streamoff(struct file *file, void *priv, | |||
| 1174 | if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { | 1174 | if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { |
| 1175 | /* disable channel */ | 1175 | /* disable channel */ |
| 1176 | if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { | 1176 | if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { |
| 1177 | if (vpif_config_data->ch2_clip_en) | 1177 | if (vpif_config_data-> |
| 1178 | chan_config[VPIF_CHANNEL2_VIDEO].clip_en) | ||
| 1178 | channel2_clipping_enable(0); | 1179 | channel2_clipping_enable(0); |
| 1179 | enable_channel2(0); | 1180 | enable_channel2(0); |
| 1180 | channel2_intr_enable(0); | 1181 | channel2_intr_enable(0); |
| 1181 | } | 1182 | } |
| 1182 | if ((VPIF_CHANNEL3_VIDEO == ch->channel_id) || | 1183 | if ((VPIF_CHANNEL3_VIDEO == ch->channel_id) || |
| 1183 | (2 == common->started)) { | 1184 | (2 == common->started)) { |
| 1184 | if (vpif_config_data->ch3_clip_en) | 1185 | if (vpif_config_data-> |
| 1186 | chan_config[VPIF_CHANNEL3_VIDEO].clip_en) | ||
| 1185 | channel3_clipping_enable(0); | 1187 | channel3_clipping_enable(0); |
| 1186 | enable_channel3(0); | 1188 | enable_channel3(0); |
| 1187 | channel3_intr_enable(0); | 1189 | channel3_intr_enable(0); |
| @@ -1214,41 +1216,118 @@ static int vpif_enum_output(struct file *file, void * | |||
