Skip to contentSkip to conversation

arm64: dts: rockchip: Enable automatic fan control on Rock 5A/5C

PATCH In review FUKAUMI Naoki 2 participants 2 messages Dec 9, 2024

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

PATCH v2 1/1 arm64: dts: rockchip: Enable automatic fan control on Rock 5A/5C

Link the PWM fan on Radxa ROCK 5A/5C as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65 oC and a minimum-spin interval from 55 oC to 65 oC, to ensure airflow when the system gets warm.

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
---
Changes in v2
- reword commit message (Dragan Simic)

---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +31 -1
index 7ae032b3534c..d0b9513d56a7 100644
@@ -64,7 +64,7 @@ led-1 {
 		};
 	};
 
-	pwm-fan {
+	fan: pwm-fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
 		cooling-levels = <0 64 128 192 255>;
@@ -380,6 +380,36 @@ rgmii_phy1: ethernet-phy@1 {
 	};
 };
 
+&package_thermal {
+	polling-delay = <1000>;
+
+	trips {
+		package_fan0: package-fan0 {
+			hysteresis = <2000>;
+			temperature = <55000>;
+			type = "active";
+		};
+
+		package_fan1: package-fan1 {
+			hysteresis = <2000>;
+			temperature = <65000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map0 {
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+			trip = <&package_fan0>;
+		};
+
+		map1 {
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+			trip = <&package_fan1>;
+		};
+	};
+};
+
 &pcie2x1l2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie20x1_2_perstn_m0>,
Signature · 7 lines
2.43.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by on v2 1/1
#1 lore raw

Hello Fukaumi,

Quoted 6 lines · FUKAUMI Naoki

Link the PWM fan on Radxa ROCK 5A/5C as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65 oC and a minimum-spin interval from 55 oC to 65 oC, to ensure airflow when the system gets warm.

Looking good to me, this DT addition follows the rather usual way for ensuring low fan noise levels. The patch summary and description are also looking good now. :) Thanks for the patch!

Quoted 63 lines

---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
[2] https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/
---
Changes in v2
- reword commit message (Dragan Simic)

---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi +31 -1
index 7ae032b3534c..d0b9513d56a7 100644
@@ -64,7 +64,7 @@ led-1 {
 		};
 	};
 
-	pwm-fan {
+	fan: pwm-fan {
 		compatible = "pwm-fan";
 		#cooling-cells = <2>;
 		cooling-levels = <0 64 128 192 255>;
@@ -380,6 +380,36 @@ rgmii_phy1: ethernet-phy@1 {
 	};
 };
 
+&package_thermal {
+	polling-delay = <1000>;
+
+	trips {
+		package_fan0: package-fan0 {
+			hysteresis = <2000>;
+			temperature = <55000>;
+			type = "active";
+		};
+
+		package_fan1: package-fan1 {
+			hysteresis = <2000>;
+			temperature = <65000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map0 {
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+			trip = <&package_fan0>;
+		};
+
+		map1 {
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+			trip = <&package_fan1>;
+		};
+	};
+};
+
 &pcie2x1l2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie20x1_2_perstn_m0>,