regulator: ab8500: Fix set voltage for AB8540_LDO_AUX3
authorAxel Lin <axel.lin@ingics.com>
Tue, 16 Apr 2013 16:50:20 +0000 (00:50 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 17 Apr 2013 14:09:27 +0000 (15:09 +0100)
commitb4d12a79295ca216008af7970f208c6051fd408d
tree4f7f5129e971191046cd49f9411248e480dc8786
parent7384744d2de1638b5aa9cbe9f743e9067cb6a44a
regulator: ab8500: Fix set voltage for AB8540_LDO_AUX3

When setting voltage for AB8540_LDO_AUX3, current code only updates one of
info->voltage_reg and info->expand_register registers which is wrong.
To ensure we set to correct voltage, it always needs to clear or set
expand_register.voltage_mask bit of expand_register.

The function of the expand register bit is the following (from the user manual):
0: VAUX3 output voltage is determined by Vaux3Sel bit settings in register
   VldoCVaux3Sel
1: VAUX3 output voltage is set to 3.05V regardless of Vaux3Sel settings in
   register VldoCVaux3Sel (VldoCVaux3Sel is the register at 0x0421)

So when going to 3.05V, set the expand register bit.
When leaving 3.05V for another voltage, set the target voltage before clearing
the expand register bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/ab8500.c