diff options
author | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-05-29 17:37:00 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2013-06-12 22:29:28 -0400 |
commit | 0c872507d84a6193cd769a808e65d34e1514b083 (patch) | |
tree | 496b20a5d5cbc8b84aaea8ebe9484fd2e22c6f21 | |
parent | 24c7a381720843f17efb42de81f7e85aefd6f616 (diff) |
thermal: consider emul_temperature while computing trend
In case emulated temperature is in use, using the trend
provided by driver layer can lead to bogus situation.
In this case, debugger user would set a temperature value,
but the trend would be from driver computation.
To avoid this situation, this patch changes the get_tz_trend()
to consider the emulated temperature whenever that is in use.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r-- | drivers/thermal/thermal_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d755440791b7..c00dc9275fc0 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c | |||
@@ -155,7 +155,8 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip) | |||
155 | { | 155 | { |
156 | enum thermal_trend trend; | 156 | enum thermal_trend trend; |
157 | 157 | ||
158 | if (!tz->ops->get_trend || tz->ops->get_trend(tz, trip, &trend)) { | 158 | if (tz->emul_temperature || !tz->ops->get_trend || |
159 | tz->ops->get_trend(tz, trip, &trend)) { | ||
159 | if (tz->temperature > tz->last_temperature) | 160 | if (tz->temperature > tz->last_temperature) |
160 | trend = THERMAL_TREND_RAISING; | 161 | trend = THERMAL_TREND_RAISING; |
161 | else if (tz->temperature < tz->last_temperature) | 162 | else if (tz->temperature < tz->last_temperature) |