Merge tag 'sound-fix-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / omap_hwmod.c
index b5531dd3ae9c36b5b165b314ba39d2e0a9cd8264..3a04c73ac03c372c6b2dff678ed90bdb369aaa62 100644 (file)
@@ -1002,8 +1002,10 @@ static int _enable_clocks(struct omap_hwmod *oh)
                clk_enable(oh->_clk);
 
        list_for_each_entry(os, &oh->slave_ports, node) {
-               if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE))
+               if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE)) {
+                       omap2_clk_deny_idle(os->_clk);
                        clk_enable(os->_clk);
+               }
        }
 
        /* The opt clocks are controlled by the device driver. */
@@ -1055,8 +1057,10 @@ static int _disable_clocks(struct omap_hwmod *oh)
                clk_disable(oh->_clk);
 
        list_for_each_entry(os, &oh->slave_ports, node) {
-               if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE))
+               if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE)) {
                        clk_disable(os->_clk);
+                       omap2_clk_allow_idle(os->_clk);
+               }
        }
 
        if (oh->flags & HWMOD_OPT_CLKS_NEEDED)
@@ -2436,9 +2440,13 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh)
                        continue;
 
                if (os->flags & OCPIF_SWSUP_IDLE) {
-                       /* XXX omap_iclk_deny_idle(c); */
+                       /*
+                        * we might have multiple users of one iclk with
+                        * different requirements, disable autoidle when
+                        * the module is enabled, e.g. dss iclk
+                        */
                } else {
-                       /* XXX omap_iclk_allow_idle(c); */
+                       /* we are enabling autoidle afterwards anyways */
                        clk_enable(os->_clk);
                }
        }