mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
drivers/thermal: Update state when temp is stable
Fix cooling state not decreasing error when the temperature is kept at low trip(stable, not dropping).
Test on "sim:thermal", log is from /proc/thermal/cpu-thermal and see thermal/thermal_dummy.c for trip point details.
e.g. The temperature decreasing from 71 to 65 and then kept.
z:cpu-thermal t:71 t:1 h:16 l:0 c:fan0 s:16|16
a. Without this patch, the cooling state of "fan0" will be kept at 15, even if the temperature is at a lower trip:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
b. With this patch, the cooling state of "fan0" was continually decreasing to zero according to current trip point:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:0|0
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
@@ -134,6 +134,10 @@ static unsigned int get_target_state(FAR struct thermal_instance_s *instance,
|
||||
return validate_state(instance, throttle, cur_state, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return validate_state(instance, throttle, cur_state, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user