summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-11-20 17:22:24 -0800
committerPatrick Georgi <pgeorgi@google.com>2018-12-04 10:19:57 +0000
commit84227611d5c06d1482097df6f954b03fa3043a74 (patch)
tree664af0cbbecb774283bb1a5a8fe23a530521a50f
parentb94c867bb1dfcb0ec511e1cbe1f9bd5186e81385 (diff)
soc/intel/common/dptf: Add method for temp conversion
Add a method to convert from 1/10 Kelvin to Celsius. This is useful for EC devices where the sensor temperature are stored in Celsius instead of Kelvin. Change-Id: I6b1154f5ba13416131a029966d6d5c1598904881 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/c/29758 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/intel/common/acpi/dptf/dptf.asl15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/soc/intel/common/acpi/dptf/dptf.asl b/src/soc/intel/common/acpi/dptf/dptf.asl
index beb41e2dea..1dd57c04dc 100644
--- a/src/soc/intel/common/acpi/dptf/dptf.asl
+++ b/src/soc/intel/common/acpi/dptf/dptf.asl
@@ -95,6 +95,21 @@ Device (DPTF)
Return (Local0)
}
+ /* Convert from 1/10 Kelvin to Degrees C for ACPI */
+ Method (KTOC, 1) {
+ If (LLessEqual (Arg0, 2732)) {
+ Return (0)
+ }
+
+ /* Convert to Celsius */
+ Subtract (Arg0, 2732, Local0)
+
+ /* Convert from 10th of degrees */
+ Divide (Local0, 10,, Local0)
+
+ Return (Local0)
+ }
+
/* Include Thermal Participants */
#include "thermal.asl"