msm: clock-8960: Enable cxo for clock measurement

The measurement hardware uses CXO as the source for the counter. Make
sure to enable the CXO clock before measuring so that the counter
actually counts. Otherwise measurement will get stuck forever
waiting for the count to change.

Change-Id: Ic3027fa42d395ec2de770a2dac0020b65fcc3fa7
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 8152ff2..eec6b8a 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -5090,6 +5090,12 @@
 	struct measure_clk *clk = to_measure_clk(c);
 	unsigned ret;
 
+	ret = clk_enable(&cxo_clk.c);
+	if (ret) {
+		pr_warning("CXO clock failed to enable. Can't measure\n");
+		return 0;
+	}
+
 	spin_lock_irqsave(&local_clock_reg_lock, flags);
 
 	/* Enable CXO/4 and RINGOSC branch and root. */
@@ -5127,6 +5133,8 @@
 	writel_relaxed(0x38F8, PLLTEST_PAD_CFG_REG);
 	spin_unlock_irqrestore(&local_clock_reg_lock, flags);
 
+	clk_disable(&cxo_clk.c);
+
 	return ret;
 }
 #else /* !CONFIG_DEBUG_FS */