thermal_init thermal_netlink_init genl_register_family(&thermal_gnl_family) 注册thermal的generic netlink family,分别设置了 - thermal_genl_policy,分为thermal zone, governor, cooling devices三类 - thermal_genl_ops,对应tz get id, tz get trip, tz get temp, tz get gov, cooling device get的cmd、validate和doit/dumpit(单次请求和多次请求) - thermal_genl_mcgrps,多播组,包含sampling group name和event group name thermal_register_governors - THERMAL_GOVERNOR_DECLARE宏把源文件中的governor定义到特定代码段 遍历所有governor:thermal_register_governor thermal_set_governor(tz, governor) class_register(&thermal_class) 注册thermal_release,提供thermal_zone_device和thermal_cooling_device调用不同的回收函数 of_parse_ipa_sensor_index_table[CONFIG_IPA_THERMAL] 读取IPA相关dts中参数 of_parse_thermal_zones 读取thermal zone信息,build thermal zone,包含polling-delay(passive), coefficients, trips, cooling-maps等 ipa_weights_cfg_init[CONFIG_THERMAL_SPM] 读取更多IPA相关参数 register_pm_notifier(&thermal_pm_nb) 注册pm相关回调,主要是suspend