1 /* SPDX-License-Identifier: GPL-2.0-only */
3 External (\PPKG, MethodObj)
5 #include <variant/thermal.h>
9 #define HAVE_THERMALZONE
17 // Thermal zone polling frequency: 10 seconds
20 // Thermal sampling period for passive cooling: 2 seconds
23 // Convert from Degrees C to 1/10 Kelvin for ACPI
34 // Threshold for OS to shutdown
35 Method (_CRT, 0, Serialized)
40 // Threshold for passive cooling
41 Method (_PSV, 0, Serialized)
46 // Processors used for passive cooling
47 Method (_PSL, 0, Serialized)
52 // Start fan at state 4 = lowest temp state
56 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
57 Notify (\_TZ.THRM, 0x81)
60 Method (TCHK, 0, Serialized)
62 // Get CPU Temperature from PECI via SuperIO TMPIN3
63 Local0 = \_SB.PCI0.LPCB.SIO.ENVC.TIN3
65 // Check for "no reading available"
67 Return (CTOK (FAN0_THRESHOLD_ON))
70 // Check for invalid readings
71 If ((Local0 == 255) || (Local0 == 0)) {
72 Return (CTOK (FAN0_THRESHOLD_ON))
75 // PECI raw value is an offset from Tj_max
78 // Handle values greater than Tj_max
79 If (Local1 >= \TMAX) {
83 // Subtract from Tj_max to get temperature
84 Local0 = \TMAX - Local1
85 Return (CTOK (Local0))
88 Method (_TMP, 0, Serialized)
90 // Get temperature from SuperIO in deci-kelvin
93 // Critical temperature in deci-kelvin
96 If (Local0 >= Local1) {
97 Printf ("CRITICAL TEMPERATURE: %o", Local0)
99 // Wait 1 second for SuperIO to re-poll
102 // Re-read temperature from SuperIO
105 Printf ("RE-READ TEMPERATURE: %o", Local0)
113 Return (CTOK (FAN0_THRESHOLD_OFF))
115 Return (CTOK (FAN0_THRESHOLD_ON))
121 Return (CTOK (FAN1_THRESHOLD_OFF))
123 Return (CTOK (FAN1_THRESHOLD_ON))
129 Return (CTOK (FAN2_THRESHOLD_OFF))
131 Return (CTOK (FAN2_THRESHOLD_ON))
137 Return (CTOK (FAN3_THRESHOLD_OFF))
139 Return (CTOK (FAN3_THRESHOLD_ON))
145 Return (CTOK (FAN4_THRESHOLD_OFF))
147 Return (CTOK (FAN4_THRESHOLD_ON))
151 Name (_AL0, Package () { FAN0 })
152 Name (_AL1, Package () { FAN1 })
153 Name (_AL2, Package () { FAN2 })
154 Name (_AL3, Package () { FAN3 })
155 Name (_AL4, Package () { FAN4 })
157 PowerResource (FNP0, 0, 0)
169 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN0_PWM
170 Notify (\_TZ.THRM, 0x81)
176 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN1_PWM
177 Notify (\_TZ.THRM, 0x81)
182 PowerResource (FNP1, 0, 0)
194 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN1_PWM
195 Notify (\_TZ.THRM, 0x81)
201 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN2_PWM
202 Notify (\_TZ.THRM, 0x81)
207 PowerResource (FNP2, 0, 0)
219 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN2_PWM
220 Notify (\_TZ.THRM, 0x81)
226 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN3_PWM
227 Notify (\_TZ.THRM, 0x81)
232 PowerResource (FNP3, 0, 0)
244 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN3_PWM
245 Notify (\_TZ.THRM, 0x81)
251 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
252 Notify (\_TZ.THRM, 0x81)
257 PowerResource (FNP4, 0, 0)
269 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
270 Notify (\_TZ.THRM, 0x81)
276 \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
277 Notify (\_TZ.THRM, 0x81)
284 Name (_HID, EISAID ("PNP0C0B"))
286 Name (_PR0, Package () { FNP0 })
291 Name (_HID, EISAID ("PNP0C0B"))
293 Name (_PR0, Package () { FNP1 })
298 Name (_HID, EISAID ("PNP0C0B"))
300 Name (_PR0, Package () { FNP2 })
305 Name (_HID, EISAID ("PNP0C0B"))
307 Name (_PR0, Package () { FNP3 })
312 Name (_HID, EISAID ("PNP0C0B"))
314 Name (_PR0, Package () { FNP4 })