2024-03-10 01:02:48

by Andre Przywara

[permalink] [raw]
Subject: [PATCH 0/4] regulator: Add X-Powers AXP717 PMIC support

This patch series adds support for the X-Powers AXP717 PMIC, which is
used recently on new boards with Allwinner SoCs.
Allwinner's BSP code often speaks of the AXP2202, this seems to be the
same chip, at least a boot0 AXP2202 driver happily drove a chip labelled
AXP717.

Patch 1 fixes a typo in some macro names for the AXP313a PMIC, I just
realised that during some copy&paste action. It's just an identifier
rename, so not a backport candidate, I'd say.
Patch 2 adds the compatible string to the binding document.
Patch 3 is the MFD part, describing the regmap and all the interrupts.
So far we support the regulator and power key devices, the USB and
charging devices will follow later.
Patch 4 adds the voltage regulator rails, this part is crucial to enable
any board using this PMIC, as we depend on those rails even for basic
devices.

Please note that I could not test this driver myself, but had success
messages from others. It would be good to hear from Ryan and Chris
here on the list, with a Tested-by: tag.

This series is based on next-20240308 for now. I will send a rebased
update after the merge window, but wanted to start discussion and review
now.

Please have a look!

Cheers,
Andre

Andre Przywara (4):
regulator: axp20x: fix typo-ed identifier
dt-bindings: mfd: x-powers,axp152: document AXP717
mfd: axp20x: add support for AXP717 PMIC
regulator: axp20x: add support for the AXP717

.../bindings/mfd/x-powers,axp152.yaml | 2 +
drivers/mfd/axp20x-i2c.c | 2 +
drivers/mfd/axp20x-rsb.c | 1 +
drivers/mfd/axp20x.c | 90 +++++++++++++++++
drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++-
include/linux/mfd/axp20x.h | 98 ++++++++++++++++++-
6 files changed, 277 insertions(+), 10 deletions(-)

--
2.35.8



2024-03-10 01:03:00

by Andre Przywara

[permalink] [raw]
Subject: [PATCH 1/4] regulator: axp20x: fix typo-ed identifier

The registers to set the X-Powers AXP313 regulators are of course
"CONTROL" registers, not "CONRTOL" ones.

Fix the typo in the header file and in its users. No functional change.

