aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/venc.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-09-26 07:00:49 -0400
committerArchit Taneja <archit@ti.com>2012-09-26 07:00:49 -0400
commit81b87f515f6abbbe4eef42835065db9d0831ef35 (patch)
tree3eebf0e10cd70425bb80c60202236f8a2ce96a38 /drivers/video/omap2/dss/venc.c
parent484dc404d233696ef65a8e676f9d4fe563b091ee (diff)
OMAPDSS: outputs: Create and register output instances
Add output structs to output driver's private data. Register output instances by having an init function in the probes of the platform device drivers for different outputs. The *_init_output for each output registers the output and fill up the output's plaform device, type and id fields. The *_uninit_output functions unregister the output. In the probe of each interface driver, the output entities are initialized before the *_probe_pdata() functions intentionally. This is done to ensure that the output entity is prepared before the panels connected to the output are registered. We need the output entities to be ready because OMAPDSS will try to make connections between overlays, managers, outputs and devices during the panel's probe. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/venc.c')
-rw-r--r--drivers/video/omap2/dss/venc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 996779c0204c..24d278b3e7fd 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -303,6 +303,8 @@ static struct {
303 struct omap_video_timings timings; 303 struct omap_video_timings timings;
304 enum omap_dss_venc_type type; 304 enum omap_dss_venc_type type;
305 bool invert_polarity; 305 bool invert_polarity;
306
307 struct omap_dss_output output;
306} venc; 308} venc;
307 309
308static inline void venc_write_reg(int idx, u32 val) 310static inline void venc_write_reg(int idx, u32 val)
@@ -797,6 +799,24 @@ static void __init venc_probe_pdata(struct platform_device *vencdev)
797 } 799 }
798} 800}
799 801
802static void __init venc_init_output(struct platform_device *pdev)
803{
804 struct omap_dss_output *out = &venc.output;
805
806 out->pdev = pdev;
807 out->id = OMAP_DSS_OUTPUT_VENC;
808 out->type = OMAP_DISPLAY_TYPE_VENC;
809
810 dss_register_output(out);
811}
812
813static void __exit venc_uninit_output(struct platform_device *pdev)
814{
815 struct omap_dss_output *out = &venc.output;
816
817 dss_unregister_output(out);
818}
819
800/* VENC HW IP initialisation */ 820/* VENC HW IP initialisation */
801static int __init omap_venchw_probe(struct platform_device *pdev) 821static int __init omap_venchw_probe(struct platform_device *pdev)
802{ 822{
@@ -844,6 +864,8 @@ static int __init omap_venchw_probe(struct platform_device *pdev)
844 864
845 dss_debugfs_create_file("venc", venc_dump_regs); 865 dss_debugfs_create_file("venc", venc_dump_regs);
846 866
867 venc_init_output(pdev);
868
847 venc_probe_pdata(pdev); 869 venc_probe_pdata(pdev);
848 870
849 return 0; 871 return 0;
@@ -866,6 +888,8 @@ static int __exit omap_venchw_remove(struct platform_device *pdev)
866 888
867 venc_panel_exit(); 889 venc_panel_exit();
868 890
891 venc_uninit_output(pdev);
892
869 pm_runtime_disable(&pdev->dev); 893 pm_runtime_disable(&pdev->dev);
870 venc_put_clocks(); 894 venc_put_clocks();
871 895