Commit ab8e8df8 authored by Muralidharan Karicheri's avatar Muralidharan Karicheri Committed by Kevin Hilman

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@skynet.be>
Reviewed-by: default avatarDavid Brownell <david-b@pacbell.net>
Signed-off-by: default avatarMuralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: default avatarDenys Dmytriyenko <denis@denix.org>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 1a7ff8ff
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/videodev2.h>
#include <media/tvp514x.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -194,6 +197,72 @@ static struct platform_device davinci_fb_device = { ...@@ -194,6 +197,72 @@ static struct platform_device davinci_fb_device = {
.num_resources = 0, .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 = { static struct platform_device rtc_dev = {
.name = "rtc_davinci_evm", .name = "rtc_davinci_evm",
.id = -1, .id = -1,
...@@ -562,9 +631,6 @@ static struct i2c_board_info __initdata i2c_info[] = { ...@@ -562,9 +631,6 @@ static struct i2c_board_info __initdata i2c_info[] = {
{ {
I2C_BOARD_INFO("tlv320aic33", 0x1b), I2C_BOARD_INFO("tlv320aic33", 0x1b),
}, },
/* ALSO:
* - tvp5146 video decoder (0x5d)
*/
}; };
/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz), /* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
...@@ -594,6 +660,8 @@ static struct davinci_uart_config uart_config __initdata = { ...@@ -594,6 +660,8 @@ static struct davinci_uart_config uart_config __initdata = {
static void __init static void __init
davinci_evm_map_io(void) davinci_evm_map_io(void)
{ {
/* setup input configuration for VPFE input devices */
dm644x_set_vpfe_config(&vpfe_cfg);
dm644x_init(); dm644x_init();
} }
......
...@@ -580,6 +580,59 @@ static struct platform_device dm644x_asp_device = { ...@@ -580,6 +580,59 @@ static struct platform_device dm644x_asp_device = {
.resource = dm644x_asp_resources, .resource = dm644x_asp_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,
.flags = IORESOURCE_IRQ,
},
{
.start = IRQ_VDINT1,
.end = IRQ_VDINT1,
.flags = IORESOURCE_IRQ,
},
{
.start = 0x01c70400,
.end = 0x01c70400 + 0xff,
.flags = IORESOURCE_MEM,
},
};
static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
static struct platform_device vpfe_capture_dev = {
.name = CAPTURE_DRV_NAME,
.id = -1,
.num_resources = ARRAY_SIZE(vpfe_resources),
.resource = vpfe_resources,
.dev = {
.dma_mask = &vpfe_capture_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
void dm644x_set_vpfe_config(struct vpfe_config *cfg)
{
vpfe_capture_dev.dev.platform_data = cfg;
}
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
static struct map_desc dm644x_io_desc[] = { static struct map_desc dm644x_io_desc[] = {
...@@ -715,6 +768,9 @@ static int __init dm644x_init_devices(void) ...@@ -715,6 +768,9 @@ static int __init dm644x_init_devices(void)
platform_device_register(&dm644x_edma_device); platform_device_register(&dm644x_edma_device);
platform_device_register(&dm644x_emac_device); platform_device_register(&dm644x_emac_device);
platform_device_register(&dm644x_vpss_device);
platform_device_register(&vpfe_capture_dev);
return 0; return 0;
} }
postcore_initcall(dm644x_init_devices); postcore_initcall(dm644x_init_devices);
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/emac.h> #include <mach/emac.h>
#include <mach/asp.h> #include <mach/asp.h>
#include <media/davinci/vpfe_capture.h>
#define DM644X_EMAC_BASE (0x01C80000) #define DM644X_EMAC_BASE (0x01C80000)
#define DM644X_EMAC_CNTRL_OFFSET (0x0000) #define DM644X_EMAC_CNTRL_OFFSET (0x0000)
...@@ -36,5 +37,6 @@ ...@@ -36,5 +37,6 @@
void __init dm644x_init(void); void __init dm644x_init(void);
void __init dm644x_init_asp(struct snd_platform_data *pdata); void __init dm644x_init_asp(struct snd_platform_data *pdata);
void dm644x_set_vpfe_config(struct vpfe_config *cfg);
#endif /* __ASM_ARCH_DM644X_H */ #endif /* __ASM_ARCH_DM644X_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment