From 5d620ffde0ab6ca7b9a69a374f958f7f36ed3d14 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Mon, 1 May 2023 21:32:59 +0800 Subject: [PATCH] riscv: dts: thead: lpi4a: add PWM Fan Two trip points at 50C and 60C are added, for enabling the fan and making the fan full. Signed-off-by: Icenowy Zheng --- arch/riscv/boot/dts/thead/light-lpi4a-ref.dts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/riscv/boot/dts/thead/light-lpi4a-ref.dts b/arch/riscv/boot/dts/thead/light-lpi4a-ref.dts index abf6acfc4..c69af9d0d 100644 --- a/arch/riscv/boot/dts/thead/light-lpi4a-ref.dts +++ b/arch/riscv/boot/dts/thead/light-lpi4a-ref.dts @@ -191,6 +191,13 @@ status = "okay"; }; + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + pwms = <&pwm 1 1000000 0>; + cooling-levels = <0 64 192 255>; + }; + reg_vref_1v8: regulator-adc-verf { compatible = "regulator-fixed"; regulator-name = "vref-1v8"; @@ -556,6 +563,48 @@ }; }; + thermal-zones { + cpu-thermal-zone { + trips { + fan_config0: fan-trip0 { + temperature = <40000>; + hysteresis = <5000>; + type = "active"; + }; + + fan_config1: fan-trip1 { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + + fan_config2: fan-trip2 { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + fan-on { + trip = <&fan_config0>; + cooling-device = + <&fan 1 1>; + }; + fan-faster { + trip = <&fan_config1>; + cooling-device = + <&fan 2 2>; + }; + fan-full { + trip = <&fan_config2>; + cooling-device = + <&fan 3 3>; + }; + }; + }; + }; + }; &resmem {