aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorMuralidharan Karicheri <m-karicheri2@ti.com>2010-01-13 18:27:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:45 -0500
commit77c8b5fb0ee6e367332167eaa26470d843596270 (patch)
treea0c2da16cd8be786d4e7c974bd34e97154f73a0b /arch/arm/mach-davinci
parent8d1b5946bf53b2593e633caba2330863838b7bf7 (diff)
V4L/DVB: vpfe-capture: converting ccdc drivers to platform-drivers
This adds platform code for ccdc driver on DM355 and DM6446. 1) new ccdc platform devices added 2) added clock aliases master and slave for CCDC clocks 3) added dm355_ccdc_setup_pinmux() pin-mux setup hook in dm355 ccdc driver platform data Reviewed-by: Vaibhav Hiremath <hvaibhav@ti.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/dm355.c43
-rw-r--r--arch/arm/mach-davinci/dm644x.c21
2 files changed, 50 insertions, 14 deletions
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index dedf4d4f3a27..d84e85414d20 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -125,7 +125,6 @@ static struct clk vpss_slave_clk = {
125 .lpsc = DAVINCI_LPSC_VPSSSLV, 125 .lpsc = DAVINCI_LPSC_VPSSSLV,
126}; 126};
127 127
128
129static struct clk clkout1_clk = { 128static struct clk clkout1_clk = {
130 .name = "clkout1", 129 .name = "clkout1",
131 .parent = &pll1_aux_clk, 130 .parent = &pll1_aux_clk,
@@ -665,6 +664,17 @@ static struct platform_device dm355_asp1_device = {
665 .resource = dm355_asp1_resources, 664 .resource = dm355_asp1_resources,
666}; 665};
667 666
667static void dm355_ccdc_setup_pinmux(void)
668{
669 davinci_cfg_reg(DM355_VIN_PCLK);
670 davinci_cfg_reg(DM355_VIN_CAM_WEN);
671 davinci_cfg_reg(DM355_VIN_CAM_VD);
672 davinci_cfg_reg(DM355_VIN_CAM_HD);
673 davinci_cfg_reg(DM355_VIN_YIN_EN);
674 davinci_cfg_reg(DM355_VIN_CINL_EN);
675 davinci_cfg_reg(DM355_VIN_CINH_EN);
676}
677
668static struct resource dm355_vpss_resources[] = { 678static struct resource dm355_vpss_resources[] = {
669 { 679 {
670 /* VPSS BL Base address */ 680 /* VPSS BL Base address */
@@ -701,6 +711,10 @@ static struct resource vpfe_resources[] = {
701 .end = IRQ_VDINT1, 711 .end = IRQ_VDINT1,
702 .flags = IORESOURCE_IRQ, 712 .flags = IORESOURCE_IRQ,
703 }, 713 },
714};
715
716static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
717static struct resource dm355_ccdc_resource[] = {
704 /* CCDC Base address */ 718 /* CCDC Base address */
705 { 719 {
706 .flags = IORESOURCE_MEM, 720 .flags = IORESOURCE_MEM,
@@ -708,8 +722,18 @@ static struct resource vpfe_resources[] = {
708 .end = 0x01c70600 + 0x1ff, 722 .end = 0x01c70600 + 0x1ff,
709 }, 723 },
710}; 724};
725static struct platform_device dm355_ccdc_dev = {
726 .name = "dm355_ccdc",
727 .id = -1,
728 .num_resources = ARRAY_SIZE(dm355_ccdc_resource),
729 .resource = dm355_ccdc_resource,
730 .dev = {
731 .dma_mask = &vpfe_capture_dma_mask,
732 .coherent_dma_mask = DMA_BIT_MASK(32),
733 .platform_data = dm355_ccdc_setup_pinmux,
734 },
735};
711 736
712static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
713static struct platform_device vpfe_capture_dev = { 737static struct platform_device vpfe_capture_dev = {
714 .name = CAPTURE_DRV_NAME, 738 .name = CAPTURE_DRV_NAME,
715 .id = -1, 739 .id = -1,
@@ -857,20 +881,13 @@ static int __init dm355_init_devices(void)
857 if (!cpu_is_davinci_dm355()) 881 if (!cpu_is_davinci_dm355())
858 return 0; 882 return 0;
859 883
884 /* Add ccdc clock aliases */
885 clk_add_alias("master", dm355_ccdc_dev.name, "vpss_master", NULL);
886 clk_add_alias("slave", dm355_ccdc_dev.name, "vpss_master", NULL);
860 davinci_cfg_reg(DM355_INT_EDMA_CC); 887 davinci_cfg_reg(DM355_INT_EDMA_CC);
861 platform_device_register(&dm355_edma_device); 888 platform_device_register(&dm355_edma_device);
862 platform_device_register(&dm355_vpss_device); 889 platform_device_register(&dm355_vpss_device);
863 /* 890 platform_device_register(&dm355_ccdc_dev);
864 * setup Mux configuration for vpfe input and register
865 * vpfe capture platform device
866 */
867 davinci_cfg_reg(DM355_VIN_PCLK);
868 davinci_cfg_reg(DM355_VIN_CAM_WEN);
869 davinci_cfg_reg(DM355_VIN_CAM_VD);
870 davinci_cfg_reg(DM355_VIN_CAM_HD);
871 davinci_cfg_reg(DM355_VIN_YIN_EN);
872 davinci_cfg_reg(DM355_VIN_CINL_EN);
873 davinci_cfg_reg(DM355_VIN_CINH_EN);
874 platform_device_register(&vpfe_capture_dev); 891 platform_device_register(&vpfe_capture_dev);
875 892
876 return 0; 893 return 0;
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 2cd008156dea..92aeb5600680 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -612,6 +612,11 @@ static struct resource vpfe_resources[] = {
612 .end = IRQ_VDINT1, 612 .end = IRQ_VDINT1,
613 .flags = IORESOURCE_IRQ, 613 .flags = IORESOURCE_IRQ,
614 }, 614 },
615};
616
617static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
618static struct resource dm644x_ccdc_resource[] = {
619 /* CCDC Base address */
615 { 620 {
616 .start = 0x01c70400, 621 .start = 0x01c70400,
617 .end = 0x01c70400 + 0xff, 622 .end = 0x01c70400 + 0xff,
@@ -619,7 +624,17 @@ static struct resource vpfe_resources[] = {
619 }, 624 },
620}; 625};
621 626
622static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); 627static struct platform_device dm644x_ccdc_dev = {
628 .name = "dm644x_ccdc",
629 .id = -1,
630 .num_resources = ARRAY_SIZE(dm644x_ccdc_resource),
631 .resource = dm644x_ccdc_resource,
632 .dev = {
633 .dma_mask = &vpfe_capture_dma_mask,
634 .coherent_dma_mask = DMA_BIT_MASK(32),
635 },
636};
637
623static struct platform_device vpfe_capture_dev = { 638static struct platform_device vpfe_capture_dev = {
624 .name = CAPTURE_DRV_NAME, 639 .name = CAPTURE_DRV_NAME,
625 .id = -1, 640 .id = -1,
@@ -769,9 +784,13 @@ static int __init dm644x_init_devices(void)
769 if (!cpu_is_davinci_dm644x()) 784 if (!cpu_is_davinci_dm644x())
770 return 0; 785 return 0;
771 786
787 /* Add ccdc clock aliases */
788 clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
789 clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
772 platform_device_register(&dm644x_edma_device); 790 platform_device_register(&dm644x_edma_device);
773 platform_device_register(&dm644x_emac_device); 791 platform_device_register(&dm644x_emac_device);
774 platform_device_register(&dm644x_vpss_device); 792 platform_device_register(&dm644x_vpss_device);
793 platform_device_register(&dm644x_ccdc_dev);
775 platform_device_register(&vpfe_capture_dev); 794 platform_device_register(&vpfe_capture_dev);
776 795
777 return 0; 796 return 0;