Files
build/patch/kernel/archive/sunxi-dev-6.16/19-regulator-axp20x-force-polyphase-setup-for-axp323.patch
The-going e31992ae7c sun55iw3: move patches to archive/sunxi-dev-6.16 folder
When patches outside the series are in the target folder
KERNELPATCHDIR = "archive/sunxi- $ {KERNEL _ MAJOR _ MINOR}"
they create problems for all other patches in the series
and are difficult to move to the new kernel version because
they are not properly designed.

Move the patches to a separate development folder until
the design is fixed so that we can add them to the series.
2025-09-15 19:46:23 +02:00

136 lines
4.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Juan Sanchez <juanesf91@gmail.com>
Date: Sun, 6 Jul 2025 00:31:46 -0400
Subject: From: iuncuim <iuncuim@gmail.com> Date: Mon, 7 Apr 2025 03:28:37
+0300 Subject: [PATCH] regulator: axp20x: force polyphase setup for axp323
Signed-off-by: Juan Sanchez <juanesf91@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 3 ++
arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 3 ++
arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 3 ++
arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts | 3 ++
drivers/regulator/axp20x-regulator.c | 19 ++++++++++
5 files changed, 31 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
index f7a6221d02c2..369bde1556ff 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
@@ -330,10 +330,13 @@ reg_dcdc1_323: dcdc1 {
regulator-max-microvolt = <1160000>;
regulator-name = "vdd-cpub";
};
/* DCDC2 is polyphased with DCDC1 */
+ reg_dcdc2_323: dcdc2 {
+ x-powers,polyphased;
+ };
/* RISC-V management core supply */
reg_dcdc3_323: dcdc3 {
regulator-always-on;
regulator-min-microvolt = <900000>;
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts b/arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts
index 0d7fb419c9b4..5732088add32 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts
+++ b/arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts
@@ -253,10 +253,13 @@ reg_dcdc1_323: dcdc1 {
regulator-max-microvolt = <1160000>;
regulator-name = "vdd-cpub";
};
/* DCDC2 is polyphased with DCDC1 */
+ reg_dcdc2_323: dcdc2 {
+ x-powers,polyphased;
+ };
reg_dcdc3_323: dcdc3 {
regulator-always-on;
regulator-min-microvolt = <1050000>;
regulator-max-microvolt = <1050000>;
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts b/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts
index 4f2366b3624a..bd1ebb15bb3e 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts
@@ -283,10 +283,13 @@ reg_dcdc1_323: dcdc1 {
regulator-max-microvolt = <1160000>;
regulator-name = "vdd-cpub";
};
/* DCDC2 is polyphased with DCDC1 */
+ reg_dcdc2_323: dcdc2 {
+ x-powers,polyphased;
+ };
/* Some RISC-V management core related voltage */
reg_dcdc3_323: dcdc3 {
regulator-always-on;
regulator-min-microvolt = <900000>;
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts
index d1ffc9faec80..fb7933091edf 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts
+++ b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts
@@ -321,10 +321,13 @@ reg_dcdc1_323: dcdc1 {
regulator-max-microvolt = <1150000>;
regulator-name = "vdd-cpub";
};
/* DCDC2 is polyphased with DCDC1 */
+ reg_dcdc2_323: dcdc2 {
+ x-powers,polyphased;
+ };
/* Some RISC-V management core related voltage */
reg_dcdc3_323: dcdc3 {
regulator-always-on;
regulator-min-microvolt = <900000>;
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index da891415efc0..2e2d35d31ce6 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -1479,10 +1479,23 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
}
return regmap_update_bits(rdev->regmap, reg, mask, workmode);
}
+static void axp20x_set_polyphased(struct axp20x_dev *axp20x, int id)
+{
+ switch (axp20x->variant) {
+ case AXP323_ID:
+ switch (id) {
+ case AXP313A_DCDC2:
+ regmap_write(axp20x->regmap, AXP323_DCDC_MODE_CTRL2, BIT(1));
+ }
+ break;
+
+ default:
+ }
+}
/*
* This function checks whether a regulator is part of a poly-phase
* output setup based on the registers settings. Returns true if it is.
*/
static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id)
@@ -1702,10 +1715,16 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
if (axp20x_set_dcdc_workmode(rdev, i, workmode))
dev_err(&pdev->dev, "Failed to set workmode on %s\n",
rdev->desc->name);
}
+ /*
+ * Currently only the AXP323 needs to force dual phase setup.
+ */
+ if (of_property_read_bool(rdev->dev.of_node,"x-powers,polyphased"))
+ axp20x_set_polyphased(axp20x, i);
+
/*
* Save AXP22X DCDC1 / DCDC5 / AXP15060 ALDO1 regulator names for later.
*/
if ((regulators == axp22x_regulators && i == AXP22X_DCDC1) ||
(regulators == axp809_regulators && i == AXP809_DCDC1) ||
--
Created with Armbian build tools https://github.com/armbian/build