regulator: mt6358: split ops for buck and linear range LDO regulators
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 20 Sep 2023 08:53:34 +0000 (16:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:00:40 +0000 (22:00 +0200)
commitb46384a681a861c8b47aaaf9862313afc29235f8
tree9bc7e3d30d90757c9a6bf13e1b979f1444788cb1
parenta01576f58b1953752d125664df4ae08daa2e5e3e
regulator: mt6358: split ops for buck and linear range LDO regulators

[ Upstream commit 7e37c851374eca2d1f6128de03195c9f7b4baaf2 ]

The buck and linear range LDO (VSRAM_*) regulators share one set of ops.
This set includes support for get/set mode. However this only makes
sense for buck regulators, not LDOs. The callbacks were not checking
whether the register offset and/or mask for mode setting was valid or
not. This ends up making the kernel report "normal" mode operation for
the LDOs.

Create a new set of ops without the get/set mode callbacks for the
linear range LDO regulators.

Fixes: f67ff1bd58f0 ("regulator: mt6358: Add support for MT6358 regulator")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230920085336.136238-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/mt6358-regulator.c