mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
soc: rockchip: system_monitor: set the initial state to low temprature
The all cpus of big cluster will be closed when suspend, and cpu is booted before thermal when resume, the cpu frequency and voltage will be changed before thermal start, if the ambient temperature is low, the voltage may not be enough, so this path set the initial state to low temperature state and change the OPP Table before cpufreq start. Change-Id: I37ae1086e05df4dc4391f80ce5cc25a22d217b4a Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -900,18 +900,36 @@ rockchip_system_monitor_wide_temp_init(struct monitor_dev_info *info)
|
||||
{
|
||||
int ret, temp;
|
||||
|
||||
/*
|
||||
* set the init state to low temperature that the voltage will be enough
|
||||
* when cpu up at low temperature.
|
||||
*/
|
||||
if (!info->is_low_temp) {
|
||||
if (info->opp_table)
|
||||
rockchip_adjust_low_temp_opp_volt(info, true);
|
||||
info->wide_temp_limit = info->low_limit;
|
||||
info->is_low_temp = true;
|
||||
}
|
||||
|
||||
ret = thermal_zone_get_temp(system_monitor->tz, &temp);
|
||||
if (ret || temp == THERMAL_TEMP_INVALID) {
|
||||
dev_err(info->dev,
|
||||
"failed to read out thermal zone (%d)\n", ret);
|
||||
return;
|
||||
}
|
||||
if (temp < info->low_temp) {
|
||||
|
||||
if (temp > info->high_temp) {
|
||||
if (info->opp_table)
|
||||
rockchip_adjust_low_temp_opp_volt(info, true);
|
||||
info->wide_temp_limit = info->low_limit;
|
||||
} else if (temp > info->high_temp) {
|
||||
rockchip_adjust_low_temp_opp_volt(info, false);
|
||||
info->is_low_temp = false;
|
||||
|
||||
info->wide_temp_limit = info->high_limit;
|
||||
info->is_high_temp = true;
|
||||
} else if (temp > (info->low_temp + info->temp_hysteresis)) {
|
||||
if (info->opp_table)
|
||||
rockchip_adjust_low_temp_opp_volt(info, false);
|
||||
info->is_low_temp = false;
|
||||
info->wide_temp_limit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user