summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-09-22 12:06:09 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:28:33 +0800
commit9d8b2c4dd23f14c47c90dde56f7d370d91f8fb71 (patch)
tree16879ccd759ac5bb1229bca31c8f7ab53e72ef27 /drivers/thermal
parent42b1fa466fb7579ba5ce9b4d71244538ab2f7354 (diff)
MLK-16526-1 thermal: imx_sc: add buffer for passive cooling mechanism
On i.MX8QM/8QXP, When temperature exceeds passive point, the cooling mechanism will be trigger and temperature will begin to drop, to avoid back and forth surrounding the passive point, here adds 10 C buffer for passive point, that means when cooling mechanism is trigger, only after the temperature drop to 10 C below the passive point, the cooling mechanism will exit. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_sc_thermal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index 8503c38a4507..eb4c535b9fc5 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -20,6 +20,8 @@
#include "thermal_core.h"
+#define IMX_SC_TEMP_PASSIVE_COOL_DELTA 10000
+
struct imx_sc_sensor {
struct thermal_zone_device *tzd;
struct thermal_cooling_device *cdev;
@@ -91,7 +93,8 @@ static int imx_sc_tsens_get_trend(void *p, int trip, enum thermal_trend *trend)
trip_temp = (trip == IMX_TRIP_PASSIVE) ? sensor->temp_passive :
sensor->temp_critical;
- if (sensor->tzd->temperature >= trip_temp)
+ if (sensor->tzd->temperature >=
+ (trip_temp - IMX_SC_TEMP_PASSIVE_COOL_DELTA))
*trend = THERMAL_TREND_RAISE_FULL;
else
*trend = THERMAL_TREND_DROP_FULL;