diff options
author | Simon Glass <sjg@chromium.org> | 2015-08-03 14:19:25 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-06 03:06:13 (GMT) |
commit | 75a429f1a299cf4cd4ab3f18eb75a7eb632776c9 (patch) | |
tree | b1b1316a5219b0d280e5b2efac38a41398279175 /drivers | |
parent | 8c4287090cc9bfa172370976c77b420d9c37f94c (diff) | |
download | u-boot-75a429f1a299cf4cd4ab3f18eb75a7eb632776c9.tar.xz |
dm: pmic: max77686: Support all BUCK regulators
Add support for all BUCK regulators, now that the correct register is
accessed for each.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/regulator/max77686.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/power/regulator/max77686.c b/drivers/power/regulator/max77686.c index 21173fc..946b87c 100644 --- a/drivers/power/regulator/max77686.c +++ b/drivers/power/regulator/max77686.c @@ -81,13 +81,15 @@ static int max77686_buck_volt2hex(int buck, int uV) /* hex = (uV - 600000) / 12500; */ hex = (uV - MAX77686_BUCK_UV_LMIN) / MAX77686_BUCK_UV_LSTEP; hex_max = MAX77686_BUCK234_VOLT_MAX_HEX; - /** - * Those use voltage scaller - temporary not implemented - * so return just 0 - */ - return -ENOSYS; + break; default: - /* hex = (uV - 750000) / 50000; */ + /* + * hex = (uV - 750000) / 50000. We assume that dynamic voltage + * scaling via GPIOs is not enabled and don't support that. + * If this is enabled then the driver will need to take that + * into account anrd check different registers depending on + * the current setting See the datasheet for details. + */ hex = (uV - MAX77686_BUCK_UV_HMIN) / MAX77686_BUCK_UV_HSTEP; hex_max = MAX77686_BUCK_VOLT_MAX_HEX; break; @@ -379,11 +381,11 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV) case 2: case 3: case 4: - /* Those use voltage scallers - will support in the future */ mask = MAX77686_BUCK234_VOLT_MASK; - return -ENOSYS; + break; default: mask = MAX77686_BUCK_VOLT_MASK; + break; } ret = pmic_read(dev->parent, adr, &val, 1); |