msm: clock: Support depends in toplevel
Two types of clocks support depends (branches and rcgs) and soon
we'll be adding a third (rpm). Support depends in the core so as
to avoid duplicating that logic all over.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index a29e9cd..fa84906 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -42,10 +42,16 @@
ret = clk_enable(parent);
if (ret)
goto out;
+ ret = clk_enable(clk->depends);
+ if (ret) {
+ clk_disable(parent);
+ goto out;
+ }
if (clk->ops->enable)
ret = clk->ops->enable(clk);
if (ret) {
+ clk_disable(clk->depends);
clk_disable(parent);
goto out;
}
@@ -81,6 +87,7 @@
if (clk->count == 1) {
if (clk->ops->disable)
clk->ops->disable(clk);
+ clk_disable(clk->depends);
parent = clk_get_parent(clk);
clk_disable(parent);
}