# thermal zone

Source: [https://docs.qualcomm.com/doc/80-70015-30SC/topic/thermalzone.html](https://docs.qualcomm.com/doc/80-70015-30SC/topic/thermalzone.html)

thermal zone 连接 Tsens 硬件信息、温度门限和调节操作。温控框架为设备树中定义的每个 thermal zone 规则创建节点 ID。

下表列出了用于读取和定制 thermal zone 配置的 `sysfs` 命令：

Note: 表中的`<x>`表示 thermal zone ID。

Table : thermal zone 命令的说明

| 命令 | 说明 |
| --- | --- |
| `cat /sys/class/thermal/thermal_zone*` | 列出设备包含的所有 thermal zone 及其 ID |
| `echo enabled > /sys/class/thermal/thermal_zone<x>/mode` | 启用 thermal zone<br>Note: 默认情况下启用所有 thermal zone。 |
| `echo disabled > /sys/class/thermal/thermal_zone<x>/mode` | 禁用 thermal zone |
| `echo <trip_temp> >/sys/class/thermal/thermal_zone<x>/trip_point_<A>_temp`<br>此处，<br><br>`trip_temp` 是以 m°C 为单位的温度门限。 `A` 表示 trip 数值。<br>例如，可以使用以下命令修改 trip 0 的温度门限：<br><br><br>`echo 95000 > /sys/class/thermal/thermal_zone20/trip_point_0_temp` | <ul class="ul" id="thermalzone__ul_uh3_4pt_vcc"><br>                                    <li class="li">修改 trip A 的门限温度</li><br><br>                                    <li class="li">验证 thermal zone 目录中可用于 thermal zone 的 trip 点数：<pre class="pre codeblock" id="thermalzone__codeblock_eps_cxt_vcc"><code>/sys/class/thermal/thermal_zone&lt;x&gt;</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre>并运行命令</li><br><br>                                </ul> |
| `echo <trip_hyst> > /sys/class/thermal/thermal_zone<x>/trip_point_<A>_hyst`<br>此处，<br><br>`trip_hyst` 是以 m°C 为单位的滞后值。 `A` 表示 trip 数值。<br>例如，可以使用以下命令修改 trip 0 的滞后，这意味着在 trip\_temp-1000 m°C 时触发清除门限：<br><br><br>`echo 1000 > /sys/class/thermal/thermal_zone20/trip_point_0_hyst` | <ul class="ul" id="thermalzone__ul_w4w_2xt_vcc"><br>                                        <li class="li">修改 trip A 的滞后值</li><br><br>                                        <li class="li">验证 thermal zone 目录中可用于 thermal zone 的 trip 点数：<pre class="pre codeblock" id="thermalzone__codeblock_x4w_2xt_vcc"><code>/sys/class/thermal/thermal_zone&lt;x&gt;</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre>并运行命令</li><br><br>                                    </ul> |

Note: 对温度门限配置的修改应仅用于测试目的。请勿更改 Tsens 的任何 thermal zone 配置。复位设备时，通过 `sysfs` 命令执行的修改将更改为默认值。

您可以在设备树中添加产品特定的 thermal zone 及其规则，以根据温控要求控制设备的温度，如以下部分所述：[配置新的 thermal zone](https://docs.qualcomm.com/doc/80-70015-30SC/topic/customize.html#customize__section_lq4_xxb_51c).

**Parent Topic:** [接口](https://docs.qualcomm.com/doc/80-70015-30SC/topic/thermal-interfaces.html)

Last Published: Nov 25, 2024

[Previous Topic
接口](https://docs.qualcomm.com/bundle/publicresource/80-70015-30SC/topics/thermal-interfaces.md) [Next Topic
cooling device](https://docs.qualcomm.com/bundle/publicresource/80-70015-30SC/topics/coolingdevices.md)