Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a682922 authored by Mark Brown's avatar Mark Brown
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 43f674a3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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,