]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: rockchip: add pwm-fan for NanoPC-T6
authorHugh Cole-Baker <sigmaris@gmail.com>
Sun, 25 Jan 2026 18:10:14 +0000 (18:10 +0000)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 22 Feb 2026 22:28:51 +0000 (23:28 +0100)
FriendlyELEC offers an optional heatsink and fan addon [1] for the
NanoPC-T6 and T6 LTS, which plugs in to the fan connector on the board
driven by pwm1. Add the fan as an active cooling device for the SoC package.
The PWM duty cycle values are taken from the vendor's source [2].

Signed-off-by: Hugh Cole-Baker <sigmaris@gmail.com>
[1]: https://www.friendlyelec.com/index.php?route=product/product&product_id=305
[2]: https://github.com/friendlyarm/kernel-rockchip/blob/4944602540b62f5aad139fe602a76cf7c3176128/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-rev01.dts#L75-L90

Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Link: https://patch.msgid.link/20260125181228.25145-1-sigmaris@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi

index 90e7fe254491b5c83e61a0447178cad9236c2381..84b6b53f016ab1f770ef637b70dc323ec21a6213 100644 (file)
@@ -11,6 +11,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/soc/rockchip,vop2.h>
+#include <dt-bindings/thermal/thermal.h>
 #include <dt-bindings/usb/pd.h>
 #include "rk3588.dtsi"
 
                };
        };
 
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               cooling-levels = <0 35 64 100 150 255>;
+               fan-supply = <&vcc5v0_sys>;
+               pwms = <&pwm1 0 50000 0>;
+               #cooling-cells = <2>;
+       };
+
        sound {
                compatible = "simple-audio-card";
                pinctrl-names = "default";
        status = "okay";
 };
 
+&package_thermal {
+       polling-delay = <1000>;
+
+       trips {
+               package_warm: package-warm {
+                       temperature = <55000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               package_hot: package-hot {
+                       temperature = <65000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map0 {
+                       trip = <&package_warm>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+               };
+
+               map1 {
+                       trip = <&package_hot>;
+                       cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
 &pcie2x1l0 {
        reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
        vpcie3v3-supply = <&vcc_3v3_pcie20>;