msm: krait-regulator: enable intelligent phase control

Simulation results have shown that the PMIC phase can be optimally
managed based on coefficients calculated when the cpu voltage or
load changes.
These coefficients and their aggregation do not translate to
any physical units, but indicate the power required to run the cpus.
Compare these values with phase count thresholds to decide the
number of phases to turn on. If the number of phases turn out to
be higher than the number of cpus online, restrict the phases to
the number of cpus online.
Also avoid calculating these coefficients and setting phases until
late in the init sequence, that way initializations of cpus brought
up during boot would not lower the phase count and cause a crash.

Originally this patch had a bug allowing PFM mode to be used at
422mhz Krait on certain hardware. This has been fixed in the patch

Change-Id: I6de23270e7066d813d6ca3e6a8510d86484ba57e
CRs-Fixed: 478517
Signed-off-by: Patrick Cain <pcain@codeaurora.org>
diff --git a/arch/arm/boot/dts/msm8974-regulator.dtsi b/arch/arm/boot/dts/msm8974-regulator.dtsi
index 0be3756..d1b3334 100644
--- a/arch/arm/boot/dts/msm8974-regulator.dtsi
+++ b/arch/arm/boot/dts/msm8974-regulator.dtsi
@@ -466,6 +466,7 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
+		qcom,pfm-threshold = <73>;
 
 		krait0_vreg: regulator@f9088000 {
 			compatible = "qcom,krait-regulator";