summaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-03-25 10:40:09 +0800
committerZhang Rui <rui.zhang@intel.com>2014-10-10 13:57:15 +0800
commit7b83fd9d91a411158f72d36958103c708c3b5a86 (patch)
tree918ae19513e4f3f5553ad31908695cfddef0b921 /include/linux/thermal.h
parentd806c6e9cdfd6c5663687ec7109e151c0ff66639 (diff)
downloadlinux-7b83fd9d91a411158f72d36958103c708c3b5a86.tar.gz
linux-7b83fd9d91a411158f72d36958103c708c3b5a86.tar.bz2
linux-7b83fd9d91a411158f72d36958103c708c3b5a86.zip
Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h
This macro can be used by other component so move it to a common header, but in a slightly different way: define two macros, one macro with an offset and the other doesn't. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 0305cde21a74..79ce6b94884a 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -44,6 +44,8 @@
#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
((long)t-2732+5)/10 : ((long)t-2732-5)/10)
#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
+#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100)
+#define DECI_KELVIN_TO_MILLICELSIUS(t) DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, 2732)
/* Adding event notification support elements */
#define THERMAL_GENL_FAMILY_NAME "thermal_event"