Skip to contentSkip to conversation

arm64: dts: rockchip: Harmonize regulator formatting for Pine64 rk3566 devices

PATCH In review Diederik de Haas 3 participants 3 messages Oct 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: dts: rockchip: Harmonize regulator formatting for Pine64 rk3566 devices

The regulator node properties in Pine64 rk3566 devices were formatted rather inconsistently. To name a few:
- 'name' was sometimes put at the top of the list, while at other times it was (mostly) sorted in alphabetical order
- 'always-on' and 'boot-on' were sometimes at the top of the list, sometimes not
- 'state-mem' nodes sometimes had a preceding blank line, as they should, but sometimes not
- other properties seem to have been added to the end of the list, not in their alphabetical/natural order

So harmonize the formatting by making all properties sorted alphabetically/naturally. And harmonize the formatting of the 'state-mem' nodes so they all have a preceding blank line. While at it, also fix 2 incorrectly indented nodes.

No functional changes.

---
No outright NACKs and one positive response (thanks!), so here's v2.

Changes in v2:
- Found more regulators at the beginning of the pinetab2 dtsi file
- Missed a 'regulator-always-on' on regulator-vcc3v3-sys in q64b dts Link to v1:
https://lore.kernel.org/all/[email protected]/

 .../boot/dts/rockchip/rk3566-pinenote.dtsi    | 52 +++++++++---------
 .../boot/dts/rockchip/rk3566-pinetab2.dtsi    | 47 ++++++++++------
 .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 51 +++++++++++-------
 .../boot/dts/rockchip/rk3566-quartz64-b.dts   | 54 ++++++++++---------
 .../dts/rockchip/rk3566-soquartz-blade.dts    |  6 +--
 .../boot/dts/rockchip/rk3566-soquartz-cm4.dts |  6 +--
 .../dts/rockchip/rk3566-soquartz-model-a.dts  | 10 ++--
 .../boot/dts/rockchip/rk3566-soquartz.dtsi    | 43 ++++++++++-----
 8 files changed, 158 insertions(+), 111 deletions(-)
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi +26 -26
index 5c6f8cc401c9..36aa39cc79e5 100644
@@ -133,46 +133,46 @@ link1_codec: codec {
 
 	vbat_4g: regulator-vbat-4g {
 		compatible = "regulator-fixed";
-		regulator-name = "vbat_4g";
 		regulator-min-microvolt = <3800000>;
 		regulator-max-microvolt = <3800000>;
+		regulator-name = "vbat_4g";
 		/* powered by vcc_bat, enabled by vbat_4g_en */
 		vin-supply = <&vbat_4g_en>;
 	};
 
 	vcc_1v8: regulator-vcc-1v8 {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_1v8";
 		regulator-always-on;
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
+		regulator-name = "vcc_1v8";
 		/* powered by vcc_sys, enabled by vcc_1v8_en */
 		vin-supply = <&vcc_1v8_en>;
 	};
 
 	vcc_bat: regulator-vcc-bat {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_bat";
 		regulator-always-on;
 		regulator-min-microvolt = <3800000>;
 		regulator-max-microvolt = <3800000>;
+		regulator-name = "vcc_bat";
 	};
 
 	vcc_hall_3v3: regulator-vcc-hall-3v3 {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_hall_3v3";
 		regulator-always-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc_hall_3v3";
 		vin-supply = <&vcc_sys>;
 	};
 
 	vcc_sys: regulator-vcc-sys {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_sys";
 		regulator-always-on;
 		regulator-min-microvolt = <3800000>;
 		regulator-max-microvolt = <3800000>;
+		regulator-name = "vcc_sys";
 		vin-supply = <&vcc_bat>;
 	};
 
@@ -182,18 +182,18 @@ vcc_wl: regulator-vcc-wl {
 		gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
 		pinctrl-0 = <&vcc_wl_pin>;
 		pinctrl-names = "default";
-		regulator-name = "vcc_wl";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc_wl";
 		vin-supply = <&vcc_bat>;
 	};
 
 	vdda_0v9: regulator-vdda-0v9 {
 		compatible = "regulator-fixed";
-		regulator-name = "vdda_0v9";
 		regulator-always-on;
 		regulator-min-microvolt = <900000>;
 		regulator-max-microvolt = <900000>;
+		regulator-name = "vdda_0v9";
 		/* powered by vcc_sys, enabled by vcc_1v8_en */
 		vin-supply = <&vcc_1v8_en>;
 	};
@@ -222,11 +222,11 @@ vdd_cpu: regulator@1c {
 		compatible = "tcs,tcs4525";
 		reg = <0x1c>;
 		fcs,suspend-voltage-selector = <0>;
-		regulator-name = "vdd_cpu";
+		regulator-always-on;
 		regulator-min-microvolt = <712500>;
 		regulator-max-microvolt = <1390000>;
+		regulator-name = "vdd_cpu";
 		regulator-ramp-delay = <2300>;
-		regulator-always-on;
 		vin-supply = <&vcc_sys>;
 
 		regulator-state-mem {
@@ -262,12 +262,12 @@ rk817: pmic@20 {
 
 		regulators {
 			vdd_logic: DCDC_REG1 {
-				regulator-name = "vdd_logic";
 				regulator-always-on;
+				regulator-initial-mode = <0x2>;
 				regulator-min-microvolt = <500000>;
 				regulator-max-microvolt = <1350000>;
+				regulator-name = "vdd_logic";
 				regulator-ramp-delay = <6001>;
-				regulator-initial-mode = <0x2>;
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -276,11 +276,11 @@ regulator-state-mem {
 			};
 
 			vdd_gpu_npu: DCDC_REG2 {
-				regulator-name = "vdd_gpu_npu";
+				regulator-initial-mode = <0x2>;
 				regulator-min-microvolt = <500000>;
 				regulator-max-microvolt = <1350000>;
+				regulator-name = "vdd_gpu_npu";
 				regulator-ramp-delay = <6001>;
-				regulator-initial-mode = <0x2>;
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -288,9 +288,9 @@ regulator-state-mem {
 			};
 
 			vcc_ddr: DCDC_REG3 {
-				regulator-name = "vcc_ddr";
 				regulator-always-on;
 				regulator-initial-mode = <0x2>;
+				regulator-name = "vcc_ddr";
 
 				regulator-state-mem {
 					regulator-on-in-suspend;
@@ -298,11 +298,11 @@ regulator-state-mem {
 			};
 
 			vcc_3v3: DCDC_REG4 {
-				regulator-name = "vcc_3v3";
 				regulator-always-on;
+				regulator-initial-mode = <0x2>;
 				regulator-min-microvolt = <3300000>;
 				regulator-max-microvolt = <3300000>;
-				regulator-initial-mode = <0x2>;
+				regulator-name = "vcc_3v3";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -310,10 +310,10 @@ regulator-state-mem {
 			};
 
 			vcca_1v8_pmu: LDO_REG1 {
-				regulator-name = "vcca_1v8_pmu";
 				regulator-always-on;
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcca_1v8_pmu";
 
 				regulator-state-mem {
 					regulator-on-in-suspend;
@@ -322,9 +322,9 @@ regulator-state-mem {
 
 			/* unused */
 			vdda_0v9_ldo: LDO_REG2 {
-				regulator-name = "vdda_0v9_ldo";
 				regulator-min-microvolt = <900000>;
 				regulator-max-microvolt = <900000>;
+				regulator-name = "vdda_0v9_ldo";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -332,10 +332,10 @@ regulator-state-mem {
 			};
 
 			vdda_0v9_pmu: LDO_REG3 {
-				regulator-name = "vdda_0v9_pmu";
 				regulator-always-on;
 				regulator-min-microvolt = <900000>;
 				regulator-max-microvolt = <900000>;
+				regulator-name = "vdda_0v9_pmu";
 
 				regulator-state-mem {
 					regulator-on-in-suspend;
@@ -343,10 +343,10 @@ regulator-state-mem {
 			};
 
 			vccio_acodec: LDO_REG4 {
-				regulator-name = "vccio_acodec";
 				regulator-always-on;
 				regulator-min-microvolt = <3300000>;
 				regulator-max-microvolt = <3300000>;
+				regulator-name = "vccio_acodec";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -355,9 +355,9 @@ regulator-state-mem {
 
 			/* unused */
 			vccio_sd: LDO_REG5 {
-				regulator-name = "vccio_sd";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3300000>;
+				regulator-name = "vccio_sd";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -365,10 +365,10 @@ regulator-state-mem {
 			};
 
 			vcc_3v3_pmu: LDO_REG6 {
-				regulator-name = "vcc_3v3_pmu";
 				regulator-always-on;
 				regulator-min-microvolt = <3300000>;
 				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc_3v3_pmu";
 
 				regulator-state-mem {
 					regulator-on-in-suspend;
@@ -376,9 +376,9 @@ regulator-state-mem {
 			};
 
 			vcc_1v8_en: LDO_REG7 {
-				regulator-name = "vcc_1v8_en";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcc_1v8_en";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -386,9 +386,9 @@ regulator-state-mem {
 			};
 
 			vbat_4g_en: LDO_REG8 {
-				regulator-name = "vbat_4g_en";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-name = "vbat_4g_en";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
@@ -396,9 +396,9 @@ regulator-state-mem {
 			};
 
 			sleep_sta_ctl: LDO_REG9 {
-				regulator-name = "sleep_sta_ctl";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-name = "sleep_sta_ctl";
 
 				regulator-state-mem {
 					regulator-on-in-suspend;
@@ -406,9 +406,9 @@ regulator-state-mem {
 			};
 
 			dcdc_boost: BOOST {
-				regulator-name = "boost";
 				regulator-min-microvolt = <5000000>;
 				regulator-max-microvolt = <5000000>;
+				regulator-name = "boost";
 
 				regulator-state-mem {
 					regulator-off-in-suspend;
arch/arm64/boot/dts/rockchip/rk3566-pinetab2.dtsi +31 -16

226 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts +33 -18

240 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts +28 -26

256 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3566-soquartz-blade.dts +3 -3
index b64d0c957ef6..d0d7fa5823a5 100644
@@ -20,32 +20,32 @@ aliases {
 	/* labeled VCC3V0_SD in schematic to not conflict with PMIC regulator */
 	vcc3v0_sd: regulator-vcc3v0-sd {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc3v0_sd";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc3v0_sd";
 		vin-supply = <&vcc3v3_sys>;
 	};
 
 	/* labeled VCC_SSD in schematic */
 	vcc3v3_pcie_p: regulator-vcc3v3-pcie {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3_pcie_p";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc3v3_pcie_p";
 		vin-supply = <&vbus>;
 	};
 
 	vcc5v_dcin: regulator-vcc5v-dcin {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc5v_dcin";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
+		regulator-name = "vcc5v_dcin";
 	};
 };
 
arch/arm64/boot/dts/rockchip/rk3566-soquartz-cm4.dts +3 -3
index 38155316846d..7cae7f100324 100644
@@ -15,31 +15,31 @@ aliases {
 	/* labeled +12v in schematic */
 	vcc12v_dcin: regulator-vcc12v-dcin {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc12v_dcin";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <12000000>;
 		regulator-max-microvolt = <12000000>;
+		regulator-name = "vcc12v_dcin";
 	};
 
 	/* labeled +5v in schematic */
 	vcc_5v: regulator-vcc-5v {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_5v";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
+		regulator-name = "vcc_5v";
 		vin-supply = <&vcc12v_dcin>;
 	};
 
 	vcc_sd_pwr: regulator-vcc-sd-pwr {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_sd_pwr";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc_sd_pwr";
 		vin-supply = <&vcc3v3_sys>;
 	};
 };
arch/arm64/boot/dts/rockchip/rk3566-soquartz-model-a.dts +5 -5
index 2e130eef54df..f9b0bac522ab 100644
@@ -15,20 +15,20 @@ aliases {
 	/* labeled DCIN_12V in schematic */
 	vcc12v_dcin: regulator-vcc12v-dcin {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc12v_dcin";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <12000000>;
 		regulator-max-microvolt = <12000000>;
+		regulator-name = "vcc12v_dcin";
 	};
 
 	vcc5v0_usb: regulator-vcc5v0-usb {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0_usb";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
+		regulator-name = "vcc5v0_usb";
 		vin-supply = <&vcc12v_dcin>;
 	};
 
@@ -38,31 +38,31 @@ vcc5v0_usb: regulator-vcc5v0-usb {
 	 */
 	vcc3v0_sd: regulator-vcc3v0-sd {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc3v0_sd";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc3v0_sd";
 		vin-supply = <&vcc3v3_sys>;
 	};
 
 	vcc3v3_pcie: regulator-vcc3v3-pcie {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3_pcie";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-name = "vcc3v3_pcie";
 		vin-supply = <&vcc12v_dcin>;
 	};
 
 	vcc12v_pcie: regulator-vcc12v-pcie {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc12v_pcie";
 		regulator-always-on;
 		regulator-boot-on;
 		regulator-min-microvolt = <12000000>;
 		regulator-max-microvolt = <12000000>;
+		regulator-name = "vcc12v_pcie";
 		vin-supply = <&vcc12v_dcin>;
 	};
 };
arch/arm64/boot/dts/rockchip/rk3566-soquartz.dtsi +29 -14

197 lines not on this page · raw message

Signature · 1 line
2.51.0
#1 lore raw

Hi Diederik,

Quoted 4 lines · Diederik de Haas

The regulator node properties in Pine64 rk3566 devices were formatted rather inconsistently. To name a few:
- 'name' was sometimes put at the top of the list, while at other times it was (mostly) sorted in alphabetical order

Personally I prefer to list the regulator-name as the first property, I think it makes it visually easier/quicker to identify a regulator with the name prop at top.

I typically try to use the following prop ordering for regulators on board DTs I submit (and review):

- regulator-name as the first prop (to quickly identify the regulator)
- regulator-min-* before regulator-max-* (natural order)
- regulator-* in alphabetical/natural order

Maybe this preference just comes from a long history of always putting id/primary key/unique identifiers at top or beginning of data tables, classes, structs etc ;-)

Regards,
Jonas

Quoted 23 lines

- 'always-on' and 'boot-on' were sometimes at the top of the list, sometimes not
- 'state-mem' nodes sometimes had a preceding blank line, as they should, but sometimes not
- other properties seem to have been added to the end of the list, not in their alphabetical/natural order

So harmonize the formatting by making all properties sorted alphabetically/naturally. And harmonize the formatting of the 'state-mem' nodes so they all have a preceding blank line. While at it, also fix 2 incorrectly indented nodes.

No functional changes.

---
No outright NACKs and one positive response (thanks!), so here's v2.

Changes in v2:
- Found more regulators at the beginning of the pinetab2 dtsi file
- Missed a 'regulator-always-on' on regulator-vcc3v3-sys in q64b dts Link to v1:
https://lore.kernel.org/all/[email protected]/

[snip]

#2 lore raw

Hello Jonas and Heiko,

Quoted 13 lines · Jonas Karlman
Quoted 4 lines · Diederik de Haas

The regulator node properties in Pine64 rk3566 devices were formatted rather inconsistently. To name a few:
- 'name' was sometimes put at the top of the list, while at other times it was (mostly) sorted in alphabetical order

Personally I prefer to list the regulator-name as the first property, I think it makes it visually easier/quicker to identify a regulator with the name prop at top.

I typically try to use the following prop ordering for regulators on board DTs I submit (and review):

Quoted 7 lines

- regulator-name as the first prop (to quickly identify the regulator)
- regulator-min-* before regulator-max-* (natural order)
- regulator-* in alphabetical/natural order

Maybe this preference just comes from a long history of always putting id/primary key/unique identifiers at top or beginning of data tables, classes, structs etc ;-)

Oh, I actually agree with your and Heiko's preferences when it comes to the ordering, regardless of that being personal preference, tribal knowledge or just common sense. :)

However, that's quite conflicting with the current official rules for writing DT files, which don't recognize such exceptions at all. Perhaps we should attempt to incorporate such preferences into the official rules, because such non-standard ordering does make DTs more readable? Following the rules is good, unless it makes the end results worse, IMHO.