温控daemon(八)总结

温控的daemon,可以分为device、sensor、algorithm三大块。

1. device一般为cpu、gpu等,具体可以调频、拔核等。

 

2. sensor一般为温度的sensor,每个sensor会启动两个thread:

其中一个thread用来检测sensor的温度,上层会设置thresholds到sensor驱动,然后daemon会使用poll等待驱动是事件,当温度大于high或者小于low时,驱动会有事件上来,这个时候poll继续执行,并且使能另一个thread。

另一个thread使能之后,会去遍历sensor的client,而这些client都是在算法初始化的时候加入的。最后调用client的回调,这样可以继续使能算法的thread继续执行算法的流程(调频、拔核等)

 

3. algorithm算法,每个算法会启动一个thread来执行算法,算法的thread会被sensor的thread唤醒,具体唤醒是因为温度满足sensor的大于high或者小于low,这样算法thread继续执行。

 

还有另外一部分是给别的进程使用,比如camera,是通过socket。当温度满足条件会去client端调用其回调函数。

 

 

你可能感兴趣的:(android,thermal)