Signed-off-by: Andre Przywara <[email protected]>
---
drivers/regulator/axp20x-regulator.c | 10 +++++-----
include/linux/mfd/axp20x.h | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index c657820b0bbb5..7bcc2d508b65a 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -733,21 +733,21 @@ static const struct linear_range axp313a_dcdc3_ranges[] = {
static const struct regulator_desc axp313a_regulators[] = {
AXP_DESC_RANGES(AXP313A, DCDC1, "dcdc1", "vin1",
axp313a_dcdc1_ranges, AXP313A_DCDC1_NUM_VOLTAGES,
- AXP313A_DCDC1_CONRTOL, AXP313A_DCDC_V_OUT_MASK,
+ AXP313A_DCDC1_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(0)),
AXP_DESC_RANGES(AXP313A, DCDC2, "dcdc2", "vin2",
axp313a_dcdc2_ranges, AXP313A_DCDC23_NUM_VOLTAGES,
- AXP313A_DCDC2_CONRTOL, AXP313A_DCDC_V_OUT_MASK,
+ AXP313A_DCDC2_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(1)),
AXP_DESC_RANGES(AXP313A, DCDC3, "dcdc3", "vin3",
axp313a_dcdc3_ranges, AXP313A_DCDC23_NUM_VOLTAGES,
- AXP313A_DCDC3_CONRTOL, AXP313A_DCDC_V_OUT_MASK,
+ AXP313A_DCDC3_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(2)),
AXP_DESC(AXP313A, ALDO1, "aldo1", "vin1", 500, 3500, 100,
- AXP313A_ALDO1_CONRTOL, AXP313A_LDO_V_OUT_MASK,
+ AXP313A_ALDO1_CONTROL, AXP313A_LDO_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(3)),
AXP_DESC(AXP313A, DLDO1, "dldo1", "vin1", 500, 3500, 100,
- AXP313A_DLDO1_CONRTOL, AXP313A_LDO_V_OUT_MASK,
+ AXP313A_DLDO1_CONTROL, AXP313A_LDO_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(4)),
AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
};
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index f1755163dd9f1..9b2b7ac2107f4 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -104,11 +104,11 @@ enum axp20x_variants {

#define AXP313A_ON_INDICATE 0x00
#define AXP313A_OUTPUT_CONTROL 0x10
-#define AXP313A_DCDC1_CONRTOL 0x13
-#define AXP313A_DCDC2_CONRTOL 0x14
-#define AXP313A_DCDC3_CONRTOL 0x15
-#define AXP313A_ALDO1_CONRTOL 0x16
-#define AXP313A_DLDO1_CONRTOL 0x17
+#define AXP313A_DCDC1_CONTROL 0x13
+#define AXP313A_DCDC2_CONTROL 0x14
+#define AXP313A_DCDC3_CONTROL 0x15
+#define AXP313A_ALDO1_CONTROL 0x16
+#define AXP313A_DLDO1_CONTROL 0x17
#define AXP313A_SHUTDOWN_CTRL 0x1a
#define AXP313A_IRQ_EN 0x20
#define AXP313A_IRQ_STATE 0x21
--
2.35.8


2024-03-10 01:03:08

by Andre Przywara

[permalink] [raw]
Subject: [PATCH 3/4] mfd: axp20x: add support for AXP717 PMIC

The AXP717a is a PMIC chip produced by X-Powers, it can be connected to
an I2C or RSB bus.

It's a rather complete PMIC, with many regulators, interrupts, an ADC and
battery charging functionality. It also offer USB type-C CC pin
handling.

Describe the regmap and the MFD bits, along with the registers exposed
via I2C or RSB. This covers the regulator, interrupts and power key
devices for now.
Advertise the device using the new compatible string.

Signed-off-by: Andre Przywara <[email protected]>
---
drivers/mfd/axp20x-i2c.c | 2 +
drivers/mfd/axp20x-rsb.c | 1 +
drivers/mfd/axp20x.c | 90 ++++++++++++++++++++++++++++++++++++++
include/linux/mfd/axp20x.h | 67 ++++++++++++++++++++++++++++
4 files changed, 160 insertions(+)

diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c
index 68d3560cfe4a0..b8e7ac89f6976 100644
--- a/drivers/mfd/axp20x-i2c.c
+++ b/drivers/mfd/axp20x-i2c.c
@@ -65,6 +65,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
{ .compatible = "x-powers,axp221", .data = (void *)AXP221_ID },
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
{ .compatible = "x-powers,axp313a", .data = (void *)AXP313A_ID },
+ { .compatible = "x-powers,axp717", .data = (void *)AXP717_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID },
@@ -81,6 +82,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
{ "axp221", 0 },
{ "axp223", 0 },
{ "axp313a", 0 },
+ { "axp717", 0 },
{ "axp803", 0 },
{ "axp806", 0 },
{ "axp15060", 0 },
diff --git a/drivers/mfd/axp20x-rsb.c b/drivers/mfd/axp20x-rsb.c
index 214bc0d84d44c..059656f2a1bd6 100644
--- a/drivers/mfd/axp20x-rsb.c
+++ b/drivers/mfd/axp20x-rsb.c
@@ -58,6 +58,7 @@ static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev)

static const struct of_device_id axp20x_rsb_of_match[] = {
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
+ { .compatible = "x-powers,axp717", .data = (void *)AXP717_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp809", .data = (void *)AXP809_ID },
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index d8daa593ebd53..48ce6ea693cea 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -42,6 +42,7 @@ static const char * const axp20x_model_names[] = {
"AXP223",
"AXP288",
"AXP313a",
+ "AXP717",
"AXP803",
"AXP806",
"AXP809",
@@ -207,6 +208,25 @@ static const struct regmap_access_table axp313a_volatile_table = {
.n_yes_ranges = ARRAY_SIZE(axp313a_volatile_ranges),
};

+static const struct regmap_range axp717_writeable_ranges[] = {
+ regmap_reg_range(AXP717_IRQ0_EN, AXP717_IRQ4_EN),
+ regmap_reg_range(AXP717_DCDC_OUTPUT_CONTROL, AXP717_CPUSLDO_CONTROL),
+};
+
+static const struct regmap_range axp717_volatile_ranges[] = {
+ regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
+};
+
+static const struct regmap_access_table axp717_writeable_table = {
+ .yes_ranges = axp717_writeable_ranges,
+ .n_yes_ranges = ARRAY_SIZE(axp717_writeable_ranges),
+};
+
+static const struct regmap_access_table axp717_volatile_table = {
+ .yes_ranges = axp717_volatile_ranges,
+ .n_yes_ranges = ARRAY_SIZE(axp717_volatile_ranges),
+};
+
static const struct regmap_range axp806_volatile_ranges[] = {
regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE),
};
@@ -317,6 +337,11 @@ static const struct resource axp313a_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP313A_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
};

+static const struct resource axp717_pek_resources[] = {
+ DEFINE_RES_IRQ_NAMED(AXP717_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
+ DEFINE_RES_IRQ_NAMED(AXP717_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
+};
+
static const struct resource axp803_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
@@ -391,6 +416,15 @@ static const struct regmap_config axp313a_regmap_config = {
.cache_type = REGCACHE_MAPLE,
};

+static const struct regmap_config axp717_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .wr_table = &axp717_writeable_table,
+ .volatile_table = &axp717_volatile_table,
+ .max_register = AXP717_CPUSLDO_CONTROL,
+ .cache_type = REGCACHE_RBTREE,
+};
+
static const struct regmap_config axp806_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -589,6 +623,40 @@ static const struct regmap_irq axp313a_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP313A, DIE_TEMP_HIGH, 0, 0),
};

+static const struct regmap_irq axp717_regmap_irqs[] = {
+ INIT_REGMAP_IRQ(AXP717, SOC_DROP_LVL2, 0, 7),
+ INIT_REGMAP_IRQ(AXP717, SOC_DROP_LVL1, 0, 6),
+ INIT_REGMAP_IRQ(AXP717, GAUGE_NEW_SOC, 0, 4),
+ INIT_REGMAP_IRQ(AXP717, BOOST_OVER_V, 0, 2),
+ INIT_REGMAP_IRQ(AXP717, VBUS_OVER_V, 0, 1),
+ INIT_REGMAP_IRQ(AXP717, VBUS_FAULT, 0, 0),
+ INIT_REGMAP_IRQ(AXP717, VBUS_PLUGIN, 1, 7),
+ INIT_REGMAP_IRQ(AXP717, VBUS_REMOVAL, 1, 6),
+ INIT_REGMAP_IRQ(AXP717, BATT_PLUGIN, 1, 5),
+ INIT_REGMAP_IRQ(AXP717, BATT_REMOVAL, 1, 4),
+ INIT_REGMAP_IRQ(AXP717, PEK_SHORT, 1, 3),
+ INIT_REGMAP_IRQ(AXP717, PEK_LONG, 1, 2),
+ INIT_REGMAP_IRQ(AXP717, PEK_FAL_EDGE, 1, 1),
+ INIT_REGMAP_IRQ(AXP717, PEK_RIS_EDGE, 1, 0),
+ INIT_REGMAP_IRQ(AXP717, WDOG_EXPIRE, 2, 7),
+ INIT_REGMAP_IRQ(AXP717, LDO_OVER_CURR, 2, 6),
+ INIT_REGMAP_IRQ(AXP717, BATT_OVER_CURR, 2, 5),
+ INIT_REGMAP_IRQ(AXP717, CHARG_DONE, 2, 4),
+ INIT_REGMAP_IRQ(AXP717, CHARG, 2, 3),
+ INIT_REGMAP_IRQ(AXP717, DIE_TEMP_HIGH, 2, 2),
+ INIT_REGMAP_IRQ(AXP717, CHARG_TIMER, 2, 1),
+ INIT_REGMAP_IRQ(AXP717, BATT_OVER_V, 2, 0),
+ INIT_REGMAP_IRQ(AXP717, BC_USB_DONE, 3, 7),
+ INIT_REGMAP_IRQ(AXP717, BC_USB_CHNG, 3, 6),
+ INIT_REGMAP_IRQ(AXP717, BATT_QUIT_TEMP_HIGH, 3, 4),
+ INIT_REGMAP_IRQ(AXP717, BATT_CHG_TEMP_HIGH, 3, 3),
+ INIT_REGMAP_IRQ(AXP717, BATT_CHG_TEMP_LOW, 3, 2),
+ INIT_REGMAP_IRQ(AXP717, BATT_ACT_TEMP_HIGH, 3, 1),
+ INIT_REGMAP_IRQ(AXP717, BATT_ACT_TEMP_LOW, 3, 0),
+ INIT_REGMAP_IRQ(AXP717, TYPEC_REMOVE, 4, 6),
+ INIT_REGMAP_IRQ(AXP717, TYPEC_PLUGIN, 4, 5),
+};
+
static const struct regmap_irq axp803_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP803, ACIN_OVER_V, 0, 7),
INIT_REGMAP_IRQ(AXP803, ACIN_PLUGIN, 0, 6),
@@ -776,6 +844,17 @@ static const struct regmap_irq_chip axp313a_regmap_irq_chip = {
.num_regs = 1,
};

