From: Eduardo Valentin Date: Wed, 29 May 2013 21:37:00 +0000 (+0000) Subject: thermal: consider emul_temperature while computing trend X-Git-Tag: submit/tizen/20141121.110247~2938 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65f5fedb176d47fcc5cda26529ce2f8b10ff5075;p=platform%2Fkernel%2Flinux-3.10.git 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 Cc: Amit Daniel Kachhap Cc: Durgadoss R Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index cd9faa8..8f4be55 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -157,7 +157,8 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip) { enum thermal_trend trend; - if (!tz->ops->get_trend || tz->ops->get_trend(tz, trip, &trend)) { + if (tz->emul_temperature || !tz->ops->get_trend || + tz->ops->get_trend(tz, trip, &trend)) { if (tz->temperature > tz->last_temperature) trend = THERMAL_TREND_RAISING; else if (tz->temperature < tz->last_temperature)