ca7d872a1bfbcca025793f03aed54c1af244e67d
[openwrt/staging/ldir.git] /
1 From 5d90603b09e5814ffc38c47e79ccf9bc564f9296 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Tue, 30 May 2023 22:12:35 +0200
4 Subject: [PATCH 18/19] arm64: dts: mt7986: add pwm-fan and cooling-maps to
5 BPI-R3 dts
6
7 Add pwm-fan and cooling-maps to BananaPi-R3 devicetree.
8
9 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
11 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
12 Link: https://lore.kernel.org/r/20230530201235.22330-5-linux@fw-web.de
13 Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
14 ---
15 .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 +++++++++++++++++++
16 1 file changed, 31 insertions(+)
17
18 --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
19 +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
20 @@ -38,6 +38,15 @@
21 regulator-always-on;
22 };
23
24 + fan: pwm-fan {
25 + compatible = "pwm-fan";
26 + #cooling-cells = <2>;
27 + /* cooling level (0, 1, 2) - pwm inverted */
28 + cooling-levels = <255 96 0>;
29 + pwms = <&pwm 0 10000 0>;
30 + status = "okay";
31 + };
32 +
33 gpio-keys {
34 compatible = "gpio-keys";
35
36 @@ -133,6 +142,28 @@
37 };
38 };
39
40 +&cpu_thermal {
41 + cooling-maps {
42 + cpu-active-high {
43 + /* active: set fan to cooling level 2 */
44 + cooling-device = <&fan 2 2>;
45 + trip = <&cpu_trip_active_high>;
46 + };
47 +
48 + cpu-active-low {
49 + /* active: set fan to cooling level 1 */
50 + cooling-device = <&fan 1 1>;
51 + trip = <&cpu_trip_active_low>;
52 + };
53 +
54 + cpu-passive {
55 + /* passive: set fan to cooling level 0 */
56 + cooling-device = <&fan 0 0>;
57 + trip = <&cpu_trip_passive>;
58 + };
59 + };
60 +};
61 +
62 &crypto {
63 status = "okay";
64 };