aboutsummaryrefslogtreecommitdiffstats
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 13:25:26 -0400
commitab8e8df87421574fe053bf1770353af5b24a2bbb (patch)
tree656f02746d36f06f34b88c3354b3c44f3102daf7
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>
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c74
-rw-r--r--arch/arm/mach-davinci/dm644x.c56
-rw-r--r--arch/arm/mach-davinci/include/mach/dm644x.h2
3 files changed, 129 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 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/phy.h> 29#include <linux/phy.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/videodev2.h>
32
33#include <media/tvp514x.h>
31 34
32#include <asm/setup.h> 35#include <asm/setup.h>
33#include <asm/mach-types.h> 36#include <asm/mach-types.h>
@@ -194,6 +197,72 @@ static struct platform_device davinci_fb_device = {
194 .num_resources = 0, 197 .num_resources = 0,
195}; 198};
196 199
200static struct tvp514x_platform_data tvp5146_pdata = {
201 .clk_polarity = 0,
202 .hs_polarity = 1,
203 .vs_polarity = 1
204};
205
206#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
207/* Inputs available at the TVP5146 */
208static struct v4l2_input tvp5146_inputs[] = {
209 {
210 .index = 0,
211 .name = "Composite",
212 .type = V4L2_INPUT_TYPE_CAMERA,
213 .std = TVP514X_STD_ALL,
214 },
215 {
216 .index = 1,
217 .name = "S-Video",
218 .type = V4L2_INPUT_TYPE_CAMERA,
219 .std = TVP514X_STD_ALL,
220 },
221};
222
223/*
224 * this is the route info for connecting each input to decoder
225 * ouput that goes to vpfe. There is a one to one correspondence
226 * with tvp5146_inputs
227 */
228static struct vpfe_route tvp5146_routes[] = {
229 {
230 .input = INPUT_CVBS_VI2B,
231 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
232 },
233 {
234 .input = INPUT_SVIDEO_VI2C_VI1C,
235 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
236 },
237};
238
239static struct vpfe_subdev_info vpfe_sub_devs[] = {
240 {
241 .name = "tvp5146",
242 .grp_id = 0,
243 .num_inputs = ARRAY_SIZE(tvp5146_inputs),
244 .inputs = tvp5146_inputs,
245 .routes = tvp5146_routes,
246 .can_route = 1,
247 .ccdc_if_params = {
248 .if_type = VPFE_BT656,
249 .hdpol = VPFE_PINPOL_POSITIVE,
250 .vdpol = VPFE_PINPOL_POSITIVE,
251 },
252 .board_info = {
253 I2C_BOARD_INFO("tvp5146", 0x5d),
254 .platform_data = &tvp5146_pdata,
255 },
256 },
257};
258
259static struct vpfe_config vpfe_cfg = {
260 .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
261 .sub_devs = vpfe_sub_devs,
262 .card_name = "DM6446 EVM",
263 .ccdc = "DM6446 CCDC",
264};
265
197static struct platform_device rtc_dev = { 266static struct platform_device rtc_dev = {
198 .name = "rtc_davinci_evm", 267 .name = "rtc_davinci_evm",
199 .id = -1, 268 .id = -1,
@@ -562,9 +631,6 @@ static struct i2c_board_info __initdata i2c_info[] = {
562 { 631 {
563 I2C_BOARD_INFO("tlv320aic33", 0x1b), 632 I2C_BOARD_INFO("tlv320aic33", 0x1b),
564 }, 633 },
565 /* ALSO:
566 * - tvp5146 video decoder (0x5d)
567 */
568}; 634};
569 635
570/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz), 636/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
@@ -594,6 +660,8 @@ static struct davinci_uart_config uart_config __initdata = {
594static void __init 660static void __init
595davinci_evm_map_io(void) 661davinci_evm_map_io(void)
596{ 662{
663 /* setup input configuration for VPFE input devices */
664 dm644x_set_vpfe_config(&vpfe_cfg);
597 dm644x_init(); 665 dm644x_init();
598} 666}
599 667
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index e554aa6c9a8..d6e0fa5a8d8 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -580,6 +580,59 @@ static struct platform_device dm644x_asp_device = {
580 .resource = dm644x_asp_resources, 580 .resource = dm644x_asp_resources,
581}; 581};
582 582
583static struct resource dm644x_vpss_resources[] = {
584 {
585 /* VPSS Base address */
586 .name = "vpss",
587 .start = 0x01c73400,
588 .end = 0x01c73400 + 0xff,
589 .flags = IORESOURCE_MEM,
590 },
591};
592
593static struct platform_device dm644x_vpss_device = {
594 .name = "vpss",
595 .id = -1,
596 .dev.platform_data = "dm644x_vpss",
597 .num_resources = ARRAY_SIZE(dm644x_vpss_resources),
598 .resource = dm644x_vpss_resources,
599};
600
601static struct resource vpfe_resources[] = {
602 {
603 .start = IRQ_VDINT0,
604 .end = IRQ_VDINT0,
605 .flags = IORESOURCE_IRQ,
606 },
607 {
608 .start = IRQ_VDINT1,
609 .end = IRQ_VDINT1,
610 .flags = IORESOURCE_IRQ,
611 },
612 {
613 .start = 0x01c70400,
614 .end = 0x01c70400 + 0xff,
615 .flags = IORESOURCE_MEM,
616 },
617};
618
619static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
620static struct platform_device vpfe_capture_dev = {
621 .name = CAPTURE_DRV_NAME,
622 .id = -1,
623 .num_resources = ARRAY_SIZE(vpfe_resources),
624 .resource = vpfe_resources,
625 .dev = {
626 .dma_mask = &vpfe_capture_dma_mask,
627 .coherent_dma_mask = DMA_BIT_MASK(32),
628 },
629};
630
631void dm644x_set_vpfe_config(struct vpfe_config *cfg)
632{
633 vpfe_capture_dev.dev.platform_data = cfg;
634}
635
583/*----------------------------------------------------------------------*/ 636/*----------------------------------------------------------------------*/
584 637
585static struct map_desc dm644x_io_desc[] = { 638static struct map_desc dm644x_io_desc[] = {
@@ -715,6 +768,9 @@ static int __init dm644x_init_devices(void)
715 768
716 platform_device_register(&dm644x_edma_device); 769 platform_device_register(&dm644x_edma_device);
717 platform_device_register(&dm644x_emac_device); 770 platform_device_register(&dm644x_emac_device);
771 platform_device_register(&dm644x_vpss_device);
772 platform_device_register(&vpfe_capture_dev);
773
718 return 0; 774 return 0;
719} 775}
720postcore_initcall(dm644x_init_devices); 776postcore_initcall(dm644x_init_devices);
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h
index 8b157ceec0c..0efb73852c2 100644
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ b/arch/arm/mach-davinci/include/mach/dm644x.h
@@ -26,6 +26,7 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/emac.h> 27#include <mach/emac.h>
28#include <mach/asp.h> 28#include <mach/asp.h>
29#include <media/davinci/vpfe_capture.h>
29 30
30#define DM644X_EMAC_BASE (0x01C80000) 31#define DM644X_EMAC_BASE (0x01C80000)
31#define DM644X_EMAC_CNTRL_OFFSET (0x0000) 32#define DM644X_EMAC_CNTRL_OFFSET (0x0000)
@@ -36,5 +37,6 @@
36 37
37void __init dm644x_init(void); 38void __init dm644x_init(void);
38void __init dm644x_init_asp(struct snd_platform_data *pdata); 39void __init dm644x_init_asp(struct snd_platform_data *pdata);
40void dm644x_set_vpfe_config(struct vpfe_config *cfg);
39 41
40#endif /* __ASM_ARCH_DM644X_H */ 42#endif /* __ASM_ARCH_DM644X_H */