diff mbox

[2/2] ARM: OMAP2+: hwmod: Don't leave the optional clocks in clk_prepare()ed state

Message ID 1398233465-8845-3-git-send-email-rnayak@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rajendra Nayak April 23, 2014, 6:11 a.m. UTC
At hwmod init, theres no reason why optional clocks should be left in
clk_prepare()ed state as these are actually directly controlled by the
drivers themselves. Let the drivers prepare/unprepare as well as enable/
disable them.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Benoit Cousson <bcousson@baylibre.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 1f33f5d..9e3afc9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -857,15 +857,6 @@  static int _init_opt_clks(struct omap_hwmod *oh)
 			continue;
 		}
 		oc->_clk = c;
-		/*
-		 * HACK: This needs a re-visit once clk_prepare() is implemented
-		 * to do something meaningful. Today its just a no-op.
-		 * If clk_prepare() is used at some point to do things like
-		 * voltage scaling etc, then this would have to be moved to
-		 * some point where subsystems like i2c and pmic become
-		 * available.
-		 */
-		clk_prepare(oc->_clk);
 	}
 
 	return ret;
@@ -945,7 +936,7 @@  static void _enable_optional_clocks(struct omap_hwmod *oh)
 		if (oc->_clk) {
 			pr_debug("omap_hwmod: enable %s:%s\n", oc->role,
 				 __clk_get_name(oc->_clk));
-			clk_enable(oc->_clk);
+			clk_prepare_enable(oc->_clk);
 		}
 }
 
@@ -960,7 +951,7 @@  static void _disable_optional_clocks(struct omap_hwmod *oh)
 		if (oc->_clk) {
 			pr_debug("omap_hwmod: disable %s:%s\n", oc->role,
 				 __clk_get_name(oc->_clk));
-			clk_disable(oc->_clk);
+			clk_disable_unprepare(oc->_clk);
 		}
 }