summaryrefslogtreecommitdiffstats
path: root/cmd/regulator.c
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2016-10-26 13:42:30 +0530
committerSimon Glass <sjg@chromium.org>2016-11-25 10:00:04 -0700
commit2f5d532f3b8a7697dc1b5700000b1e350323d50c (patch)
tree07e3089822b28a37bf0f0264c273094763d778cb /cmd/regulator.c
parent543bd27353d2c5679057fe09aa2d02259687ff32 (diff)
downloadu-boot-2f5d532f3b8a7697dc1b5700000b1e350323d50c.tar.gz
u-boot-2f5d532f3b8a7697dc1b5700000b1e350323d50c.tar.xz
u-boot-2f5d532f3b8a7697dc1b5700000b1e350323d50c.zip
power: regulator: Introduce regulator_set_value_force function
In case we want to force a particular value on a regulator irrespective of the min/max constraints for testing purposes one can call regulator_set_value_force function. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/regulator.c')
-rw-r--r--cmd/regulator.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/regulator.c b/cmd/regulator.c
index bfea6e04b6..2ef5bc9a82 100644
--- a/cmd/regulator.c
+++ b/cmd/regulator.c
@@ -292,7 +292,10 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
- ret = regulator_set_value(dev, value);
+ if (!force)
+ ret = regulator_set_value(dev, value);
+ else
+ ret = regulator_set_value_force(dev, value);
if (ret) {
printf("Regulator: %s - can't set the Voltage!\n",
uc_pdata->name);