以msm8953的themal分布信息,主要是下图的位置:
这其中 cpu相关的themal的位置有:
读取thermal 温度数据可以通过以下几个步骤:
获取sensor_info
root@msm8953_64:/ # cat /sys/module/msm_thermal/sensor_infotsens:tsens_tz_sensor0::10tsens:tsens_tz_sensor1::10tsens:tsens_tz_sensor2:pop_mem:10tsens:tsens_tz_sensor3::10tsens:tsens_tz_sensor4:cpu4:10tsens:tsens_tz_sensor5:cpu5:10tsens:tsens_tz_sensor6:cpu6:10tsens:tsens_tz_sensor7:cpu7:10tsens:tsens_tz_sensor8:L2_cache_1:10tsens:tsens_tz_sensor9:cpu0:10tsens:tsens_tz_sensor10:cpu1:10tsens:tsens_tz_sensor11:cpu2:10tsens:tsens_tz_sensor12:cpu3:10tsens:tsens_tz_sensor13:L2_cache_0:10tsens:tsens_tz_sensor14::10tsens:tsens_tz_sensor15:gpu:10alarm:pm8953_tz::1000adc:pa_therm0::1adc:pa_therm1::1adc:xo_therm::1adc:xo_therm_buf::1adc:case_therm::1
在/sys/class/thermal/ 路径下可以看到所有的thermal_zone
msm8953_64:/sys/class/thermal # lsthermal_zone0 thermal_zone11 thermal_zone14 thermal_zone17 thermal_zone2 thermal_zone22 thermal_zone4 thermal_zone7thermal_zone1 thermal_zone12 thermal_zone15 thermal_zone18 thermal_zone20 thermal_zone23 thermal_zone5 thermal_zone8thermal_zone10 thermal_zone13 thermal_zone16 thermal_zone19 thermal_zone21 thermal_zone3 thermal_zone6 thermal_zone9
那么怎么知道具体的温度信息就需要结合上面的sensor_info来对比分析了。
先获取所有的tmpe信息:
msm8953_64:/sys/class/thermal # cat */temp25000-403093093133223093063093193133033130632636302500030724612306306306322bms
每个节点对应的type
msm8953_64:/sys/class/thermal # cat */typebmspa_therm1tsens_tz_sensor5tsens_tz_sensor6tsens_tz_sensor7tsens_tz_sensor8tsens_tz_sensor9tsens_tz_sensor10tsens_tz_sensor11tsens_tz_sensor12tsens_tz_sensor13tsens_tz_sensor14xo_thermtsens_tz_sensor15pm8953_tzpa_therm0batteryxo_therm_bufcase_thermchg_temptsens_tz_sensor1tsens_tz_sensor2tsens_tz_sensor3tsens_tz_sensor4
这3者信息相结合,即可得到该thermal的温度信息;
举一个例子:
thermal_zone10 –> tsens_tz_sensor5 -> 309
在sensor_info中这个节点的信息是tsens:tsens_tz_sensor5:cpu5:10
最后的10 表示比例是1:10,也就是表示309是表示cpu5的温度是30.9摄氏度。