[coreboot-gerrit] Change in coreboot[master]: ec/lenovo/h8/acpi/thermal: Add ACPI fan control

Patrick Rudolph (Code Review) gerrit at coreboot.org
Sun Aug 27 18:13:54 CEST 2017


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/21227


Change subject: ec/lenovo/h8/acpi/thermal: Add ACPI fan control
......................................................................

ec/lenovo/h8/acpi/thermal: Add ACPI fan control

Disengage the fan 10 degree below passive threshold as the automatic EC fan
control does not engage the FAN even when CPU starts melting ...

Tested on Lenovo T430:
The fan disengages at 80°C and keeps running at full speed until temperature
drops below 80°C.

Change-Id: I075ff5c69676927db1c5e731294e18796884f97e
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/ec/lenovo/h8/acpi/ec.asl
M src/ec/lenovo/h8/acpi/thermal.asl
2 files changed, 53 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/21227/1

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index eed0e16..78ce2da 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -39,6 +39,10 @@
 				DKR2, 1,	/* Dock register 2 */
 		Offset (0x2a),
 				EVNT, 8,	/* write will trigger EC event */
+		Offset (0x2f),
+				    , 6,
+				FAND, 1,	/* Fan disengage */
+				FANA, 1,	/* Fan automatic mode enable */
 		Offset (0x30),
 				    , 6,
 				ALMT, 1,	/* Audio Mute + LED */
diff --git a/src/ec/lenovo/h8/acpi/thermal.asl b/src/ec/lenovo/h8/acpi/thermal.asl
index fe765c6..0c72a5b 100644
--- a/src/ec/lenovo/h8/acpi/thermal.asl
+++ b/src/ec/lenovo/h8/acpi/thermal.asl
@@ -81,6 +81,55 @@
 #endif
 			Return (C2K(\_SB.PCI0.LPCB.EC.TMP0))
 		}
+
+		Method (_AC0) {
+			Store (\TPSV, Local0)
+			if (LLessEqual(Local0, Zero)) {
+				Store (95, Local0)
+			}
+
+			/* Active fan 10 degree below passive threshold */
+			Subtract (Local0, 10, Local0)
+
+			If (LGreater (\_SB.PCI0.LPCB.EC.FAND, Zero)) {
+				/* Turn of 5 degree below trip point */
+				Subtract (Local0, 5, Local0)
+			}
+
+			Return (C2K (Local0))
+		}
+
+		Name (_AL0, Package () { TDP0 })
+
+		PowerResource (TNP0, 0, 0)
+		{
+			Method (_STA) {
+				If (LLessEqual (\_SB.PCI0.LPCB.EC.FAND, 0)) {
+					Return (Zero)
+				} Else {
+					Return (One)
+				}
+			}
+
+			Method (_ON)  {
+				Store (One, \_SB.PCI0.LPCB.EC.FAND)
+				Store (Zero, \_SB.PCI0.LPCB.EC.FANA)
+				Notify (\_TZ.THM0, 0x81)
+			}
+
+			Method (_OFF) {
+				Store (Zero, \_SB.PCI0.LPCB.EC.FAND)
+				Store (One, \_SB.PCI0.LPCB.EC.FANA)
+				Notify (\_TZ.THM0, 0x81)
+			}
+		}
+
+		Device (TDP0)
+		{
+			Name (_HID, EISAID ("PNP0C0B"))
+			Name (_UID, 0)
+			Name (_PR0, Package () { TNP0 })
+		}
 	}
 
 	ThermalZone(THM1)

-- 
To view, visit https://review.coreboot.org/21227
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I075ff5c69676927db1c5e731294e18796884f97e
Gerrit-Change-Number: 21227
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170827/daaf55fd/attachment.html>


More information about the coreboot-gerrit mailing list