summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown2012-02-09 14:26:13 +0100
committerMark Brown2012-02-09 17:22:18 +0100
commit4a682922817fde4d82fed4303dc902c29d7b2e4e (patch)
treee6d67dbf05d7231af5dcaec74c341fa08d82c8b8 /drivers/regulator/core.c
parentregulator: Don't add the function name to pr_fmt (diff)
downloadkernel-qcow2-linux-4a682922817fde4d82fed4303dc902c29d7b2e4e.tar.gz
kernel-qcow2-linux-4a682922817fde4d82fed4303dc902c29d7b2e4e.tar.xz
kernel-qcow2-linux-4a682922817fde4d82fed4303dc902c29d7b2e4e.zip
regulator: Complain if a voltage range is specified but can't be used
It doesn't make much sense to specify a range of voltages consumers can use if they haven't been given permission to change the voltage. Log if this happens, probably the user forgot to specify CHANGE_VOLTAGE. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e3271daa3ab9..9a143aebb84b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -805,6 +805,11 @@ static void print_constraints(struct regulator_dev *rdev)
count += sprintf(buf + count, "standby");
rdev_info(rdev, "%s\n", buf);
+
+ if ((constraints->min_uV != constraints->max_uV) &&
+ !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE))
+ rdev_warn(rdev,
+ "Voltage range but no REGULATOR_CHANGE_VOLTAGE\n");
}
static int machine_constraints_voltage(struct regulator_dev *rdev,