Patchwork X60: add thermal zone 0

login
register
about
Submitter Sven Schnelle
Date 2011-03-06 17:46:52
Message ID <1299433612-7431-1-git-send-email-svens@stackframe.org>
Download mbox | patch
Permalink /patch/2743/
State Accepted
Commit r6434
Headers show

Comments

Sven Schnelle - 2011-03-06 17:46:52
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 src/mainboard/lenovo/x60/acpi/ec.asl      |    4 +++-
 src/mainboard/lenovo/x60/acpi/thermal.asl |   26 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)

Patch

diff --git a/src/mainboard/lenovo/x60/acpi/ec.asl b/src/mainboard/lenovo/x60/acpi/ec.asl
index 775fa58..f18b665 100644
--- a/src/mainboard/lenovo/x60/acpi/ec.asl
+++ b/src/mainboard/lenovo/x60/acpi/ec.asl
@@ -36,7 +36,9 @@  Device(EC)
 				LEDS, 8,	/* LED state */
 		Offset (0x3B),
 				    , 1,
-				KBLT, 1,         /* Keyboard Light */
+				KBLT, 1,        /* Keyboard Light */
+		Offset (0x78),
+				TMP0, 8,	/* Thermal Zone 0 temperature */
 		Offset (0x81),
 				PAGE, 8		/* Information Page Selector */
         }
diff --git a/src/mainboard/lenovo/x60/acpi/thermal.asl b/src/mainboard/lenovo/x60/acpi/thermal.asl
index e69de29..b7256ce 100644
--- a/src/mainboard/lenovo/x60/acpi/thermal.asl
+++ b/src/mainboard/lenovo/x60/acpi/thermal.asl
@@ -0,0 +1,26 @@ 
+Scope(\_TZ)
+{
+	Method(C2K, 1, NotSerialized)
+	{
+		Multiply(Arg0, 10, Local0)
+		Add (Local0, 2732, Local0)
+		if (LLessEqual(Local0, 2732)) {
+		        Return (3000)
+		}
+
+		if (LGreater(Local0, 4012)) {
+		        Return (3000)
+		}
+		Return (Local0)
+	}
+
+	ThermalZone(THM0)
+	{
+		Method(_CRT, 0, NotSerialized) {
+			Return (C2K(127))
+		}
+		Method(_TMP) {
+			Return (C2K(\_SB.PCI0.LPCB.EC.TMP0))
+		}
+	}
+}