diff mbox

[13/20] Move dsi init to dsi probe

Message ID 1282579089-10487-14-git-send-email-svadivu@ti.com (mailing list archive)
State Changes Requested
Delegated to: Kevin Hilman
Headers show

Commit Message

Senthilvadivu Guruswamy Aug. 23, 2010, 3:58 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index df0cfea..ce1f83b 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -197,12 +197,6 @@  static int omap_dss_probe(struct platform_device *pdev)
 			DSSERR("Failed to initialize SDI\n");
 			goto err_sdi;
 		}
-
-		r = dsi_init(pdev);
-		if (r) {
-			DSSERR("Failed to initialize DSI\n");
-			goto err_dsi;
-		}
 	}
 
 	r = dss_initialize_debugfs();
@@ -235,9 +229,6 @@  err_register:
 	dss_uninitialize_debugfs();
 err_debugfs:
 	if (cpu_is_omap34xx())
-		dsi_exit();
-err_dsi:
-	if (cpu_is_omap34xx())
 		sdi_exit();
 err_sdi:
 	dpi_exit();
@@ -257,7 +248,6 @@  static int omap_dss_remove(struct platform_device *pdev)
 
 	dpi_exit();
 	if (cpu_is_omap34xx()) {
-		dsi_exit();
 		sdi_exit();
 	}
 
@@ -315,11 +305,24 @@  static int omap_dispchw_remove(struct platform_device *pdev)
 /* DSI1 HW IP initialisation */
 static int omap_dsi1hw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	if (cpu_is_omap34xx()) {
+		r = dsi_init(pdev);
+		if (r) {
+			DSSERR("Failed to initialize DSI\n");
+			goto err_dsi;
+		}
+	}
+err_dsi:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_dsi1hw_remove(struct platform_device *pdev)
 {
+	if (cpu_is_omap34xx())
+		dsi_exit();
 	return 0;
 }