]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: tegra: Enable thermal support on Jetson AGX Orin
authorThierry Reding <treding@nvidia.com>
Thu, 26 Jan 2023 13:34:02 +0000 (14:34 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 9 Jun 2023 15:44:26 +0000 (17:44 +0200)
Add thermal zone details and enable the PWM fan as cooling device.

Note that this also changes the cooling levels for the PWM fan, which
should have no effect, though, because the fan wasn't previously
connected to anything and by default would be turned off at probe time.

Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
arch/arm64/boot/dts/nvidia/tegra234-p3737-0000.dtsi

index 812499918085ee6bb6b6e7fcf2dade80422aeaba..319b3a9cff2440beda2815cde3896594ee90e50a 100644 (file)
                gpio = <&gpio TEGRA234_MAIN_GPIO(A, 1) GPIO_ACTIVE_LOW>;
                regulator-boot-on;
        };
+
+       thermal-zones {
+               tj-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <1000>;
+                       status = "okay";
+
+                       trips {
+                               tj_trip_active0: active-0 {
+                                       temperature = <75000>;
+                                       hysteresis = <4000>;
+                                       type = "active";
+                               };
+
+                               tj_trip_active1: active-1 {
+                                       temperature = <95000>;
+                                       hysteresis = <4000>;
+                                       type = "active";
+                               };
+                       };
+               };
+       };
 };
index 5f3d6dcf10a2bc9a27a01ff4587a18934b0b8e77..cd13cf2381dded8d6408d3fabd1a08fc87072160 100644 (file)
        };
 
        pwm-fan {
-               compatible = "pwm-fan";
-               pwms = <&pwm3 0 45334>;
-
-               cooling-levels = <0 95 178 255>;
-               #cooling-cells = <2>;
+               cooling-levels = <66 215 255>;
        };
 
        serial {
                          "CVB-RT DMIC1",               "CVB-RT MIC",
                          "CVB-RT DMIC2",               "CVB-RT MIC";
        };
+
+       thermal-zones {
+               tj-thermal {
+                       cooling-maps {
+                               map-active-0 {
+                                       cooling-device = <&fan 0 1>;
+                                       trip = <&tj_trip_active0>;
+                               };
+
+                               map-active-1 {
+                                       cooling-device = <&fan 1 2>;
+                                       trip = <&tj_trip_active1>;
+                               };
+                       };
+               };
+       };
 };
index 022a5408d8693e34a41588a4af5f717524614809..d94147f22ebf747b78443114c85f1be21bbe8d40 100644 (file)
                };
        };
 
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               pwms = <&pwm3 0 45334>;
+               #cooling-cells = <2>;
+       };
+
        vdd_1v8_sys: regulator-vdd-1v8-sys {
                compatible = "regulator-fixed";
                regulator-name = "VDD_1V8_SYS";