+static const struct regmap_irq_chip axp717_regmap_irq_chip = {
+ .name = "axp717_irq_chip",
+ .status_base = AXP717_IRQ0_STATE,
+ .ack_base = AXP717_IRQ0_STATE,
+ .unmask_base = AXP717_IRQ0_EN,
+ .init_ack_masked = true,
+ .irqs = axp717_regmap_irqs,
+ .num_irqs = ARRAY_SIZE(axp717_regmap_irqs),
+ .num_regs = 5,
+};
+
static const struct regmap_irq_chip axp803_regmap_irq_chip = {
.name = "axp803",
.status_base = AXP20X_IRQ1_STATE,
@@ -941,6 +1020,11 @@ static struct mfd_cell axp313a_cells[] = {
MFD_CELL_RES("axp313a-pek", axp313a_pek_resources),
};

+static struct mfd_cell axp717_cells[] = {
+ MFD_CELL_NAME("axp20x-regulator"),
+ MFD_CELL_RES("axp20x-pek", axp717_pek_resources),
+};
+
static const struct resource axp288_adc_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"),
};
@@ -1181,6 +1265,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
axp20x->regmap_cfg = &axp313a_regmap_config;
axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip;
break;
+ case AXP717_ID:
+ axp20x->nr_cells = ARRAY_SIZE(axp717_cells);
+ axp20x->cells = axp717_cells;
+ axp20x->regmap_cfg = &axp717_regmap_config;
+ axp20x->regmap_irq_chip = &axp717_regmap_irq_chip;
+ break;
case AXP803_ID:
axp20x->nr_cells = ARRAY_SIZE(axp803_cells);
axp20x->cells = axp803_cells;
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index 9b2b7ac2107f4..fd7a41a69526f 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -19,6 +19,7 @@ enum axp20x_variants {
AXP223_ID,
AXP288_ID,
AXP313A_ID,
+ AXP717_ID,
AXP803_ID,
AXP806_ID,
AXP809_ID,
@@ -113,6 +114,38 @@ enum axp20x_variants {
#define AXP313A_IRQ_EN 0x20
#define AXP313A_IRQ_STATE 0x21

+#define AXP717_ON_INDICATE 0x00
+#define AXP717_IRQ0_EN 0x40
+#define AXP717_IRQ1_EN 0x41
+#define AXP717_IRQ2_EN 0x42
+#define AXP717_IRQ3_EN 0x43
+#define AXP717_IRQ4_EN 0x44
+#define AXP717_IRQ0_STATE 0x48
+#define AXP717_IRQ1_STATE 0x49
+#define AXP717_IRQ2_STATE 0x4a
+#define AXP717_IRQ3_STATE 0x4b
+#define AXP717_IRQ4_STATE 0x4c
+#define AXP717_DCDC_OUTPUT_CONTROL 0x80
+#define AXP717_DCDC1_CONTROL 0x83
+#define AXP717_DCDC2_CONTROL 0x84
+#define AXP717_DCDC3_CONTROL 0x85
+#define AXP717_DCDC4_CONTROL 0x86
+#define AXP717_LDO0_OUTPUT_CONTROL 0x90
+#define AXP717_LDO1_OUTPUT_CONTROL 0x91
+#define AXP717_ALDO1_CONTROL 0x93
+#define AXP717_ALDO2_CONTROL 0x94
+#define AXP717_ALDO3_CONTROL 0x95
+#define AXP717_ALDO4_CONTROL 0x96
+#define AXP717_BLDO1_CONTROL 0x97
+#define AXP717_BLDO2_CONTROL 0x98
+#define AXP717_BLDO3_CONTROL 0x99
+#define AXP717_BLDO4_CONTROL 0x9a
+#define AXP717_CLDO1_CONTROL 0x9b
+#define AXP717_CLDO2_CONTROL 0x9c
+#define AXP717_CLDO3_CONTROL 0x9d
+#define AXP717_CLDO4_CONTROL 0x9e
+#define AXP717_CPUSLDO_CONTROL 0x9f
+
#define AXP806_STARTUP_SRC 0x00
#define AXP806_CHIP_ID 0x03
#define AXP806_PWR_OUT_CTRL1 0x10
@@ -732,6 +765,40 @@ enum axp313a_irqs {
AXP313A_IRQ_PEK_RIS_EDGE,
};

+enum axp717_irqs {
+ AXP717_IRQ_VBUS_FAULT,
+ AXP717_IRQ_VBUS_OVER_V,
+ AXP717_IRQ_BOOST_OVER_V,
+ AXP717_IRQ_GAUGE_NEW_SOC = 4,
+ AXP717_IRQ_SOC_DROP_LVL1 = 6,
+ AXP717_IRQ_SOC_DROP_LVL2,
+ AXP717_IRQ_PEK_RIS_EDGE,
+ AXP717_IRQ_PEK_FAL_EDGE,
+ AXP717_IRQ_PEK_LONG,
+ AXP717_IRQ_PEK_SHORT,
+ AXP717_IRQ_BATT_REMOVAL,
+ AXP717_IRQ_BATT_PLUGIN,
+ AXP717_IRQ_VBUS_REMOVAL,
+ AXP717_IRQ_VBUS_PLUGIN,
+ AXP717_IRQ_BATT_OVER_V,
+ AXP717_IRQ_CHARG_TIMER,
+ AXP717_IRQ_DIE_TEMP_HIGH,
+ AXP717_IRQ_CHARG,
+ AXP717_IRQ_CHARG_DONE,
+ AXP717_IRQ_BATT_OVER_CURR,
+ AXP717_IRQ_LDO_OVER_CURR,
+ AXP717_IRQ_WDOG_EXPIRE,
+ AXP717_IRQ_BATT_ACT_TEMP_LOW,
+ AXP717_IRQ_BATT_ACT_TEMP_HIGH,
+ AXP717_IRQ_BATT_CHG_TEMP_LOW,
+ AXP717_IRQ_BATT_CHG_TEMP_HIGH,
+ AXP717_IRQ_BATT_QUIT_TEMP_HIGH,
+ AXP717_IRQ_BC_USB_CHNG = 30,
+ AXP717_IRQ_BC_USB_DONE,
+ AXP717_IRQ_TYPEC_PLUGIN = 37,
+ AXP717_IRQ_TYPEC_REMOVE,
+};
+
enum axp803_irqs {
AXP803_IRQ_ACIN_OVER_V = 1,
AXP803_IRQ_ACIN_PLUGIN,
--
2.35.8


2024-03-10 01:03:21

by Andre Przywara

[permalink] [raw]
Subject: [PATCH 2/4] dt-bindings: mfd: x-powers,axp152: document AXP717

The X-Powers AXP717 is a PMIC used on some newer Allwinner devices.
Among quite some regulators it features the usual ADC/IRQ/power key
parts, plus a battery charger circuit, and some newly introduced USB
type-C circuitry.
Like two other recent PMICs, it lacks the DC/DC converter PWM frequency
control register, that rate is fixed here as well.

Add the new compatible string, and add that to the list of PMICs without
the PWM frequency property.

Signed-off-by: Andre Przywara <[email protected]>
---
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
index 06f1779835a1e..b8e8db0d58e9c 100644
--- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
+++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
@@ -83,6 +83,7 @@ allOf:
enum:
- x-powers,axp313a
- x-powers,axp15060
+ - x-powers,axp717

then:
properties:
@@ -99,6 +100,7 @@ properties:
- x-powers,axp221
- x-powers,axp223
- x-powers,axp313a
+ - x-powers,axp717
- x-powers,axp803
- x-powers,axp806
- x-powers,axp809
--
2.35.8


2024-03-10 01:03:27

by Andre Przywara

[permalink] [raw]
Subject: [PATCH 4/4] regulator: axp20x: add support for the AXP717

The X-Powers AXP717 is a typical PMIC from X-Powers, featuring four
DC/DC converters and 15 LDOs, on the regulator side.

Describe the chip's voltage settings and switch registers, how the
voltages are encoded, and connect this to the MFD device via its
regulator ID.

Signed-off-by: Andre Przywara <[email protected]>
---
drivers/regulator/axp20x-regulator.c | 84 ++++++++++++++++++++++++++++
include/linux/mfd/axp20x.h | 21 +++++++
2 files changed, 105 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 7bcc2d508b65a..34fcdd82b2eaa 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -138,6 +138,12 @@
#define AXP313A_DCDC_V_OUT_MASK GENMASK(6, 0)
#define AXP313A_LDO_V_OUT_MASK GENMASK(4, 0)

+#define AXP717_DCDC1_NUM_VOLTAGES 88
+#define AXP717_DCDC2_NUM_VOLTAGES 107
+#define AXP717_DCDC3_NUM_VOLTAGES 104
+#define AXP717_DCDC_V_OUT_MASK GENMASK(6, 0)
+#define AXP717_LDO_V_OUT_MASK GENMASK(4, 0)
+
#define AXP803_PWR_OUT_DCDC1_MASK BIT_MASK(0)
#define AXP803_PWR_OUT_DCDC2_MASK BIT_MASK(1)
#define AXP803_PWR_OUT_DCDC3_MASK BIT_MASK(2)
@@ -752,6 +758,79 @@ static const struct regulator_desc axp313a_regulators[] = {
AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
};

+static const struct linear_range axp717_dcdc1_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
+};
+
+static const struct linear_range axp717_dcdc2_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
+ REGULATOR_LINEAR_RANGE(1600000, 88, 107, 100000),
+};
+
+static const struct linear_range axp717_dcdc3_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 71, 102, 20000),
+};
+
+static const struct regulator_desc axp717_regulators[] = {
+ AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
+ axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
+ AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
+ AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
+ axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
+ AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
+ AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
+ AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
+ axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
+ AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
+ AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
+ AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
+ AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
+ AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
+ AXP_DESC(AXP717, ALDO1, "aldo1", "vin1", 500, 3500, 100,
+ AXP717_ALDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC(AXP717, ALDO2, "aldo2", "vin1", 500, 3500, 100,
+ AXP717_ALDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(1)),
+ AXP_DESC(AXP717, ALDO3, "aldo3", "vin1", 500, 3500, 100,
+ AXP717_ALDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(2)),
+ AXP_DESC(AXP717, ALDO4, "aldo4", "vin1", 500, 3500, 100,
+ AXP717_ALDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(3)),
+ AXP_DESC(AXP717, BLDO1, "bldo1", "vin1", 500, 3500, 100,
+ AXP717_BLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(4)),
+ AXP_DESC(AXP717, BLDO2, "bldo2", "vin1", 500, 3500, 100,
+ AXP717_BLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(5)),
+ AXP_DESC(AXP717, BLDO3, "bldo3", "vin1", 500, 3500, 100,
+ AXP717_BLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(6)),
+ AXP_DESC(AXP717, BLDO4, "bldo4", "vin1", 500, 3500, 100,
+ AXP717_BLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO0_OUTPUT_CONTROL, BIT(7)),
+ AXP_DESC(AXP717, CLDO1, "cldo1", "vin1", 500, 3500, 100,
+ AXP717_CLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO1_OUTPUT_CONTROL, BIT(0)),
+ AXP_DESC(AXP717, CLDO2, "cldo2", "vin1", 500, 3500, 100,
+ AXP717_CLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO1_OUTPUT_CONTROL, BIT(1)),
+ AXP_DESC(AXP717, CLDO3, "cldo3", "vin1", 500, 3500, 100,
+ AXP717_CLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO1_OUTPUT_CONTROL, BIT(2)),
+ AXP_DESC(AXP717, CLDO4, "cldo4", "vin1", 500, 3500, 100,
+ AXP717_CLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO1_OUTPUT_CONTROL, BIT(3)),
+ AXP_DESC(AXP717, CPUSLDO, "cpusldo", "vin1", 500, 1400, 50,
+ AXP717_CPUSLDO_CONTROL, AXP717_LDO_V_OUT_MASK,
+ AXP717_LDO1_OUTPUT_CONTROL, BIT(4)),
+};
+
/* DCDC ranges shared with AXP813 */
static const struct linear_range axp803_dcdc234_ranges[] = {
REGULATOR_LINEAR_RANGE(500000,
@@ -1253,6 +1332,7 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
step = 150;
break;
case AXP313A_ID:
+ case AXP717_ID:
case AXP15060_ID:
/* The DCDC PWM frequency seems to be fixed to 3 MHz. */
if (dcdcfreq != 0) {
@@ -1479,6 +1559,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
regulators = axp313a_regulators;
nregulators = AXP313A_REG_ID_MAX;
break;
+ case AXP717_ID:
+ regulators = axp717_regulators;
+ nregulators = AXP717_REG_ID_MAX;
+ break;
case AXP803_ID:
regulators = axp803_regulators;
nregulators = AXP803_REG_ID_MAX;
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index fd7a41a69526f..8c0a33a2e9ce2 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -466,6 +466,27 @@ enum {
AXP313A_REG_ID_MAX,
};

+enum {
+ AXP717_DCDC1 = 0,
+ AXP717_DCDC2,
+ AXP717_DCDC3,
+ AXP717_DCDC4,
+ AXP717_ALDO1,
+ AXP717_ALDO2,
+ AXP717_ALDO3,
+ AXP717_ALDO4,
+ AXP717_BLDO1,
+ AXP717_BLDO2,
+ AXP717_BLDO3,
+ AXP717_BLDO4,
+ AXP717_CLDO1,
+ AXP717_CLDO2,
+ AXP717_CLDO3,
+ AXP717_CLDO4,
+ AXP717_CPUSLDO,
+ AXP717_REG_ID_MAX,
+};
+
enum {
AXP806_DCDCA = 0,
AXP806_DCDCB,
--
2.35.8


2024-03-10 08:40:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/4] dt-bindings: mfd: x-powers,axp152: document AXP717

On 10/03/2024 02:02, Andre Przywara wrote:
> The X-Powers AXP717 is a PMIC used on some newer Allwinner devices.
> Among quite some regulators it features the usual ADC/IRQ/power key
> parts, plus a battery charger circuit, and some newly introduced USB
> type-C circuitry.
> Like two other recent PMICs, it lacks the DC/DC converter PWM frequency
> control register, that rate is fixed here as well.
>
> Add the new compatible string, and add that to the list of PMICs without
> the PWM frequency property.

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


2024-03-11 07:35:27

by Ryan Walklin

[permalink] [raw]
Subject: Re: [PATCH 0/4] regulator: Add X-Powers AXP717 PMIC support

On Sun, 10 Mar 2024, at 2:02 PM, Andre Przywara wrote:
> This patch series adds support for the X-Powers AXP717 PMIC, which is
> used recently on new boards with Allwinner SoCs.

> Please note that I could not test this driver myself, but had success
> messages from others. It would be good to hear from Ryan and Chris
> here on the list, with a Tested-by: tag.

Thanks Andre, tested on an Allwinner H700-based board (Anbernic RG35XX+) with successful bringup of DRAM, boot and regulator reporting via /sys/kernel/debug/regulator/regulator_summary.

Battery charging not tested but according to vendor datasheet this functionality is internal to the PMIC and can complete without reference to the host, with informational reporting and charging parameters optionally modified by host over I2C or RSB.

Ryan

Tested-by: Ryan Walklin <[email protected]>


2024-03-11 22:21:14

by Samuel Holland

[permalink] [raw]
Subject: Re: [PATCH 2/4] dt-bindings: mfd: x-powers,axp152: document AXP717

Hi Andre,

On 3/9/24 19:02, Andre Przywara wrote:
> The X-Powers AXP717 is a PMIC used on some newer Allwinner devices.
> Among quite some regulators it features the usual ADC/IRQ/power key
> parts, plus a battery charger circuit, and some newly introduced USB
> type-C circuitry.

Do you plan to put the Type-C logic under a subnode, or should the
Type-C connector node go directly under the PMIC node? Either way, the
binding probably needs to be updated for that.

> Like two other recent PMICs, it lacks the DC/DC converter PWM frequency
> control register, that rate is fixed here as well.
>
> Add the new compatible string, and add that to the list of PMICs without
> the PWM frequency property.
>
> Signed-off-by: Andre Przywara <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 06f1779835a1e..b8e8db0d58e9c 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> @@ -83,6 +83,7 @@ allOf:
> enum:
> - x-powers,axp313a
> - x-powers,axp15060
> + - x-powers,axp717
>
> then:
> properties:
> @@ -99,6 +100,7 @@ properties:
> - x-powers,axp221
> - x-powers,axp223
> - x-powers,axp313a
> + - x-powers,axp717
> - x-powers,axp803
> - x-powers,axp806
> - x-powers,axp809

The regulators patternProperties needs to be updated for the new boost
regulator.

Regards,
Samuel


2024-03-11 22:22:53

by Samuel Holland

[permalink] [raw]
Subject: Re: [PATCH 4/4] regulator: axp20x: add support for the AXP717

Hi Andre,

On 3/9/24 19:02, Andre Przywara wrote:
> The X-Powers AXP717 is a typical PMIC from X-Powers, featuring four
> DC/DC converters and 15 LDOs, on the regulator side.
>
> Describe the chip's voltage settings and switch registers, how the
> voltages are encoded, and connect this to the MFD device via its
> regulator ID.
>
> Signed-off-by: Andre Przywara <[email protected]>
> ---
> drivers/regulator/axp20x-regulator.c | 84 ++++++++++++++++++++++++++++
> include/linux/mfd/axp20x.h | 21 +++++++
> 2 files changed, 105 insertions(+)

This is missing support for the boost regulator.

Regards,
Samuel


2024-03-12 14:19:39

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 4/4] regulator: axp20x: add support for the AXP717

On Mon, Mar 11, 2024 at 05:22:41PM -0500, Samuel Holland wrote:
> On 3/9/24 19:02, Andre Przywara wrote:

> > The X-Powers AXP717 is a typical PMIC from X-Powers, featuring four
> > DC/DC converters and 15 LDOs, on the regulator side.
> >
> > Describe the chip's voltage settings and switch registers, how the
> > voltages are encoded, and connect this to the MFD device via its
> > regulator ID.

> This is missing support for the boost regulator.

That can always be added incrementally.


Attachments:
(No filename) (504.00 B)
signature.asc (499.00 B)
Download all attachments

2024-03-12 14:19:54

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 4/4] regulator: axp20x: add support for the AXP717

On Sun, Mar 10, 2024 at 01:02:11AM +0000, Andre Przywara wrote:
> The X-Powers AXP717 is a typical PMIC from X-Powers, featuring four
> DC/DC converters and 15 LDOs, on the regulator side.
>
> Describe the chip's voltage settings and switch registers, how the
> voltages are encoded, and connect this to the MFD device via its
> regulator ID.

Acked-by: Mark Brown <[email protected]>


Attachments:
(No filename) (396.00 B)
signature.asc (499.00 B)
Download all attachments

2024-03-13 18:37:44

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH 1/4] regulator: axp20x: fix typo-ed identifier

Dne nedelja, 10. marec 2024 ob 02:02:08 CET je Andre Przywara napisal(a):
> The registers to set the X-Powers AXP313 regulators are of course
> "CONTROL" registers, not "CONRTOL" ones.
>
> Fix the typo in the header file and in its users. No functional change.
>
> Signed-off-by: Andre Przywara <[email protected]>

Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej



2024-03-13 18:39:37

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH 3/4] mfd: axp20x: add support for AXP717 PMIC

