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

Commit 4aa922c0 authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood
Browse files

regulator: Only apply voltage constraints from consumers that set them



When applying the set_voltage() requests from consumers skip over those
consumers that haven't set anything, otherwise we'll come out with a
maximum voltage of zero.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent a4b41483
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -158,6 +158,13 @@ static int regulator_check_consumers(struct regulator_dev *rdev,
	struct regulator *regulator;
	struct regulator *regulator;


	list_for_each_entry(regulator, &rdev->consumer_list, list) {
	list_for_each_entry(regulator, &rdev->consumer_list, list) {
		/*
		 * Assume consumers that didn't say anything are OK
		 * with anything in the constraint range.
		 */
		if (!regulator->min_uV && !regulator->max_uV)
			continue;

		if (*max_uV > regulator->max_uV)
		if (*max_uV > regulator->max_uV)
			*max_uV = regulator->max_uV;
			*max_uV = regulator->max_uV;
		if (*min_uV < regulator->min_uV)
		if (*min_uV < regulator->min_uV)