高通android设备themal读取cpu温度


以msm8953的themal分布信息,主要是下图的位置:

这其中 cpu相关的themal的位置有:

读取thermal 温度数据可以通过以下几个步骤:

获取sensor_info

root@msm8953_64:/ # cat /sys/module/msm_thermal/sensor_info
tsens:tsens_tz_sensor0::10 
tsens:tsens_tz_sensor1::10 
tsens:tsens_tz_sensor2:pop_mem:10 
tsens:tsens_tz_sensor3::10 
tsens:tsens_tz_sensor4:cpu4:10 
tsens:tsens_tz_sensor5:cpu5:10 
tsens:tsens_tz_sensor6:cpu6:10 
tsens:tsens_tz_sensor7:cpu7:10 
tsens:tsens_tz_sensor8:L2_cache_1:10 
tsens:tsens_tz_sensor9:cpu0:10 
tsens:tsens_tz_sensor10:cpu1:10 
tsens:tsens_tz_sensor11:cpu2:10 
tsens:tsens_tz_sensor12:cpu3:10 
tsens:tsens_tz_sensor13:L2_cache_0:10 
tsens:tsens_tz_sensor14::10 
tsens:tsens_tz_sensor15:gpu:10 
alarm:pm8953_tz::1000 
adc:pa_therm0::1 
adc:pa_therm1::1 
adc:xo_therm::1 
adc:xo_therm_buf::1 
adc:case_therm::1

在/sys/class/thermal/ 路径下可以看到所有的thermal_zone
 

msm8953_64:/sys/class/thermal # ls
thermal_zone0  thermal_zone11 thermal_zone14 thermal_zone17 thermal_zone2  thermal_zone22 thermal_zone4 thermal_zone7
thermal_zone1  thermal_zone12 thermal_zone15 thermal_zone18 thermal_zone20 thermal_zone23 thermal_zone5 thermal_zone8
thermal_zone10 thermal_zone13 thermal_zone16 thermal_zone19 thermal_zone21 thermal_zone3  thermal_zone6 thermal_zone9

那么怎么知道具体的温度信息就需要结合上面的sensor_info来对比分析了。

先获取所有的tmpe信息:
 

msm8953_64:/sys/class/thermal # cat */temp 
25000                                      
-40                                        
309                                        
309                                        
313                                        
322                                        
309                                        
306                                        
309                                        
319                                        
313                                        
303                                        
31                                         
306                                        
32636                                      
30                                         
25000                                      
30                                         
7                                          
24612                                      
306                                        
306                                        
306                                        
322                                        
bms   

每个节点对应的type

msm8953_64:/sys/class/thermal # cat */type
bms
pa_therm1
tsens_tz_sensor5
tsens_tz_sensor6
tsens_tz_sensor7
tsens_tz_sensor8
tsens_tz_sensor9
tsens_tz_sensor10
tsens_tz_sensor11
tsens_tz_sensor12
tsens_tz_sensor13
tsens_tz_sensor14
xo_therm
tsens_tz_sensor15
pm8953_tz
pa_therm0
battery
xo_therm_buf
case_therm
chg_temp
tsens_tz_sensor1
tsens_tz_sensor2
tsens_tz_sensor3
tsens_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摄氏度。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM