msm: clock: Move the common parts of the handoff code up to clock.c
This allows the clk_enable()/clk_disable() calls associated
with handoffs, as well as manipulation of CLKFLAG_HANDOFF_RATE,
to be contained entirely within clock.c instead of being spread
out in multiple SoC drivers.
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 5d3c845..4a749d0 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -1186,7 +1186,7 @@
#define QDSS_CLK_ROOT_ENA BIT(1)
-static void qdss_clk_handoff(struct clk *c)
+static int qdss_clk_handoff(struct clk *c)
{
struct rcg_clk *clk = to_rcg_clk(c);
const struct qdss_bank *bank = clk->bank_info;
@@ -1195,7 +1195,7 @@
reg = readl_relaxed(clk->ns_reg);
if (!(reg & QDSS_CLK_ROOT_ENA))
- return;
+ return 0;
bank_sel = reg & bank->bank_sel_mask;
/* Force bank 1 to PXO if bank 0 is in use */
@@ -1209,11 +1209,11 @@
}
}
if (freq->freq_hz == FREQ_END)
- return;
+ return 0;
clk->current_freq = freq;
- c->flags |= CLKFLAG_HANDOFF_RATE;
- clk_enable(c);
+
+ return 1;
}
static void set_rate_qdss(struct rcg_clk *clk, struct clk_freq_tbl *nf)