regulator: Flag uncontrollable regulators as always_on
authorMark Brown <broonie@kernel.org>
Fri, 25 Mar 2022 14:46:37 +0000 (14:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:48:52 +0000 (08:48 +0100)
commit67a791df14572a022db81cdff569fd018365baf0
tree611296cb316004684adac5c6606bcbbac37d3344
parente471e928de97b00f297ad1015cc14f9459765713
regulator: Flag uncontrollable regulators as always_on

[ Upstream commit 261f06315cf7c3744731e36bfd8d4434949e3389 ]

While we currently assume that regulators with no control available are
just uncontionally enabled this isn't always as clearly displayed to
users as is desirable, for example the code for disabling unused
regulators will log that it is about to disable them. Clean this up a
bit by setting always_on during constraint evaluation if we have no
available mechanism for controlling the regualtor so things that check
the constraint will do the right thing.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220325144637.1543496-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 80d2c29e09e6 ("regulator: core: Use ktime_get_boottime() to determine how long a regulator was off")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/core.c