提交 152395fd 编写于 作者: A Anson Huang 提交者: Eduardo Valentin

thermal: of-thermal: disable passive polling when thermal zone is disabled

When thermal zone is in passive mode, disabling its mode from
sysfs is NOT taking effect at all, it is still polling the
temperature of the disabled thermal zone and handling all thermal
trips, it makes user confused. The disabling operation should
disable the thermal zone behavior completely, for both active and
passive mode, this patch clears the passive_delay when thermal
zone is disabled and restores it when it is enabled.
Signed-off-by: NAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
上级 d316522d
......@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,
mutex_lock(&tz->lock);
if (mode == THERMAL_DEVICE_ENABLED)
if (mode == THERMAL_DEVICE_ENABLED) {
tz->polling_delay = data->polling_delay;
else
tz->passive_delay = data->passive_delay;
} else {
tz->polling_delay = 0;
tz->passive_delay = 0;
}
mutex_unlock(&tz->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册