aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/board-dm644x-evm.c
diff options
context:
space:
mode:
authorMuralidharan Karicheri <m-karicheri2@ti.com>2009-09-16 11:53:18 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-09-16 10:25:26 -0700
commitab8e8df87421574fe053bf1770353af5b24a2bbb (patch)
tree656f02746d36f06f34b88c3354b3c44f3102daf7 /arch/arm/mach-davinci/board-dm644x-evm.c
parent1a7ff8ff6eebfa732ca2abe00a0878136bfb2d01 (diff)
davinci: DM644x platform changes for vpfe capture
DM644x platform and board setup This adds platform and board setup changes required to support vpfe capture driver on DM644x Tested video capture on DM6446 with tvp514x driver Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@skynet.be> Reviewed-by: David Brownell <david-b@pacbell.net> Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com> Signed-off-by: Denys Dmytriyenko <denis@denix.org> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-dm644x-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c74
1 files changed, 71 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 31cf84fbb01..1213a0087ad 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -28,6 +28,9 @@
#include <linux/io.h>
#include <linux/phy.h>
#include <linux/clk.h>
+#include <linux/videodev2.h>
+
+#include <media/tvp514x.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -194,6 +197,72 @@ static struct platform_device davinci_fb_device = {
.num_resources = 0,
};
+static struct tvp514x_platform_data tvp5146_pdata = {
+ .clk_polarity = 0,
+ .hs_polarity = 1,
+ .vs_polarity = 1
+};
+
+#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
+/* Inputs available at the TVP5146 */
+static struct v4l2_input tvp5146_inputs[] = {
+ {
+ .index = 0,
+ .name = "Composite",
+ .type = V4L2_INPUT_TYPE_CAMERA,
+ .std = TVP514X_STD_ALL,
+ },
+ {
+ .index = 1,
+ .name = "S-Video",
+ .type = V4L2_INPUT_TYPE_CAMERA,
+ .std = TVP514X_STD_ALL,
+ },
+};
+
+/*
+ * this is the route info for connecting each input to decoder
+ * ouput that goes to vpfe. There is a one to one correspondence
+ * with tvp5146_inputs
+ */
+static struct vpfe_route tvp5146_routes[] = {
+ {
+ .input = INPUT_CVBS_VI2B,
+ .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+ },
+ {
+ .input = INPUT_SVIDEO_VI2C_VI1C,
+ .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+ },
+};
+
+static struct vpfe_subdev_info vpfe_sub_devs[] = {
+ {
+ .name = "tvp5146",
+ .grp_id = 0,
+ .num_inputs = ARRAY_SIZE(tvp5146_inputs),
+ .inputs = tvp5146_inputs,
+ .routes = tvp5146_routes,
+ .can_route = 1,
+ .ccdc_if_params = {
+ .if_type = VPFE_BT656,
+ .hdpol = VPFE_PINPOL_POSITIVE,
+ .vdpol = VPFE_PINPOL_POSITIVE,
+ },
+ .board_info = {
+ I2C_BOARD_INFO("tvp5146", 0x5d),
+ .platform_data = &tvp5146_pdata,
+ },
+ },
+};
+
+static struct vpfe_config vpfe_cfg = {
+ .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
+ .sub_devs = vpfe_sub_devs,
+ .card_name = "DM6446 EVM",
+ .ccdc = "DM6446 CCDC",
+};
+
static struct platform_device rtc_dev = {
.name = "rtc_davinci_evm",
.id = -1,
@@ -562,9 +631,6 @@ static struct i2c_board_info __initdata i2c_info[] = {
{
I2C_BOARD_INFO("tlv320aic33", 0x1b),
},
- /* ALSO:
- * - tvp5146 video decoder (0x5d)
- */
};
/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
@@ -594,6 +660,8 @@ static struct davinci_uart_config uart_config __initdata = {
static void __init
davinci_evm_map_io(void)
{
+ /* setup input configuration for VPFE input devices */
+ dm644x_set_vpfe_config(&vpfe_cfg);
dm644x_init();
}