Dne nedelja, 10. marec 2024 ob 02:02:10 CET je Andre Przywara napisal(a):
> The AXP717a is a PMIC chip produced by X-Powers, it can be connected to
> an I2C or RSB bus.
>
> It's a rather complete PMIC, with many regulators, interrupts, an ADC and
> battery charging functionality. It also offer USB type-C CC pin
> handling.
>
> Describe the regmap and the MFD bits, along with the registers exposed
> via I2C or RSB. This covers the regulator, interrupts and power key
> devices for now.
> Advertise the device using the new compatible string.
>
> Signed-off-by: Andre Przywara <[email protected]>

Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej



2024-03-13 18:50:39

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH 2/4] dt-bindings: mfd: x-powers,axp152: document AXP717

On Mon, 11 Mar 2024 17:20:50 -0500
Samuel Holland <[email protected]> wrote:

Hi Samuel,

thanks for having a look!

> On 3/9/24 19:02, Andre Przywara wrote:
> > The X-Powers AXP717 is a PMIC used on some newer Allwinner devices.
> > Among quite some regulators it features the usual ADC/IRQ/power key
> > parts, plus a battery charger circuit, and some newly introduced USB
> > type-C circuitry.
>
> Do you plan to put the Type-C logic under a subnode, or should the
> Type-C connector node go directly under the PMIC node? Either way, the
> binding probably needs to be updated for that.

