aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-07-25 17:20:33 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-07-28 05:20:49 -0400
commitc439b8f46ee79147139e124621dbc9e1e7804655 (patch)
tree0c04c3d22396ad477b44ce88cb7a0f74304cb9b6 /drivers/regulator/wm831x-dcdc.c
parentb47ba9fdd336b318a6a6431e6a4556df99272277 (diff)
regulator: Bootstrap wm831x DVS VSEL value from ON VSEL if not already set
If we don't have a DVS VSEL value already set when we start up then start it off with the value currently being used for ON. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 95249f7a0e39..2c5d54b026c9 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -491,6 +491,20 @@ static __devinit void wm831x_buckv_dvs_init(struct wm831x_dcdc *dcdc,
491 return; 491 return;
492 } 492 }
493 493
494 /* If DVS_VSEL is set to the minimum value then raise it to ON_VSEL
495 * to make bootstrapping a bit smoother.
496 */
497 if (!dcdc->dvs_vsel) {
498 ret = wm831x_set_bits(wm831x,
499 dcdc->base + WM831X_DCDC_DVS_CONTROL,
500 WM831X_DC1_DVS_VSEL_MASK, dcdc->on_vsel);
501 if (ret == 0)
502 dcdc->dvs_vsel = dcdc->on_vsel;
503 else
504 dev_warn(wm831x->dev, "Failed to set DVS_VSEL: %d\n",
505 ret);
506 }
507
494 ret = wm831x_set_bits(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL, 508 ret = wm831x_set_bits(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL,
495 WM831X_DC1_DVS_SRC_MASK, ctrl); 509 WM831X_DC1_DVS_SRC_MASK, ctrl);
496 if (ret < 0) { 510 if (ret < 0) {