[PATCH 0/8] regulator: core: allow regulator_register() with missing required supply

André Draszik posted 8 patches 1 month, 1 week ago
There is a newer version of this series
drivers/regulator/core.c         | 351 ++++++++++++++++++++++++++++-----------
include/linux/regulator/driver.h |   2 +
2 files changed, 254 insertions(+), 99 deletions(-)
[PATCH 0/8] regulator: core: allow regulator_register() with missing required supply
Posted by André Draszik 1 month, 1 week ago
Hi,

With these attached patches it becomes possible again to support
hardware designs with multiple PMICs where individual rails of each act
as required supplies for rails of the other (due to the latter being
e.g. always-on), and vice-versa.

Google Pixel 6 and 6 Pro (oriole and raven) are examples of such
designs.

Rather than returning -EPORBE_DEFER in regulator_register() when
set_machine_constraints() fails with -EPROBE_DEFER (due to missing
required supplies), we still allow rail registration and try to
reresolve supplies each time a new rail gets registered.

This is implemented using a bus (regulator bus), which allows the core
to reresolve supplies for regulators that still need them whenever new
regulators (i.e. devices) are added.

Using a bus also solves existing problems around late resolution of
supplies as mentioned in the commit message introducing that bus.

The series starts with a few bug fixes and the last two commits
implement the changes mentioned above, but do depend on the bug fixes.

Cheers,
Andre'

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (8):
      regulator: core: update two debug messages
      regulator: core: fix locking in regulator_resolve_supply() error path
      regulator: core: move supply check earlier in set_machine_constraints()
      regulator: core: streamline supply resolution for always-on/boot-on regulators
      regulator: core: remove dead code in regulator_resolve_supply()
      regulator: core: don't ignore errors from event forwarding setup
      regulator: core: reresolve unresolved supplies when available
      regulator: core: don't fail regulator_register() with missing required supply

 drivers/regulator/core.c         | 351 ++++++++++++++++++++++++++++-----------
 include/linux/regulator/driver.h |   2 +
 2 files changed, 254 insertions(+), 99 deletions(-)
---
base-commit: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
change-id: 20251224-regulators-defer-f5ffa668a3f6

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>