OMAP2, 3: DSS2: remove forced clk-disable from omap_dss_remove
authorSumit Semwal <sumit.semwal@ti.com>
Mon, 24 Jan 2011 06:21:48 +0000 (06:21 +0000)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 Mar 2011 13:46:19 +0000 (15:46 +0200)
As part of omap hwmod changes, DSS will not be the only controller of its
clocks. hwmod initialization also enables the interface clocks, and
manages them.
So, when DSS is built as a module, omap_dss_remove doesn't try to disable
all clocks that have a higher usecount.

Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/core.c

index 8e89f604928098306485494ca829a7b11c42d0c3..ee56859c52ce088a612dc94c85d0069d1519492a 100644 (file)
@@ -623,7 +623,6 @@ static int omap_dss_remove(struct platform_device *pdev)
 {
        struct omap_dss_board_info *pdata = pdev->dev.platform_data;
        int i;
-       int c;
 
        dss_uninitialize_debugfs();
 
@@ -638,44 +637,13 @@ static int omap_dss_remove(struct platform_device *pdev)
 
        dss_exit();
 
-       /* these should be removed at some point */
-       c = core.dss_ick->usecount;
-       if (c > 0) {
-               DSSERR("warning: dss_ick usecount %d, disabling\n", c);
-               while (c-- > 0)
-                       clk_disable(core.dss_ick);
-       }
-
-       c = core.dss1_fck->usecount;
-       if (c > 0) {
-               DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
-               while (c-- > 0)
-                       clk_disable(core.dss1_fck);
-       }
-
-       c = core.dss2_fck->usecount;
-       if (c > 0) {
-               DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
-               while (c-- > 0)
-                       clk_disable(core.dss2_fck);
-       }
-
-       c = core.dss_54m_fck->usecount;
-       if (c > 0) {
-               DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
-               while (c-- > 0)
-                       clk_disable(core.dss_54m_fck);
-       }
-
-       if (core.dss_96m_fck) {
-               c = core.dss_96m_fck->usecount;
-               if (c > 0) {
-                       DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
-                                       c);
-                       while (c-- > 0)
-                               clk_disable(core.dss_96m_fck);
-               }
-       }
+       /*
+        * As part of hwmod changes, DSS is not the only controller of dss
+        * clocks; hwmod framework itself will also enable clocks during hwmod
+        * init for dss, and autoidle is set in h/w for DSS. Hence, there's no
+        * need to disable clocks if their usecounts > 1.
+        */
+       WARN_ON(core.num_clks_enabled > 0);
 
        dss_put_clocks();