diff mbox

[v3,11/17] OMAP2,3: DSS2: DSS Move init,exit to driver

Message ID 1294059069-26737-12-git-send-email-svadivu@ti.com (mailing list archive)
State Superseded
Delegated to: Tomi Valkeinen
Headers show

Commit Message

Senthilvadivu Guruswamy Jan. 3, 2011, 12:51 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 0d5f6dd..5b0f551 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -192,18 +192,6 @@  static int omap_dss_probe(struct platform_device *pdev)
 
 	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
 
-#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
-	/* DISPC_CONTROL */
-	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
-		skip_init = 1;
-#endif
-
-	r = dss_init(skip_init);
-	if (r) {
-		DSSERR("Failed to initialize DSS\n");
-		goto err_dss;
-	}
-
 	r = rfbi_init();
 	if (r) {
 		DSSERR("Failed to initialize rfbi\n");
@@ -285,8 +273,6 @@  err_dispc:
 err_dpi:
 	rfbi_exit();
 err_rfbi:
-	dss_exit();
-err_dss:
 
 	return r;
 }
@@ -307,8 +293,6 @@  static int omap_dss_remove(struct platform_device *pdev)
 		sdi_exit();
 	}
 
-	dss_exit();
-
 	dss_uninit_overlays(pdev);
 	dss_uninit_overlay_managers(pdev);
 
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 99dd490..b622d04 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -964,6 +964,7 @@  void dss_debug_dump_clocks(struct seq_file *s)
 static int omap_dsshw_probe(struct platform_device *pdev)
 {
 	int r;
+	int skip_init = 0;
 
 	dss.pdev = pdev;
 
@@ -978,6 +979,19 @@  static int omap_dsshw_probe(struct platform_device *pdev)
 	dss.ctx_id = dss_get_ctx_id();
 	DSSDBG("initial ctx id %u\n", dss.ctx_id);
 
+#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
+	/* DISPC_CONTROL */
+	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
+		skip_init = 1;
+#endif
+
+	r = dss_init(skip_init);
+	if (r) {
+		DSSERR("Failed to initialize DSS\n");
+		goto err_dss;
+	}
+
+err_dss:
 	dss_clk_disable_all_no_ctx();
 err_clocks:
 
@@ -988,6 +1002,8 @@  static int omap_dsshw_remove(struct platform_device *pdev)
 {
 	int c;
 
+	dss_exit();
+
 	/* these should be removed at some point */
 	c = dss.dss_ick->usecount;
 	if (c > 0) {