aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/core.c
diff options
context:
space:
mode:
authorSenthilvadivu Guruswamy <svadivu@ti.com>2011-01-24 01:22:01 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 08:46:20 -0500
commit30ea50c9f5166a375b4dc0109d18a5d21bab5711 (patch)
tree604bc1862a890093950c7759b0085b146695802b /drivers/video/omap2/dss/core.c
parent060b6d9cbab03f1379dbe00393ab26d6eb371ce2 (diff)
OMAP2, 3: DSS2: VENC: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver. So a platform_driver for VENC is created and init exit methods are moved from core.c to its driver probe,remove. pdev member has to be maintained by its own drivers. Also, venc_vdda_dac reading is moved to venc.c. VENC platform driver is registered from inside omap_dss_probe, in the order desired. Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com> Signed-off-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/core.c')
-rw-r--r--drivers/video/omap2/dss/core.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 8b7eab83e412..57c6303cb1cd 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -43,7 +43,6 @@ static struct {
43 43
44 struct regulator *vdds_dsi_reg; 44 struct regulator *vdds_dsi_reg;
45 struct regulator *vdds_sdi_reg; 45 struct regulator *vdds_sdi_reg;
46 struct regulator *vdda_dac_reg;
47} core; 46} core;
48 47
49static char *def_disp_name; 48static char *def_disp_name;
@@ -85,20 +84,6 @@ struct regulator *dss_get_vdds_sdi(void)
85 return reg; 84 return reg;
86} 85}
87 86
88struct regulator *dss_get_vdda_dac(void)
89{
90 struct regulator *reg;
91
92 if (core.vdda_dac_reg != NULL)
93 return core.vdda_dac_reg;
94
95 reg = regulator_get(&core.pdev->dev, "vdda_dac");
96 if (!IS_ERR(reg))
97 core.vdda_dac_reg = reg;
98
99 return reg;
100}
101
102#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) 87#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
103static int dss_debug_show(struct seq_file *s, void *unused) 88static int dss_debug_show(struct seq_file *s, void *unused)
104{ 89{
@@ -219,9 +204,9 @@ static int omap_dss_probe(struct platform_device *pdev)
219 goto err_dispc; 204 goto err_dispc;
220 } 205 }
221 206
222 r = venc_init(pdev); 207 r = venc_init_platform_driver();
223 if (r) { 208 if (r) {
224 DSSERR("Failed to initialize venc\n"); 209 DSSERR("Failed to initialize venc platform driver\n");
225 goto err_venc; 210 goto err_venc;
226 } 211 }
227 212
@@ -279,7 +264,7 @@ err_dsi:
279 if (cpu_is_omap34xx()) 264 if (cpu_is_omap34xx())
280 sdi_exit(); 265 sdi_exit();
281err_sdi: 266err_sdi:
282 venc_exit(); 267 venc_uninit_platform_driver();
283err_venc: 268err_venc:
284 dispc_uninit_platform_driver(); 269 dispc_uninit_platform_driver();
285err_dispc: 270err_dispc:
@@ -300,7 +285,7 @@ static int omap_dss_remove(struct platform_device *pdev)
300 285
301 dss_uninitialize_debugfs(); 286 dss_uninitialize_debugfs();
302 287
303 venc_exit(); 288 venc_uninit_platform_driver();
304 dispc_uninit_platform_driver(); 289 dispc_uninit_platform_driver();
305 dpi_exit(); 290 dpi_exit();
306 rfbi_uninit_platform_driver(); 291 rfbi_uninit_platform_driver();
@@ -597,11 +582,6 @@ static void __exit omap_dss_exit(void)
597 core.vdds_sdi_reg = NULL; 582 core.vdds_sdi_reg = NULL;
598 } 583 }
599 584
600 if (core.vdda_dac_reg != NULL) {
601 regulator_put(core.vdda_dac_reg);
602 core.vdda_dac_reg = NULL;
603 }
604
605 platform_driver_unregister(&omap_dss_driver); 585 platform_driver_unregister(&omap_dss_driver);
606 586
607 omap_dss_bus_unregister(); 587 omap_dss_bus_unregister();