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

Commit dc1b1d7f authored by Pascal Paillet's avatar Pascal Paillet Committed by Greg Kroah-Hartman
Browse files

regulator: core: Let boot-on regulators be powered off



commit 089b3f61ecfc43ca4ea26d595e1d31ead6de3f7b upstream.

Boot-on regulators are always kept on because their use_count value
is now incremented at boot time and never cleaned.

Only increment count value for alway-on regulators.
regulator_late_cleanup() is now able to power off boot-on regulators
when unused.

Fixes: 05f224ca6693 ("regulator: core: Clean enabling always-on regulators + their supplies")
Signed-off-by: default avatarPascal Paillet <p.paillet@st.com>
Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarAndre Kalb <andre.kalb@sma.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71dc356a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1211,6 +1211,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)
			rdev_err(rdev, "failed to enable\n");
			return ret;
		}

		if (rdev->constraints->always_on)
			rdev->use_count++;
	}