I haven't looked into this yet, so cannot say which way to go. I
definitely consider this some non-trivial task, so indeed wanted to push
this off to later.
For now there is a device (Anbernic RG35XX) with that PMIC, so we need at
least the regulators to unblock this. USB support is not critical for now.

> > Like two other recent PMICs, it lacks the DC/DC converter PWM frequency
> > control register, that rate is fixed here as well.
> >
> > Add the new compatible string, and add that to the list of PMICs without
> > the PWM frequency property.
> >
> > Signed-off-by: Andre Przywara <[email protected]>
> > ---
> > Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > index 06f1779835a1e..b8e8db0d58e9c 100644
> > --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > @@ -83,6 +83,7 @@ allOf:
> > enum:
> > - x-powers,axp313a
> > - x-powers,axp15060
> > + - x-powers,axp717
> >
> > then:
> > properties:
> > @@ -99,6 +100,7 @@ properties:
> > - x-powers,axp221
> > - x-powers,axp223
> > - x-powers,axp313a
> > + - x-powers,axp717
> > - x-powers,axp803
> > - x-powers,axp806
> > - x-powers,axp809
>
> The regulators patternProperties needs to be updated for the new boost
> regulator.

Ah, I indeed missed this one. I think the former PMICs had this
batter->VBUS boost regulator hidden, controlled entirely by the PMIC?
I will need to check if exposing this will present any surprises. I
guess this goes together with the USB-C support, to have role switching,
unless this appears on some device with just USB-A or micro-B.
I will check what it takes to add this one, the regulator itself looks
easy.

