[PATCH 3/7] regulator: axp20x: Add support for the AXP2101

From: Olivier Louvignes

Date: Fri Oct 23 2026 - 06:05:29 EST


DCDC1 (1.5-3.4 V), DCDC2-4 (0.5-1.2 V by 10 mV, then 20 mV steps, DCDC3
up to 3.4 V by 100 mV), DCDC5 (1.4-3.7 V and 1.2 V), ALDO1-4 and BLDO1-2
(0.5-3.5 V), DLDO1 (0.5-3.4 V), and DLDO2 and CPUSLDO (0.5-1.4 V by 50
mV). The DCDC frequency is not known to be configurable.

On a HiBy R1 the selector values read back as the voltages the stock
firmware sets: DCDC1 3.3 V, DCDC2 1.1 V, DCDC3 1.8 V, DCDC4 1.2 V.

Signed-off-by: Olivier Louvignes <olivier@xxxxxxxxx>
---
drivers/regulator/axp20x-regulator.c | 88 ++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index ec6ec071ffde..42d0aec1173b 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -765,6 +765,81 @@ static const struct regulator_desc axp313a_regulators[] = {
AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
};

+static const struct linear_range axp2101_dcdc2_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
+};
+
+static const struct linear_range axp2101_dcdc3_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
+ REGULATOR_LINEAR_RANGE(1600000, 88, 106, 100000),
+};
+
+static const struct linear_range axp2101_dcdc4_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 102, 20000),
+};
+
+/* DCDC5 has 1.4-3.7 V in 100 mV steps, and 1.2 V on selector 25. */
+static const struct linear_range axp2101_dcdc5_ranges[] = {
+ REGULATOR_LINEAR_RANGE(1400000, 0, 23, 100000),
+ REGULATOR_LINEAR_RANGE(1200000, 25, 25, 0),
+};
+
+#define AXP2101_DCDC_V_OUT_MASK GENMASK(6, 0)
+#define AXP2101_DCDC15_V_OUT_MASK GENMASK(4, 0)
+#define AXP2101_LDO_V_OUT_MASK GENMASK(4, 0)
+
+static const struct regulator_desc axp2101_regulators[] = {
+ AXP_DESC(AXP2101, DCDC1, "dcdc1", "vin1", 1500, 3400, 100,
+ AXP2101_DCDC1_CONTROL, AXP2101_DCDC15_V_OUT_MASK,
+ AXP2101_DCDC_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC_RANGES(AXP2101, DCDC2, "dcdc2", "vin2",
+ axp2101_dcdc2_ranges, 88,
+ AXP2101_DCDC2_CONTROL, AXP2101_DCDC_V_OUT_MASK,
+ AXP2101_DCDC_OUTPUT_CONTROL, BIT(1)),
+ AXP_DESC_RANGES(AXP2101, DCDC3, "dcdc3", "vin3",
+ axp2101_dcdc3_ranges, 107,
+ AXP2101_DCDC3_CONTROL, AXP2101_DCDC_V_OUT_MASK,
+ AXP2101_DCDC_OUTPUT_CONTROL, BIT(2)),
+ AXP_DESC_RANGES(AXP2101, DCDC4, "dcdc4", "vin4",
+ axp2101_dcdc4_ranges, 103,
+ AXP2101_DCDC4_CONTROL, AXP2101_DCDC_V_OUT_MASK,
+ AXP2101_DCDC_OUTPUT_CONTROL, BIT(3)),
+ AXP_DESC_RANGES(AXP2101, DCDC5, "dcdc5", "vin5",
+ axp2101_dcdc5_ranges, 26,
+ AXP2101_DCDC5_CONTROL, AXP2101_DCDC15_V_OUT_MASK,
+ AXP2101_DCDC_OUTPUT_CONTROL, BIT(4)),
+ AXP_DESC(AXP2101, ALDO1, "aldo1", "aldoin", 500, 3500, 100,
+ AXP2101_ALDO1_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC(AXP2101, ALDO2, "aldo2", "aldoin", 500, 3500, 100,
+ AXP2101_ALDO2_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(1)),
+ AXP_DESC(AXP2101, ALDO3, "aldo3", "aldoin", 500, 3500, 100,
+ AXP2101_ALDO3_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(2)),
+ AXP_DESC(AXP2101, ALDO4, "aldo4", "aldoin", 500, 3500, 100,
+ AXP2101_ALDO4_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(3)),
+ AXP_DESC(AXP2101, BLDO1, "bldo1", "bldoin", 500, 3500, 100,
+ AXP2101_BLDO1_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(4)),
+ AXP_DESC(AXP2101, BLDO2, "bldo2", "bldoin", 500, 3500, 100,
+ AXP2101_BLDO2_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(5)),
+ AXP_DESC(AXP2101, DLDO1, "dldo1", "dldoin", 500, 3400, 100,
+ AXP2101_DLDO1_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(7)),
+ AXP_DESC(AXP2101, DLDO2, "dldo2", "dldoin", 500, 1400, 50,
+ AXP2101_DLDO2_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO1_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC(AXP2101, CPUSLDO, "cpusldo", "cpusldoin", 500, 1400, 50,
+ AXP2101_CPUSLDO_CONTROL, AXP2101_LDO_V_OUT_MASK,
+ AXP2101_LDO0_OUTPUT_CONTROL, BIT(6)),
+};
+
static const struct linear_range axp717_dcdc1_ranges[] = {
REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
@@ -1346,6 +1421,15 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
def = 3000;
step = 150;
break;
+ case AXP2101_ID:
+ /* Not known to be configurable. */
+ if (dcdcfreq != 0) {
+ dev_err(&pdev->dev,
+ "DCDC frequency on this PMIC is not configurable.\n");
+ return -EINVAL;
+ }
+
+ return 0;
case AXP313A_ID:
case AXP323_ID:
case AXP717_ID:
@@ -1589,6 +1673,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
regulators = axp717_regulators;
nregulators = AXP717_REG_ID_MAX;
break;
+ case AXP2101_ID:
+ regulators = axp2101_regulators;
+ nregulators = AXP2101_REG_ID_MAX;
+ break;
case AXP803_ID:
regulators = axp803_regulators;
nregulators = AXP803_REG_ID_MAX;
--
2.39.5