summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-02-23 14:49:44 +0000
committerMark Brown <broonie@kernel.org>2026-02-23 14:49:44 +0000
commitf308205e3b370d0bb4be696ae678b0f0ce65d2c7 (patch)
treeab82f439a8a96b985887159d8ff3819aa784548c /drivers
parent0556bb42a84ee391a2145ddba86756f9747bc27f (diff)
parentfbb4c52ccdcb4a612d2b7f800aa57090eeee16d7 (diff)
regulator: spacemit-p1: Support board power tree
Merge series from Guodong Xu <guodong@riscstar.com>: Patch 1, 2 and 3 (previously 2-4) enable flexible power tree configurations for the SpacemiT P1 PMIC. Hardcoded supply assumptions are replaced with explicit devicetree properties. PMIC supply connections are board-design decisions. Moving this to DT allows supporting varied topologies without driver modifications. The supply binding change is an ABI change. The breakage is acceptable: Yixun Lan checked the DTS tree queued for v6.20 and found no consumers of the P1/PMIC regulator yet [1]. For the two K1 boards in-tree (BPI-F3 and Jupiter), initial power settings come from boot firmware and a probe failure of pmic node "spacemit,p1" has minimal impact. In v4, the old "vin-supply" property is dropped from the binding document as the updated driver no longer parses it and there is no fallback logic. Only the per-rail names ("vin1-supply", "vin2-supply", ...) are supported going forward. Intermittent dtbs_check warnings are expected while the binding and DTS changes land through different trees, but will resolve once both are merged. Link: https://lore.kernel.org/lkml/20260125110333-GYD71302@gentoo.org/ [1]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/spacemit-p1.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/regulator/spacemit-p1.c b/drivers/regulator/spacemit-p1.c
index 2b585ba01a93..57e6e00a73fa 100644
--- a/drivers/regulator/spacemit-p1.c
+++ b/drivers/regulator/spacemit-p1.c
@@ -87,13 +87,16 @@ static const struct linear_range p1_ldo_ranges[] = {
}
#define P1_BUCK_DESC(_n) \
- P1_REG_DESC(BUCK, buck, _n, "vin", 0x47, BUCK_MASK, 255, p1_buck_ranges)
+ P1_REG_DESC(BUCK, buck, _n, "vin" #_n, 0x47, BUCK_MASK, 255, p1_buck_ranges)
#define P1_ALDO_DESC(_n) \
- P1_REG_DESC(ALDO, aldo, _n, "vin", 0x5b, LDO_MASK, 128, p1_ldo_ranges)
+ P1_REG_DESC(ALDO, aldo, _n, "aldoin", 0x5b, LDO_MASK, 128, p1_ldo_ranges)
-#define P1_DLDO_DESC(_n) \
- P1_REG_DESC(DLDO, dldo, _n, "buck5", 0x67, LDO_MASK, 128, p1_ldo_ranges)
+#define P1_DLDO1_DESC(_n) \
+ P1_REG_DESC(DLDO, dldo, _n, "dldoin1", 0x67, LDO_MASK, 128, p1_ldo_ranges)
+
+#define P1_DLDO2_DESC(_n) \
+ P1_REG_DESC(DLDO, dldo, _n, "dldoin2", 0x67, LDO_MASK, 128, p1_ldo_ranges)
static const struct regulator_desc p1_regulator_desc[] = {
P1_BUCK_DESC(1),
@@ -108,13 +111,13 @@ static const struct regulator_desc p1_regulator_desc[] = {
P1_ALDO_DESC(3),
P1_ALDO_DESC(4),
- P1_DLDO_DESC(1),
- P1_DLDO_DESC(2),
- P1_DLDO_DESC(3),
- P1_DLDO_DESC(4),
- P1_DLDO_DESC(5),
- P1_DLDO_DESC(6),
- P1_DLDO_DESC(7),
+ P1_DLDO1_DESC(1),
+ P1_DLDO1_DESC(2),
+ P1_DLDO1_DESC(3),
+ P1_DLDO1_DESC(4),
+ P1_DLDO2_DESC(5),
+ P1_DLDO2_DESC(6),
+ P1_DLDO2_DESC(7),
};
static int p1_regulator_probe(struct platform_device *pdev)