高通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