summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_core.h
diff options
context:
space:
mode:
authorZhang Rui2015-10-30 09:31:47 +0100
committerZhang Rui2015-12-29 08:59:44 +0100
commitbb431ba26c5cd0a17c941ca6c3a195a3a6d5d461 (patch)
tree10368cd1731f1856bade627fa1f38acd9150d3a5 /drivers/thermal/thermal_core.h
parentLinux 4.4-rc7 (diff)
downloadkernel-qcow2-linux-bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461.tar.gz
kernel-qcow2-linux-bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461.tar.xz
kernel-qcow2-linux-bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461.zip
Thermal: initialize thermal zone device correctly
After thermal zone device registered, as we have not read any temperature before, thus tz->temperature should not be 0, which actually means 0C, and thermal trend is not available. In this case, we need specially handling for the first thermal_zone_device_update(). Both thermal core framework and step_wise governor is enhanced to handle this. And since the step_wise governor is the only one that uses trends, so it's the only thermal governor that needs to be updated. CC: <stable@vger.kernel.org> #3.18+ Tested-by: Manuel Krause <manuelkrause@netscape.net> Tested-by: szegad <szegadlo@poczta.onet.pl> Tested-by: prash <prash.n.rao@gmail.com> Tested-by: amish <ammdispose-arch@yahoo.com> Tested-by: Matthias <morpheusxyz123@yahoo.de> Reviewed-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_core.h')
-rw-r--r--drivers/thermal/thermal_core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index d7ac1fccd659..749d41abfbab 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -41,6 +41,7 @@ struct thermal_instance {
struct thermal_zone_device *tz;
struct thermal_cooling_device *cdev;
int trip;
+ bool initialized;
unsigned long upper; /* Highest cooling state for this trip point */
unsigned long lower; /* Lowest cooling state for this trip point */
unsigned long target; /* expected cooling state */