]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm64: dts: mediatek: mt8183: Refactor thermal zones
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Wed, 10 Apr 2024 08:30:02 +0000 (10:30 +0200)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 27 Jun 2024 08:10:20 +0000 (10:10 +0200)
The thermal zones in MT8183 had cryptic names and all of them, apart
from the cpu-thermal zone, had no thermal trips, hence those were not
probed at all.

Refactor the tzts1..5 and tztsABB thermal zones to add the correct
thermal trips and give them a meaningful name, corresponding to the
actually monitored thermal zone.
While at it, also rename the thermal sensor node to "thermal-sensor".

Now the thermal zones are probing and their temperatures can be read.

Fixes: b325ce39785b ("arm64: dts: mt8183: add thermal zone node")
Link: https://lore.kernel.org/r/20240410083002.1357857-4-angelogioacchino.delregno@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arch/arm64/boot/dts/mediatek/mt8183.dtsi

index 774ae5d9143f1ea95cc15a7148b5ec54c7d8552a..fbf145639b8c90b2c69da1cb4bac4f61ca7a1c9e 100644 (file)
                        status = "disabled";
                };
 
-               thermal: thermal@1100b000 {
+               thermal: thermal-sensor@1100b000 {
                        #thermal-sensor-cells = <1>;
                        compatible = "mediatek,mt8183-thermal";
                        reg = <0 0x1100b000 0 0xc00>;
                        };
                };
 
-               /* The tzts1 ~ tzts6 don't need to polling */
-               /* The tzts1 ~ tzts6 don't need to thermal throttle */
-
-               tzts1: tzts1 {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tzts1: soc-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 1>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+                       trips {
+                               soc_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               soc_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
 
-               tzts2: tzts2 {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tzts2: gpu-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 2>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+
+                       trips {
+                               gpu_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               gpu_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
 
-               tzts3: tzts3 {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tzts3: md1-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 3>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+
+                       trips {
+                               md1_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               md1_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
 
-               tzts4: tzts4 {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tzts4: cpu-little-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 4>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+
+                       trips {
+                               cpul_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpul_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
 
-               tzts5: tzts5 {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tzts5: cpu-big-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 5>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+
+                       trips {
+                               cpub_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpub_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
 
-               tztsABB: tztsABB {
-                       polling-delay-passive = <0>;
-                       polling-delay = <0>;
+               tztsABB: tsabb-thermal {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <250>;
                        thermal-sensors = <&thermal 6>;
                        sustainable-power = <5000>;
-                       trips {};
-                       cooling-maps {};
+
+                       trips {
+                               tsabb_alert: trip-alert {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               tsabb_crit: trip-crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
        };
 };