[coreboot-gerrit] Change in ...coreboot[master]: soc/intel/common/dptf: Add method for temp conversion

Patrick Georgi (Code Review) gerrit at coreboot.org
Tue Dec 4 11:20:08 CET 2018


Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/29758 )

Change subject: soc/intel/common/dptf: Add method for temp conversion
......................................................................

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 at google.com>
Reviewed-on: https://review.coreboot.org/c/29758
Reviewed-by: Furquan Shaikh <furquan at google.com>
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
---
M src/soc/intel/common/acpi/dptf/dptf.asl
1 file changed, 15 insertions(+), 0 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Furquan Shaikh: Looks good to me, approved



diff --git a/src/soc/intel/common/acpi/dptf/dptf.asl b/src/soc/intel/common/acpi/dptf/dptf.asl
index beb41e2..1dd57c0 100644
--- a/src/soc/intel/common/acpi/dptf/dptf.asl
+++ b/src/soc/intel/common/acpi/dptf/dptf.asl
@@ -95,6 +95,21 @@
 		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"
 

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/29758
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6b1154f5ba13416131a029966d6d5c1598904881
Gerrit-Change-Number: 29758
Gerrit-PatchSet: 3
Gerrit-Owner: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: Patrick Rudolph <siro at das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181204/11f1c57f/attachment.html>


More information about the coreboot-gerrit mailing list