From b603d035b1faca7763fad8debab95e333f01ab7e Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Fri, 9 May 2025 00:26:26 -0500 Subject: [PATCH] arm64: tegra: Enable PWM fan on P2894 This is based on 6f78a94, which enabled added the fan and thermal zones for the Jetson Nano Devkit. The fan and thermal characteristics of the two devices are similar, so using the same configuration. Signed-off-by: Aaron Kling --- .../arm64/boot/dts/nvidia/tegra210-p2894.dtsi | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi index 34808dc33bb4..186d712a132d 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi @@ -1825,6 +1825,18 @@ method = "smc"; }; + fan: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 3 65536>; + fan-supply = <&vdd_fan>; + interrupt-parent = <&gpio>; + interrupts = ; + + /* cooling level (0, 1, 2, 3) - pwm inverted */ + cooling-levels = <255 128 64 0>; + #cooling-cells = <2>; + }; + battery_reg: regulator-vdd-ac-bat { compatible = "regulator-fixed"; regulator-name = "vdd-ac-bat"; @@ -2031,4 +2043,56 @@ regulator-enable-ramp-delay = <2000>; regulator-settling-time-us = <160>; }; + + thermal-zones { + cpu-thermal { + trips { + cpu_trip_critical: critical { + temperature = <96500>; + hysteresis = <0>; + type = "critical"; + }; + + cpu_trip_hot: hot { + temperature = <70000>; + hysteresis = <2000>; + type = "hot"; + }; + + cpu_trip_active: active { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_passive: passive { + temperature = <30000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + + cooling-maps { + map0 { + cooling-device = <&fan 3 3>; + trip = <&cpu_trip_critical>; + }; + + map1 { + cooling-device = <&fan 2 2>; + trip = <&cpu_trip_hot>; + }; + + map2 { + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active>; + }; + + map3 { + cooling-device = <&fan 0 0>; + trip = <&cpu_trip_passive>; + }; + }; + }; + }; };