Thanks!
Andre.

2024-03-13 19:20:56

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH 2/4] dt-bindings: mfd: x-powers,axp152: document AXP717

On Thu, Mar 14, 2024 at 1:35 AM Andre Przywara <[email protected]> wrote:
>
> On Mon, 11 Mar 2024 17:20:50 -0500
> Samuel Holland <[email protected]> wrote:
>
> Hi Samuel,
>
> thanks for having a look!
>
> > On 3/9/24 19:02, Andre Przywara wrote:
> > > The X-Powers AXP717 is a PMIC used on some newer Allwinner devices.
> > > Among quite some regulators it features the usual ADC/IRQ/power key
> > > parts, plus a battery charger circuit, and some newly introduced USB
> > > type-C circuitry.
> >
> > Do you plan to put the Type-C logic under a subnode, or should the
> > Type-C connector node go directly under the PMIC node? Either way, the
> > binding probably needs to be updated for that.
>
> I haven't looked into this yet, so cannot say which way to go. I
> definitely consider this some non-trivial task, so indeed wanted to push
> this off to later.
> For now there is a device (Anbernic RG35XX) with that PMIC, so we need at
> least the regulators to unblock this. USB support is not critical for now.
>
> > > Like two other recent PMICs, it lacks the DC/DC converter PWM frequency
> > > control register, that rate is fixed here as well.
> > >
> > > Add the new compatible string, and add that to the list of PMICs without
> > > the PWM frequency property.
> > >
> > > Signed-off-by: Andre Przywara <[email protected]>
> > > ---
> > > Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > > index 06f1779835a1e..b8e8db0d58e9c 100644
> > > --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > > +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > > @@ -83,6 +83,7 @@ allOf:
> > > enum:
> > > - x-powers,axp313a
> > > - x-powers,axp15060
> > > + - x-powers,axp717
> > >
> > > then:
> > > properties:
> > > @@ -99,6 +100,7 @@ properties:
> > > - x-powers,axp221
> > > - x-powers,axp223
> > > - x-powers,axp313a
> > > + - x-powers,axp717
> > > - x-powers,axp803
> > > - x-powers,axp806
> > > - x-powers,axp809
> >
> > The regulators patternProperties needs to be updated for the new boost
> > regulator.
>
> Ah, I indeed missed this one. I think the former PMICs had this
> batter->VBUS boost regulator hidden, controlled entirely by the PMIC?
> I will need to check if exposing this will present any surprises. I
> guess this goes together with the USB-C support, to have role switching,
> unless this appears on some device with just USB-A or micro-B.
> I will check what it takes to add this one, the regulator itself looks
> easy.

