drivers/thermal/ 源码目录与模块索引

drivers/thermal/ 源码目录与模块索引

1. Core

文件 作用
thermal_core.c zone/cdev/governor注册、update、bind
thermal_helpers.c 读温、trend、cdev state提交
thermal_sysfs.c /sys/class/thermal
thermal_of.c DT thermal-zones解析
thermal_netlink.c generic netlink
thermal_hwmon.c thermal→hwmon桥接
thermal_core.h internal instance/locks/helpers

2. Governors

1
2
3
4
5
gov_step_wise.c
gov_fair_share.c
gov_bang_bang.c
gov_user_space.c
gov_power_allocator.c

3. Cooling

  • cpufreq_cooling.c
  • devfreq_cooling.c
  • cpuidle_cooling.c
  • fan cooling由相应 fan driver注册。

4. Generic sensors

  • thermal-generic-adc.c
  • thermal_mmio.c
  • SCMI thermal位于 firmware协议相关目录;
  • hwmon sensor可反向注册 thermal zone。

5. RK

文件 作用
rockchip_thermal.c TSADC
rk_virtual_thermal.c 厂商虚拟/聚合温区

6. 其它平台

Intel、QCOM TSENS、Tegra soctherm、Samsung TMU、TI bandgap、i.MX、MediaTek、Amlogic、Allwinner等。源码存在不代表 RK3588构建。

7. RK3588主配置

1
2
3
4
5
6
7
8
9
10
11
THERMAL=y
THERMAL_WRITABLE_TRIPS=y
THERMAL_DEFAULT_GOV_POWER_ALLOCATOR=y
THERMAL_GOV_FAIR_SHARE=y
THERMAL_GOV_STEP_WISE=y
THERMAL_GOV_USER_SPACE=y
THERMAL_GOV_POWER_ALLOCATOR=y
CPU_THERMAL=y
DEVFREQ_THERMAL=y
ROCKCHIP_THERMAL=y
ENERGY_MODEL=y

CPU_FREQ_THERMALCPU_THERMAL 下的 default y间接启用,仍以最终 .config 为准。

8. DTS

rk3588s.dtsi

  • thermal-zones;
  • tsadc@fec00000;
  • 7 channels;
  • 2MHz clock;
  • IRQ397;
  • TSHUT 120°C/CRU/active low;
  • base节点默认 disabled,板级通常 &tsadc { status = "okay"; }

9. API headers

  • include/linux/thermal.h
  • include/uapi/linux/thermal.h
  • include/trace/events/thermal.h
  • DT bindings under Documentation/devicetree/bindings/thermal/

文章互动

阅读 --

留言

0 条留言

正在加载留言…