msm: cpr-regulator: calculate quotient adjustment dynamically

Replace the fixed quotient adjustment algorithm with a new algorithm
that calculates quotient adjustments dynamically.

Calculate the quotient scaling factor according to fused target
quotients and application processor clock frequencies. A different
quotient adjustment value is applied to each voltage corner.

The formula for calculating the quotient adjustment value for each
voltage corner is:
quot_adjust = (freq_turbo_MHZ - freq_corner_MHZ) * scaling / 1000
where the "scaling" is determined using this equation:
scaling = min(max_scaling_factor,
1000 * (QUOT(fused_turbo) - QUOT(fused_norm)) /
(Freq_turbo_MHZ - Freq_normal_MHZ)).

In msm8x26 cpr-regulator device tree node, add a corner to frequency
mapping table, a speedbin + PVS version to max SVS/normal/turbo fuse
corner mapping table, a maximum quotient adjustment scaling factor,and
PVS version eFuse information. With the frequency to corner mapping
table specified in msm8x26 clock-a7 device tree node, this ensures that
1.6G/1.8G msm8226v2 and msm8926 parts receive power saving when running
at turbo frequencies below the maximum possible turbo frequency.

CRs-Fixed: 597721
Change-Id: Ideecccc2f81762bed3668cfdf27d942c00df76ea
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
4 files changed