I don't think there was such a boost regulator on previous PMICs. It was
just a passthrough, which is why on some boards such as the Cubietruck
there is an external boost converter to put out 5V when just the battery
is used.

ChenYu

2024-03-21 17:11:10

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 0/4] regulator: Add X-Powers AXP717 PMIC support

On Sun, 10 Mar 2024, Andre Przywara wrote:

> This patch series adds support for the X-Powers AXP717 PMIC, which is
> used recently on new boards with Allwinner SoCs.
> Allwinner's BSP code often speaks of the AXP2202, this seems to be the
> same chip, at least a boot0 AXP2202 driver happily drove a chip labelled
> AXP717.
>
> Patch 1 fixes a typo in some macro names for the AXP313a PMIC, I just
> realised that during some copy&paste action. It's just an identifier
> rename, so not a backport candidate, I'd say.
> Patch 2 adds the compatible string to the binding document.
> Patch 3 is the MFD part, describing the regmap and all the interrupts.
> So far we support the regulator and power key devices, the USB and
> charging devices will follow later.
> Patch 4 adds the voltage regulator rails, this part is crucial to enable
> any board using this PMIC, as we depend on those rails even for basic
> devices.
>
> Please note that I could not test this driver myself, but had success
> messages from others. It would be good to hear from Ryan and Chris
> here on the list, with a Tested-by: tag.
>
> This series is based on next-20240308 for now. I will send a rebased
> update after the merge window, but wanted to start discussion and review
> now.
>
> Please have a look!
>
> Cheers,
> Andre
>
> Andre Przywara (4):
> regulator: axp20x: fix typo-ed identifier
> dt-bindings: mfd: x-powers,axp152: document AXP717
> mfd: axp20x: add support for AXP717 PMIC
> regulator: axp20x: add support for the AXP717
>
> .../bindings/mfd/x-powers,axp152.yaml | 2 +
> drivers/mfd/axp20x-i2c.c | 2 +
> drivers/mfd/axp20x-rsb.c | 1 +
> drivers/mfd/axp20x.c | 90 +++++++++++++++++
> drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++-
> include/linux/mfd/axp20x.h | 98 ++++++++++++++++++-
> 6 files changed, 277 insertions(+), 10 deletions(-)

All applied and sent for build testing. If everything works out, I'll
send out a pull-request to an immutable branch shortly.

--
Lee Jones [李琼斯]

2024-03-22 08:10:50

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 0/4] regulator: Add X-Powers AXP717 PMIC support

On Thu, 21 Mar 2024, Lee Jones wrote:

> On Sun, 10 Mar 2024, Andre Przywara wrote:
>
> > This patch series adds support for the X-Powers AXP717 PMIC, which is
> > used recently on new boards with Allwinner SoCs.
> > Allwinner's BSP code often speaks of the AXP2202, this seems to be the
> > same chip, at least a boot0 AXP2202 driver happily drove a chip labelled
> > AXP717.
> >
> > Patch 1 fixes a typo in some macro names for the AXP313a PMIC, I just
> > realised that during some copy&paste action. It's just an identifier
> > rename, so not a backport candidate, I'd say.
> > Patch 2 adds the compatible string to the binding document.
> > Patch 3 is the MFD part, describing the regmap and all the interrupts.
> > So far we support the regulator and power key devices, the USB and
> > charging devices will follow later.
> > Patch 4 adds the voltage regulator rails, this part is crucial to enable
> > any board using this PMIC, as we depend on those rails even for basic
> > devices.
> >
> > Please note that I could not test this driver myself, but had success
> > messages from others. It would be good to hear from Ryan and Chris
> > here on the list, with a Tested-by: tag.
> >
> > This series is based on next-20240308 for now. I will send a rebased
> > update after the merge window, but wanted to start discussion and review
> > now.
> >
> > Please have a look!
> >
> > Cheers,
> > Andre
> >
> > Andre Przywara (4):
> > regulator: axp20x: fix typo-ed identifier
> > dt-bindings: mfd: x-powers,axp152: document AXP717
> > mfd: axp20x: add support for AXP717 PMIC
> > regulator: axp20x: add support for the AXP717
> >
> > .../bindings/mfd/x-powers,axp152.yaml | 2 +
> > drivers/mfd/axp20x-i2c.c | 2 +
> > drivers/mfd/axp20x-rsb.c | 1 +
> > drivers/mfd/axp20x.c | 90 +++++++++++++++++
> > drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++-
> > include/linux/mfd/axp20x.h | 98 ++++++++++++++++++-
> > 6 files changed, 277 insertions(+), 10 deletions(-)
>
> All applied and sent for build testing. If everything works out, I'll
> send out a pull-request to an immutable branch shortly.

Okay, these are building okay based on v6.8.

I'll send out a PR once I can rebase tem onto v6.9-rc1.

Note to self: ib-mfd-regulator-6.9

--
Lee Jones [李琼斯]

2024-03-28 09:56:55

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL] Immutable branch between MFD and Regulator due for the v6.9 merge window:wq

Enjoy!

The following changes since commit 4cece764965020c22cff7665b18a012006359095:

Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-v6.9

for you to fetch changes up to d2ac3df75c3a995064cfac0171e082a30d8c4c66:

