regulator: Add of_regulator_get_optional() APIs
Add of_regulator_get_optional() APIs, which can be used by generic code
to improve integration of regulator management helpers for their users.
regulator: Add devres version of of_regulator_get_optional()
There are existing uses for a devres version of of_regulator_get_optional()
in power domain drivers. On MediaTek platforms, power domains may have
regulator supplies tied to them. The driver currently tries to use
devm_regulator_get() to not have to manage the lifecycle, but ends up
doing it in a very hacky way by replacing the device node of the power
domain controller device to the device node of the power domain that is
currently being registered, getting the supply, and reverting the device
node.
Provide a better API so that the hack can be replaced.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20240925093807.1026949-3-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 files changed