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.

Change-Id: I37401fe9bf8bbe244e85933c27c4638bbcbaa735
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/arch/arm/boot/dts/msm8974-regulator.dtsi b/arch/arm/boot/dts/msm8974-regulator.dtsi
index 05451671..49450f3 100644
--- a/arch/arm/boot/dts/msm8974-regulator.dtsi
+++ b/arch/arm/boot/dts/msm8974-regulator.dtsi
@@ -448,6 +448,7 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
+		qcom,pfm-threshold = <376975>;
 
 		krait0_vreg: regulator@f9088000 {
 			compatible = "qcom,krait-regulator";