Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mark Brown and committed by
Liam Girdwood
c439b8f4 b47ba9fd

+14
+14
drivers/regulator/wm831x-dcdc.c
··· 491 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 508 ret = wm831x_set_bits(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL, 495 509 WM831X_DC1_DVS_SRC_MASK, ctrl); 496 510 if (ret < 0) {