[PATCH v3 0/4] General regulator and pmic uclass improvements

Svyatoslav Ryhel clamor95 at gmail.com
Sun Aug 6 19:52:20 CEST 2023


This patchset derives from discussion of TPS65913 bringup and aims to
cycle all regulator management inside uclass removing need of any board
calls for regulators.

My hw setup is Tegra 3 LG Optimus Vu P895 (PMIC is MAX77663) with native
spl u-boot build.

power: regulator: expand basic reference counter onto all uclass
Commit is basically expansion of 4fcba5d ("regulator: implement basic
reference counter") onto all regulators. My testing on hw has shown no
issues so far with both pmic regulators and fixed regulators. Counting
works as expected, dm test is set in test of regulator_set_enable_if_allowed.

power: regulator-uclass: perform regulator setup inside uclass
All regulators with always-on or boot-on are set to probe after bind
which ensures that essential regulators are set. In the post probe
regulator autoset is called so that correct regulator state according to
device tree is reached. DM test is set by checking regulators data without
pre-configuring them manually.

---
Changes from v2:
 - dropped changes related to pmic (pmic regulator probing on pmic post bind)
 - regulator uclass changes are dropped to minimum to remain compatibility:
   - always-on and boot-on check is moved to post bind
   - regulator_autoset is called on post_probe
 - adjusted dm tests to pass with this changes

Changes from v1:
 - adapted description of regulator_set_enable
 - remove uc_pdata->enable_count from post_probe
 - added tests from counter and regulators post_probe
---

Svyatoslav Ryhel (4):
  power: regulator: expand basic reference counter onto all uclass
  test: dm: regulator: test counter in set_enable_if_allowed test
  power: regulator: Perform regulator setup inside uclass
  test: dm: regulator: provide test of auto setup

 drivers/power/regulator/regulator-uclass.c | 71 ++++++++++++++++++++--
 drivers/power/regulator/regulator_common.c | 22 -------
 drivers/power/regulator/regulator_common.h | 21 -------
 include/power/regulator.h                  |  2 +
 test/dm/regulator.c                        | 27 +++++++-
 5 files changed, 92 insertions(+), 51 deletions(-)

-- 
2.39.2



More information about the U-Boot mailing list