Skip to content

Commit

Permalink
regulator: Complain if a voltage range is specified but can't be used
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Feb 9, 2012
1 parent 43f674a commit 4a68292
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4a68292

Please sign in to comment.