aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2018-07-30 12:56:49 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-08-20 15:00:40 -0400
commit152395fd03d4ce1e535a75cdbf58105e50587611 (patch)
tree3cd4e9f026c7072504e8cf867721c24a953b92da
parentd316522d06e9894429ace4b5f99e181bde4e7bd7 (diff)
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: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/of-thermal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 977a8307fbb1..4f2816559205 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,
260 260
261 mutex_lock(&tz->lock); 261 mutex_lock(&tz->lock);
262 262
263 if (mode == THERMAL_DEVICE_ENABLED) 263 if (mode == THERMAL_DEVICE_ENABLED) {
264 tz->polling_delay = data->polling_delay; 264 tz->polling_delay = data->polling_delay;
265 else 265 tz->passive_delay = data->passive_delay;
266 } else {
266 tz->polling_delay = 0; 267 tz->polling_delay = 0;
268 tz->passive_delay = 0;
269 }
267 270
268 mutex_unlock(&tz->lock); 271 mutex_unlock(&tz->lock);
269 272