Thermal记录
高通865,內核版本4.19
drivers/thermal/of-thermal.c
thermal_of_populate_trip? ?//解析trip具體參數??tz->ntrips
thermal_of_build_thermal_zone? // 解析每個zone 用于生成/sys/devices/virtual/thermal/thermal_zone*各個虛擬設備和節點,返回結構體__thermal_zone
of_parse_thermal_zones調用thermal_of_build_thermal_zone解析設備樹
?
核心函數:
void thermal_zone_device_update(struct thermal_zone_device *tz,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? enum thermal_notify_event event)
{
? ? ? ? int count;
? ? ? ? if (atomic_read(&in_suspend) && (!tz->ops->is_wakeable ||
? ? ? ? ? ? ? ? !(tz->ops->is_wakeable(tz))))
? ? ? ? ? ? ? ? return;
? ? ? ? if (!tz->ops->get_temp)
? ? ? ? ? ? ? ? return;
? ? ? ? trace_thermal_device_update(tz, event);
? ? ? ? update_temperature(tz);
? ? ? ? thermal_zone_set_trips(tz);
? ? ? ? tz->notify_event = event;
? ? ? ? for (count = 0; count < tz->trips; count++)
? ? ? ? ? ? ? ? handle_thermal_trip(tz, count);
}
thermal_zone_set_trips? 計算low 和 high,并調用
// Set a temperature window. When this window is left the driver
//?must inform the thermal core via thermal_zone_device_update.
ret = tz->ops->set_trips(tz, low, high); 這個函數會設置到硬件寄存器里,bcl對應下面三個設置函數
qcom/bcl_pmic5.c:507:?? ?vbat->ops.set_trips = bcl_set_vbat;
qcom/bcl_pmic5.c:542:?? ?ibat->ops.set_trips = bcl_set_ibat;
qcom/bcl_pmic5.c:576:?? ?lbat->ops.set_trips = bcl_set_lbat;
?
?
?
?
?
?
?
?
總結
- 上一篇: 汽车冬季养护的四个重点
- 下一篇: AOE网络-关键路径