diff options
author | Muralidharan Karicheri <m-karicheri2@ti.com> | 2010-01-13 18:27:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:45 -0500 |
commit | 77c8b5fb0ee6e367332167eaa26470d843596270 (patch) | |
tree | a0c2da16cd8be786d4e7c974bd34e97154f73a0b /arch/arm/mach-davinci/dm355.c | |
parent | 8d1b5946bf53b2593e633caba2330863838b7bf7 (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/dm355.c')
-rw-r--r-- | arch/arm/mach-davinci/dm355.c | 43 |
1 files changed, 30 insertions, 13 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 | |||
129 | static struct clk clkout1_clk = { | 128 | static 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 | ||
667 | static 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 | |||
668 | static struct resource dm355_vpss_resources[] = { | 678 | static 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 | |||
716 | static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); | ||
717 | static 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 | }; |
725 | static 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 | ||
712 | static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); | ||
713 | static struct platform_device vpfe_capture_dev = { | 737 | static 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; |