msm: spm-v2: Add support for AVS

Changing the voltage with the AVS feature enabled requires
certain care. First, temporarily disable AVS before writing any
registers which would change the voltage. Then kick the PMIC
state machine back to the idle state so that our write to the
VCTL register takes effect immediately. We don't need to check
the state machine for idle, instead we should just confirm that
the SPM has sent the voltage we wanted to send and then we can
program AVS to allow up to 4 12.5mV steps down from the voltage
programmed in VCTL. Once this is all done reenable AVS so that
the voltage can be decreased after the AVS_DELAY counts down.

Change-Id: I1c23fd0549e401152fd16de9032ceaf7c3e067c4
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: spm-v2: Disable AVS operations on unsupported targets

Do not enable/disable AVS on targets where it is not enabled at boot.
Enabling it on targets when AVS isn't enabled and the AVS control
parameters aren't configured, causes undefined behavior and random
crashes.

Change-Id: Id0c4e10618437eed1b383145a6a4f25bbd901647
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: spm: enable avs for 8960 hw

Enable avs(bit 27 in SAW2_AVS_CTL) by default
in the board file which can be usefull later to
avoid unneccesarry enable/disables(for avs unsupported
targets).

CRs-fixed: 423827
Change-Id: I2ec49078e2811b8e515260d66462f8ee2ff4e38b
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
[testing]: defconfig: enable AVS on d2vzw

Signed-off-by: bmc08gt <bmc08gt.teamb00sted@gmail.com>