From f13fc83465a0f2b9135e67f966a38fbb8fbb3924 Mon Sep 17 00:00:00 2001 From: Hannes Braun Date: Mon, 16 Jan 2023 10:32:48 +0100 Subject: [PATCH] RockPro64: add thermal fan control (#4702) --- ...eneral-rockpro64-thermal-fan-control.patch | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 patch/kernel/archive/rockchip64-5.15/general-rockpro64-thermal-fan-control.patch diff --git a/patch/kernel/archive/rockchip64-5.15/general-rockpro64-thermal-fan-control.patch b/patch/kernel/archive/rockchip64-5.15/general-rockpro64-thermal-fan-control.patch new file mode 100644 index 0000000000..c13a36431a --- /dev/null +++ b/patch/kernel/archive/rockchip64-5.15/general-rockpro64-thermal-fan-control.patch @@ -0,0 +1,67 @@ +From d09ebc6ba9ccb9b36fb860b5239d488edc794dcb Mon Sep 17 00:00:00 2001 +From: Peter Geis +Date: Fri, 30 Jul 2021 11:17:27 -0400 +Subject: [PATCH] arm64: dts: rockchip: add thermal fan control to rockpro64 + +The rockpro64 had a fan node since +commit 5882d65c1691 ("arm64: dts: rockchip: Add PWM fan for RockPro64") +however it was never tied into the thermal driver for automatic control. + +Add the links to the thermal node to permit the kernel to handle this +automatically. +Borrowed from the (rk3399-khadas-edge.dtsi). + +Signed-off-by: Peter Geis +Link: https://lore.kernel.org/r/20210730151727.729822-1-pgwipeout@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3399-rockpro64.dtsi | 29 +++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi +index 6bff8db7d33e8a..83db4ca6733497 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi +@@ -69,6 +69,7 @@ + + fan: pwm-fan { + compatible = "pwm-fan"; ++ cooling-levels = <0 100 150 200 255>; + #cooling-cells = <2>; + fan-supply = <&vcc12v_dcin>; + pwms = <&pwm1 0 50000 0>; +@@ -245,6 +246,34 @@ + cpu-supply = <&vdd_cpu_b>; + }; + ++&cpu_thermal { ++ trips { ++ cpu_warm: cpu_warm { ++ temperature = <55000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ cpu_hot: cpu_hot { ++ temperature = <65000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ }; ++ ++ cooling-maps { ++ map2 { ++ trip = <&cpu_warm>; ++ cooling-device = <&fan THERMAL_NO_LIMIT 1>; ++ }; ++ ++ map3 { ++ trip = <&cpu_hot>; ++ cooling-device = <&fan 2 THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ + &emmc_phy { + status = "okay"; + };