aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/venc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/venc.c')
-rw-r--r--drivers/video/omap2/dss/venc.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 005fdaa2cf7d..178c40d3312e 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -829,13 +829,36 @@ static void venc_put_clocks(void)
829 clk_put(venc.tv_dac_clk); 829 clk_put(venc.tv_dac_clk);
830} 830}
831 831
832static void __init venc_probe_pdata(struct platform_device *pdev)
833{
834 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
835 int r, i;
836
837 for (i = 0; i < pdata->num_devices; ++i) {
838 struct omap_dss_device *dssdev = pdata->devices[i];
839
840 if (dssdev->type != OMAP_DISPLAY_TYPE_VENC)
841 continue;
842
843 r = venc_init_display(dssdev);
844 if (r) {
845 DSSERR("device %s init failed: %d\n", dssdev->name, r);
846 continue;
847 }
848
849 r = omap_dss_register_device(dssdev, &pdev->dev, i);
850 if (r)
851 DSSERR("device %s register failed: %d\n",
852 dssdev->name, r);
853 }
854}
855
832/* VENC HW IP initialisation */ 856/* VENC HW IP initialisation */
833static int __init omap_venchw_probe(struct platform_device *pdev) 857static int __init omap_venchw_probe(struct platform_device *pdev)
834{ 858{
835 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
836 u8 rev_id; 859 u8 rev_id;
837 struct resource *venc_mem; 860 struct resource *venc_mem;
838 int r, i; 861 int r;
839 862
840 venc.pdev = pdev; 863 venc.pdev = pdev;
841 864
@@ -877,23 +900,7 @@ static int __init omap_venchw_probe(struct platform_device *pdev)
877 900
878 dss_debugfs_create_file("venc", venc_dump_regs); 901 dss_debugfs_create_file("venc", venc_dump_regs);
879 902
880 for (i = 0; i < pdata->num_devices; ++i) { 903 venc_probe_pdata(pdev);
881 struct omap_dss_device *dssdev = pdata->devices[i];
882
883 if (dssdev->type != OMAP_DISPLAY_TYPE_VENC)
884 continue;
885
886 r = venc_init_display(dssdev);
887 if (r) {
888 DSSERR("device %s init failed: %d\n", dssdev->name, r);
889 continue;
890 }
891
892 r = omap_dss_register_device(dssdev, &pdev->dev, i);
893 if (r)
894 DSSERR("device %s register failed: %d\n",
895 dssdev->name, r);
896 }
897 904
898 return 0; 905 return 0;
899 906