diff mbox

[11/20] Move dispc init to dispc probe

Message ID 1282579089-10487-12-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 5030a84..a72d2fa 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -205,12 +205,6 @@  static int omap_dss_probe(struct platform_device *pdev)
 		goto err_dpi;
 	}
 
-	r = dispc_init();
-	if (r) {
-		DSSERR("Failed to initialize dispc\n");
-		goto err_dispc;
-	}
-
 	r = venc_init(pdev);
 	if (r) {
 		DSSERR("Failed to initialize venc\n");
@@ -268,8 +262,6 @@  err_dsi:
 err_sdi:
 	venc_exit();
 err_venc:
-	dispc_exit();
-err_dispc:
 	dpi_exit();
 err_dpi:
 	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
@@ -286,7 +278,6 @@  static int omap_dss_remove(struct platform_device *pdev)
 	dss_uninitialize_debugfs();
 
 	venc_exit();
-	dispc_exit();
 	dpi_exit();
 	if (cpu_is_omap34xx()) {
 		dsi_exit();
@@ -326,11 +317,21 @@  static int omap_dss_resume(struct platform_device *pdev)
 /* DISPC HW IP initialisation */
 static int omap_dispchw_probe(struct platform_device *pdev)
 {
-	return 0;
+	int r;
+	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	r = dispc_init();
+	if (r) {
+		DSSERR("Failed to initialize dispc\n");
+		goto err_dispc;
+	}
+err_dispc:
+	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M);
+	return r;
 }
 
 static int omap_dispchw_remove(struct platform_device *pdev)
 {
+	dispc_exit();
 	return 0;
 }