Re: [PATCH 8/10 - v2] DM6446 platform changes for vpfe capture driver

2009-06-14 Thread Hans Verkuil
On Thursday 11 June 2009 19:00:47 m-kariche...@ti.com wrote:
 From: Muralidharan Karicheri a0868...@gt516km11.gt.design.ti.com
 
 DM644x platform and board setup
 
 This adds plarform and board setup changes required to support
 vpfe capture driver on DM644x
 
 Added registration of vpss platform driver based on last comment
 
 Reviewed By Hans Verkuil.
 Reviewed By Laurent Pinchart.
 
 Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
 ---
 Applies to Davinci GIT Tree
 
  arch/arm/mach-davinci/board-dm644x-evm.c|   68 
 ++-
  arch/arm/mach-davinci/dm644x.c  |   56 ++
  arch/arm/mach-davinci/include/mach/dm644x.h |2 +
  3 files changed, 124 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
 b/arch/arm/mach-davinci/board-dm644x-evm.c
 index d9d4045..13b73a7 100644
 --- a/arch/arm/mach-davinci/board-dm644x-evm.c
 +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
 @@ -28,7 +28,8 @@
  #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
  
 @@ -195,6 +196,57 @@ static struct platform_device davinci_fb_device = {
   .num_resources = 0,
  };
  
 +#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 = SVIDEO,
 + .type = V4L2_INPUT_TYPE_CAMERA,
 + .std = TVP514X_STD_ALL,
 + },

No all-caps.

 +};
 +
 +/*
 + * 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 v4l2_routing 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,
 + },
 +};

Same remark as for patch 7: suggest using a separate input array.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/10 - v2] DM6446 platform changes for vpfe capture driver

2009-06-11 Thread m-karicheri2
From: Muralidharan Karicheri a0868...@gt516km11.gt.design.ti.com

DM644x platform and board setup

This adds plarform and board setup changes required to support
vpfe capture driver on DM644x

Added registration of vpss platform driver based on last comment

Reviewed By Hans Verkuil.
Reviewed By Laurent Pinchart.

Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
---
Applies to Davinci GIT Tree

 arch/arm/mach-davinci/board-dm644x-evm.c|   68 ++-
 arch/arm/mach-davinci/dm644x.c  |   56 ++
 arch/arm/mach-davinci/include/mach/dm644x.h |2 +
 3 files changed, 124 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index d9d4045..13b73a7 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -28,7 +28,8 @@
 #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
 
@@ -195,6 +196,57 @@ static struct platform_device davinci_fb_device = {
.num_resources = 0,
 };
 
+#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 = SVIDEO,
+   .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 v4l2_routing 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,
+   },
+};
+
+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,
@@ -447,6 +499,13 @@ static struct at24_platform_data eeprom_info = {
.context= (void *)0x7f00,
 };
 
+#define TVP5146_I2C_ADDR   (0x5D)
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity = 0,
+   .hs_polarity = 1,
+   .vs_polarity = 1
+};
+
 /*
  * MSP430 supports RTC, card detection, input from IR remote, and
  * a bit more.  It triggers interrupts on GPIO(7) from pressing
@@ -558,9 +617,12 @@ static struct i2c_board_info __initdata i2c_info[] =  {
I2C_BOARD_INFO(24c256, 0x50),
.platform_data  = eeprom_info,
},
+   {
+   I2C_BOARD_INFO(tvp5146, TVP5146_I2C_ADDR),
+   .platform_data = tvp5146_pdata,
+   },
/* ALSO:
 * - tvl320aic33 audio codec (0x1b)
-* - tvp5146 video decoder (0x5d)
 */
 };
 
@@ -591,6 +653,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();
 }
 
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 1b3aec8..444c4df 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -549,6 +549,59 @@ static struct platform_device dm644x_edma_device = {
.resource   = edma_resources,
 };
 
+static struct resource dm644x_vpss_resources[] = {
+   {
+   /* VPSS Base address */
+   .name   = vpss,
+   .start  = 0x01c73400,
+   .end= 0x01c73400 + 0xff,
+   .flags  = IORESOURCE_MEM,
+   },
+};
+
+static struct platform_device dm644x_vpss_device = {
+   .name   = vpss,
+   .id = -1,
+   .dev.platform_data  = dm644x_vpss,
+   .num_resources  = ARRAY_SIZE(dm644x_vpss_resources),
+   .resource   = dm644x_vpss_resources,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = IRQ_VDINT0,
+   .end= IRQ_VDINT0,
+ 

[PATCH 8/10 - v2] DM6446 platform changes for vpfe capture driver

2009-06-09 Thread m-karicheri2
From: Muralidharan Karicheri a0868...@gt516km11.gt.design.ti.com

DM644x platform and board setup

This adds plarform and board setup changes required to support
vpfe capture driver on DM644x

Added registration of vpss platform driver based on last comment

Reviewed By Hans Verkuil.
Reviewed By Laurent Pinchart.

Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
---
Applies to Davinci GIT Tree

 arch/arm/mach-davinci/board-dm644x-evm.c|   68 ++-
 arch/arm/mach-davinci/dm644x.c  |   56 ++
 arch/arm/mach-davinci/include/mach/dm644x.h |2 +
 3 files changed, 124 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index d9d4045..13b73a7 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -28,7 +28,8 @@
 #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
 
@@ -195,6 +196,57 @@ static struct platform_device davinci_fb_device = {
.num_resources = 0,
 };
 
+#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 = SVIDEO,
+   .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 v4l2_routing 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,
+   },
+};
+
+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,
@@ -447,6 +499,13 @@ static struct at24_platform_data eeprom_info = {
.context= (void *)0x7f00,
 };
 
+#define TVP5146_I2C_ADDR   (0x5D)
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity = 0,
+   .hs_polarity = 1,
+   .vs_polarity = 1
+};
+
 /*
  * MSP430 supports RTC, card detection, input from IR remote, and
  * a bit more.  It triggers interrupts on GPIO(7) from pressing
@@ -558,9 +617,12 @@ static struct i2c_board_info __initdata i2c_info[] =  {
I2C_BOARD_INFO(24c256, 0x50),
.platform_data  = eeprom_info,
},
+   {
+   I2C_BOARD_INFO(tvp5146, TVP5146_I2C_ADDR),
+   .platform_data = tvp5146_pdata,
+   },
/* ALSO:
 * - tvl320aic33 audio codec (0x1b)
-* - tvp5146 video decoder (0x5d)
 */
 };
 
@@ -591,6 +653,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();
 }
 
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 1b3aec8..444c4df 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -549,6 +549,59 @@ static struct platform_device dm644x_edma_device = {
.resource   = edma_resources,
 };
 
+static struct resource dm644x_vpss_resources[] = {
+   {
+   /* VPSS Base address */
+   .name   = vpss,
+   .start  = 0x01c73400,
+   .end= 0x01c73400 + 0xff,
+   .flags  = IORESOURCE_MEM,
+   },
+};
+
+static struct platform_device dm644x_vpss_device = {
+   .name   = vpss,
+   .id = -1,
+   .dev.platform_data  = dm644x_vpss,
+   .num_resources  = ARRAY_SIZE(dm644x_vpss_resources),
+   .resource   = dm644x_vpss_resources,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = IRQ_VDINT0,
+   .end= IRQ_VDINT0,
+