> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 风扇

Dragonwing IQ‑9075 EVK 的设计功耗最高可达 70 W,因此需要相当规模的散热方案。默认的散热方案基于风扇,使用安装在设备底部的 CPU 散热器。

该板卡使用的风扇控制器是 Texas Instruments AMC6821SQDBQRQ1 PWM 风扇控制器 IC。风扇通过主板上的 JFAN 连接器(S6B‑XH‑SM4‑TB(LF)(SN))连接。

![](https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_Thermal_Headsink_Fan.png?fit=max\&auto=format\&n=P0rmO3AZfXx7cgqQ\&q=85\&s=60463f52f1968462ffe24ba71468c2da)

**风扇连接器与 IQ-9075 EVK 主板的连接详情:**

![](https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_JFAN_connector.png?fit=max\&auto=format\&n=P0rmO3AZfXx7cgqQ\&q=85\&s=cd82da9c0376b6883b5dba7be52051cb)

## 概述

风扇控制器根据温度输入调节风扇转速,以确保最佳的散热性能和能效。它支持多种工作模式,并可通过系统节点动态配置。

## 特性

* 支持两种工作模式:手动模式和自动模式(模式 2)
* 基于温度输入的动态风扇转速控制

## 工作模式

| 模式 | 说明 |
| - | - |
| **手动模式(模式 1)** | 风扇转速由用户手动设置。没有基于温度的自动控制。 |
| **自动模式(模式 2)** | 风扇转速根据远程温度传感器读数自动控制。这是当前启用的模式。 |

## 工作原理

**1. 初始化**

系统启动并加载风扇控制器配置。

**2. 模式选择**

将 `pwm1_enable` 节点设置为 `2` 以启用自动模式。

**3. 温度监控**

远程温度传感器持续监控系统温度。

**4. PWM 调节**

控制器根据温度调节 PWM 信号(0–255)以控制风扇转速。

**5. 风扇转速控制**

风扇转速(`fan1_input`)相应地增大或减小。

**6. 阈值处理**

如果温度降至 `temp2_auto_point1_temp` 以下,风扇将被关闭。

## 模式详情与验证

> [tab] 自动模式(模式 2)
>
> ### 说明
>
> 在自动模式下,风扇转速根据远程温度传感器(`temp2_input`)自动控制。系统根据预定义的温度阈值调节风扇功率和转速,以确保高效散热。
>
> ### 节点路径
>
> 所有相关节点位于:
>
> ```bash theme={null}
> /sys/class/hwmon/hwmonX/
> ```
>
> ![](https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_Fan_hwmon_nodes.png?fit=max\&auto=format\&n=P0rmO3AZfXx7cgqQ\&q=85\&s=eabdee57191c4e38b0c7973e7ed4f87e)
>
> ### 温度阈值
>
> | 温度范围(°C) | 节点值(毫摄氏度) | 风扇行为 | 功率(PWM1) |
> | - | - | - | - |
> | 低于 0°C | `temp2_auto_point1_temp` = 0 | 风扇停止 | 0 |
> | 0°C – 48°C | `temp2_auto_point1_temp` 至 `temp2_auto_point2_temp` = 48000 | 风扇以最低转速运行 | \~85 |
> | 48°C – 58°C | `temp2_auto_point2_temp` 至 `temp2_auto_point3_temp` = 58000 | 风扇高速运行 | 255 |
>
> ### 关键节点
>
> | 节点 | 用途 |
> | - | - |
> | `pwm1_enable` | 设置为 `2` 以启用自动模式 |
> | `temp2_input` | 当前远程温度 |
> | `fan1_input` | 当前风扇转速(RPM) |
> | `pwm1` | 当前输入到风扇的功率(0–255) |
> | `temp2_auto_point1_temp` | 下限阈值(风扇关闭) |
> | `temp2_auto_point2_temp` | 中间阈值(低速) |
> | `temp2_auto_point3_temp` | 上限阈值(高速) |
>
> ### 验证
>
> > [!NOTE]
> >
> > 对于 IQ-9075,`amc6821` 位于 `hwmon0`,因此 `X` = `0`。
>
> **1. 确认模式**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/pwm1_enable
> ```
>
> 确保输出为 `2`。
>
> **2. 监控温度**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/temp2_input
> ```
>
> **3. 检查风扇转速**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/fan1_input
> ```
>
> **4. 检查功率输入**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/pwm1
> ```
>
> **5. 观察行为**
>
> * 低于 `temp2_auto_point1_temp`:风扇应停止(`fan1_input` = 0,`pwm1` = 0)
> * 在 point1 与 point2 之间:风扇低速运行(`pwm1` ≈ 85)
> * 在 point2 与 point3 之间:风扇全速运行(`pwm1` = 255)

> [tab] 手动模式(模式 1)
>
> ### 说明
>
> 在手动模式下,风扇转速由用户设置,与温度无关。通过 `pwm1` 节点调节输入到风扇控制器的功率。
>
> ### 节点路径
>
> 所有相关节点位于:
>
> ```bash theme={null}
> /sys/class/hwmon/hwmonX/
> ```
>
> ### 关键节点
>
> | 节点 | 用途 |
> | - | - |
> | `pwm1_enable` | 设置为 `1` 以启用手动模式 |
> | `pwm1` | 设置功率输入以控制风扇转速(0–255) |
>
> ### 验证
>
> **1. 确认模式**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/pwm1_enable
> ```
>
> 确保输出为 `1`。
>
> **2. 调节功率输入**
>
> ```bash theme={null}
> echo <value> > /sys/class/hwmon/hwmonX/pwm1
> ```
>
> 设置所需的功率输入值(0–255)。
>
> **3. 检查风扇转速**
>
> ```bash theme={null}
> cat /sys/class/hwmon/hwmonX/fan1_input
> ```
>
> 确保风扇转速随所设置的功率输入变化。

> [!NOTE]
>
> AMC6821 风扇控制器的实际 hwmon 编号可能有所不同。要确定正确的编号:
>
> ```bash theme={null}
> grep "amc6821" hwmon*/name
> ```
>
> 预期输出:
>
> ```bash theme={null}
> ubuntu@ubuntu:/sys/class/hwmon$ grep "amc6821" hwmon*/name
> hwmon0/name:amc6821
> ```
