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;

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值