summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2015-10-30 16:31:47 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-03 15:07:25 -0800
commit774ac8b7eff69e0786970157de2157e68b22f456 (patch)
treeaa623b0d242ad01b4e2ae418afae38c98368278b /include
parent2f59395e47008b7a6fafbf56b657222c57b1a92a (diff)
Thermal: initialize thermal zone device correctly
commit bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461 upstream. 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. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/thermal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 613c29bd6baf..103fcbe6bdaf 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -43,6 +43,9 @@
/* Default weight of a bound cooling device */
#define THERMAL_WEIGHT_DEFAULT 0
+/* use value, which < 0K, to indicate an invalid/uninitialized temperature */
+#define THERMAL_TEMP_INVALID -274000
+
/* Unit conversion macros */
#define DECI_KELVIN_TO_CELSIUS(t) ({ \
long _t = (t); \