regulator: axp20x: add support for the AXP717 (2024-03-28 09:51:03 +0000)

----------------------------------------------------------------
Immutable branch between MFD and Regulator due for the v6.9 merge window

----------------------------------------------------------------
Andre Przywara (4):
regulator: axp20x: fix typo-ed identifier
dt-bindings: mfd: x-powers,axp152: Document AXP717
mfd: axp20x: Add support for AXP717 PMIC
regulator: axp20x: add support for the AXP717

.../devicetree/bindings/mfd/x-powers,axp152.yaml | 2 +
drivers/mfd/axp20x-i2c.c | 2 +
drivers/mfd/axp20x-rsb.c | 1 +
drivers/mfd/axp20x.c | 90 ++++++++++++++++++++
drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++++--
include/linux/mfd/axp20x.h | 98 ++++++++++++++++++++--
6 files changed, 277 insertions(+), 10 deletions(-)

--
Lee Jones [李琼斯]

2024-03-28 11:11:34

by Andre Przywara

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Regulator due for the v6.9 merge window:wq

On Thu, 28 Mar 2024 09:56:31 +0000
Lee Jones <[email protected]> wrote:

Hi Lee,

many thanks for picking this up!

> Enjoy!
>
> The following changes since commit 4cece764965020c22cff7665b18a012006359095:
>
> Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-v6.9
>
> for you to fetch changes up to d2ac3df75c3a995064cfac0171e082a30d8c4c66:
>
> regulator: axp20x: add support for the AXP717 (2024-03-28 09:51:03 +0000)
>
> ----------------------------------------------------------------
> Immutable branch between MFD and Regulator due for the v6.9 merge window

Did you mean v6.10 merge window? Or is there a plan to merge this into
6.9 still?

Also I found some issue with the LDOs' supply voltage: there are not
all the same, as described right now. Fix is quite easy, how do you
want to take this? As a follow up patch? And would this be squashed or
kept separate?
Or do you want we to send a new version? If yes, based on what branch?

Thanks,
Andre

>
> ----------------------------------------------------------------
> Andre Przywara (4):
> regulator: axp20x: fix typo-ed identifier
> dt-bindings: mfd: x-powers,axp152: Document AXP717
> mfd: axp20x: Add support for AXP717 PMIC
> regulator: axp20x: add support for the AXP717
>
> .../devicetree/bindings/mfd/x-powers,axp152.yaml | 2 +
> drivers/mfd/axp20x-i2c.c | 2 +
> drivers/mfd/axp20x-rsb.c | 1 +
> drivers/mfd/axp20x.c | 90 ++++++++++++++++++++
> drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++++--
> include/linux/mfd/axp20x.h | 98 ++++++++++++++++++++--
> 6 files changed, 277 insertions(+), 10 deletions(-)
>


2024-03-28 12:00:25

by Lee Jones

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Regulator due for the v6.9 merge window:wq

On Thu, 28 Mar 2024, Andre Przywara wrote:

> On Thu, 28 Mar 2024 09:56:31 +0000
> Lee Jones <[email protected]> wrote:
>
> Hi Lee,
>
> many thanks for picking this up!
>
> > Enjoy!
> >
> > The following changes since commit 4cece764965020c22cff7665b18a012006359095:
> >
> > Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
> >
> > are available in the Git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-v6.9
> >
> > for you to fetch changes up to d2ac3df75c3a995064cfac0171e082a30d8c4c66:
> >
> > regulator: axp20x: add support for the AXP717 (2024-03-28 09:51:03 +0000)
> >
> > ----------------------------------------------------------------
> > Immutable branch between MFD and Regulator due for the v6.9 merge window
>
> Did you mean v6.10 merge window? Or is there a plan to merge this into
> 6.9 still?

Yes - off-by-one!

> Also I found some issue with the LDOs' supply voltage: there are not
> all the same, as described right now. Fix is quite easy, how do you
> want to take this? As a follow up patch? And would this be squashed or
> kept separate?
> Or do you want we to send a new version? If yes, based on what branch?

Please submit a fix-up.

I'll sent out a new (ib-mfd-regulator-v6.9-1) PR based on this one.

> > ----------------------------------------------------------------
> > Andre Przywara (4):
> > regulator: axp20x: fix typo-ed identifier
> > dt-bindings: mfd: x-powers,axp152: Document AXP717
> > mfd: axp20x: Add support for AXP717 PMIC
> > regulator: axp20x: add support for the AXP717
> >
> > .../devicetree/bindings/mfd/x-powers,axp152.yaml | 2 +
> > drivers/mfd/axp20x-i2c.c | 2 +
> > drivers/mfd/axp20x-rsb.c | 1 +
> > drivers/mfd/axp20x.c | 90 ++++++++++++++++++++
> > drivers/regulator/axp20x-regulator.c | 94 +++++++++++++++++++--
> > include/linux/mfd/axp20x.h | 98 ++++++++++++++++++++--
> > 6 files changed, 277 insertions(+), 10 deletions(-)
> >
>

--
Lee Jones [李琼斯]

2024-03-28 12:03:43

by Lee Jones

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Regulator due for the v6.9 merge window:wq

On Thu, 28 Mar 2024, Lee Jones wrote:

> On Thu, 28 Mar 2024, Andre Przywara wrote:
>
> > On Thu, 28 Mar 2024 09:56:31 +0000
> > Lee Jones <[email protected]> wrote:
> >
> > Hi Lee,
> >
> > many thanks for picking this up!
> >
> > > Enjoy!
> > >
> > > The following changes since commit 4cece764965020c22cff7665b18a012006359095:
> > >
> > > Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
> > >
> > > are available in the Git repository at:
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-v6.9
> > >
> > > for you to fetch changes up to d2ac3df75c3a995064cfac0171e082a30d8c4c66:
> > >
> > > regulator: axp20x: add support for the AXP717 (2024-03-28 09:51:03 +0000)
> > >
> > > ----------------------------------------------------------------
> > > Immutable branch between MFD and Regulator due for the v6.9 merge window
> >
> > Did you mean v6.10 merge window? Or is there a plan to merge this into
> > 6.9 still?
>
> Yes - off-by-one!

Just recreated ib-mfd-regulator-v6.10 for all the OCD types (like me!).

--
Lee Jones [李琼斯]