summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-03-25 06:40:09 +0400
committerZhang Rui <rui.zhang@intel.com>2014-10-10 09:57:15 +0400
commit7b83fd9d91a411158f72d36958103c708c3b5a86 (patch)
tree918ae19513e4f3f5553ad31908695cfddef0b921 /include/linux
parentd806c6e9cdfd6c5663687ec7109e151c0ff66639 (diff)
downloadlinux-7b83fd9d91a411158f72d36958103c708c3b5a86.tar.xz
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')
-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"