diff mbox series

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

Message ID 20241209134113.4783-1-naoki@radxa.com (mailing list archive)
State New
Headers show
Series [v2] arm64: dts: rockchip: Enable automatic fan control on Rock 5A/5C | expand

Commit Message

FUKAUMI Naoki Dec. 9, 2024, 1:41 p.m. UTC
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.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
---
this patch depends on [1] which depends on [2].

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/20241209132406.4232-1-naoki@radxa.com/
[2] https://patchwork.kernel.org/project/linux-rockchip/cover/20241209125131.4101-1-naoki@radxa.com/
---
Changes in v2
- reword commit message (Dragan Simic)
---
 .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

Comments

Dragan Simic Dec. 9, 2024, 3:48 p.m. UTC | #1
Hello Fukaumi,

On 2024-12-09 14:41, FUKAUMI Naoki wrote:
> 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.
> 
> Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>

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!

Reviewed-by: Dragan Simic <dsimic@manjaro.org>

> ---
> this patch depends on [1] which depends on [2].
> 
> [1] 
> https://patchwork.kernel.org/project/linux-rockchip/cover/20241209132406.4232-1-naoki@radxa.com/
> [2] 
> https://patchwork.kernel.org/project/linux-rockchip/cover/20241209125131.4101-1-naoki@radxa.com/
> ---
> Changes in v2
> - reword commit message (Dragan Simic)
> ---
>  .../boot/dts/rockchip/rk3588s-rock-5.dtsi     | 32 ++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
> index 7ae032b3534c..d0b9513d56a7 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
> @@ -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>,
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
index 7ae032b3534c..d0b9513d56a7 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5.dtsi
@@ -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>,