df9f58d25e7b8bad36626e84b2a40b5d5d36a396
[openwrt/staging/nbd.git] /
1 From cd5681e63fb9887bd05d4ef59151d6a6b39c9d33 Mon Sep 17 00:00:00 2001
2 From: Alexey Charkov <alchark@gmail.com>
3 Date: Mon, 20 Jan 2025 23:22:47 +0400
4 Subject: arm64: dts: rockchip: Enable automatic fan control on Radxa Rock 5C
5
6 Add the necessary cooling map to enable the kernel's thermal subsystem
7 to manage the fan speed automatically depending on the overall SoC
8 package temperature on Radxa Rock 5C
9
10 Signed-off-by: Alexey Charkov <alchark@gmail.com>
11 Reviewed-by: Dragan Simic <dsimic@manjaro.org>
12 Link: https://lore.kernel.org/r/20250120-rock-5c-fan-v1-2-5fb8446c981b@gmail.com
13 Signed-off-by: Heiko Stuebner <heiko@sntech.de>
14
15 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
16 +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts
17 @@ -68,7 +68,7 @@
18 };
19 };
20
21 - fan {
22 + fan: fan {
23 compatible = "pwm-fan";
24 #cooling-cells = <2>;
25 cooling-levels = <0 24 44 64 128 192 255>;
26 @@ -417,6 +417,36 @@
27 };
28 };
29
30 +&package_thermal {
31 + polling-delay = <1000>;
32 +
33 + trips {
34 + package_fan0: package-fan0 {
35 + temperature = <55000>;
36 + hysteresis = <2000>;
37 + type = "active";
38 + };
39 +
40 + package_fan1: package-fan1 {
41 + temperature = <65000>;
42 + hysteresis = <2000>;
43 + type = "active";
44 + };
45 + };
46 +
47 + cooling-maps {
48 + map0 {
49 + trip = <&package_fan0>;
50 + cooling-device = <&fan THERMAL_NO_LIMIT 1>;
51 + };
52 +
53 + map1 {
54 + trip = <&package_fan1>;
55 + cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
56 + };
57 + };
58 +};
59 +
60 &pcie2x1l2 {
61 pinctrl-names = "default";
62 pinctrl-0 = <&pcie20x1_2_perstn_m0>;