1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* Generated by acpigen */
4 External (\PPKG, MethodObj)
6 #include <variant/thermal.h>
10 #define HAVE_THERMALZONE
18 // Thermal zone polling frequency: 10 seconds
21 // Thermal sampling period for passive cooling: 2 seconds
24 // Convert from Degrees C to 1/10 Kelvin for ACPI
35 // Threshold for OS to shutdown
36 Method (_CRT, 0, Serialized)
41 // Threshold for passive cooling
42 Method (_PSV, 0, Serialized)
47 // Processors used for passive cooling
48 Method (_PSL, 0, Serialized)
53 Method (TCHK, 0, Serialized)
55 // Get Temperature from TIN# set in NVS
56 Local0 = \_SB.PCI0.LPCB.EC0.TINS (TMPS)
58 // Check for sensor not calibrated
59 If (Local0 == \_SB.PCI0.LPCB.EC0.TNCA) {
63 // Check for sensor not present
64 If (Local0 == \_SB.PCI0.LPCB.EC0.TNPR) {
68 // Check for sensor not powered
69 If (Local0 == \_SB.PCI0.LPCB.EC0.TNOP) {
73 // Check for sensor bad reading
74 If (Local0 == \_SB.PCI0.LPCB.EC0.TBAD) {
78 // Adjust by offset to get Kelvin
79 Local0 += \_SB.PCI0.LPCB.EC0.TOFS
81 // Convert to 1/10 Kelvin
86 Method (_TMP, 0, Serialized)
88 // Get temperature from EC in deci-kelvin
91 // Critical temperature in deci-kelvin
94 If (Local0 >= Local1) {
95 Printf ("CRITICAL TEMPERATURE: %o", Local0)
97 // Wait 1 second for EC to re-poll
100 // Re-read temperature from EC
103 Printf ("RE-READ TEMPERATURE: %o", Local0)
112 Return (CTOK (CTL_TDP_THRESHOLD_OFF))
114 Return (CTOK (CTL_TDP_THRESHOLD_ON))
121 Return (CTOK (CTL_TDP_THRESHILD_NORMAL))
123 Return (CTOK (CTL_TDP_THRESHILD_NORMAL))
127 Name (_AL0, Package () { TDP0 })
128 Name (_AL1, Package () { TDP1 })
130 PowerResource (TNP0, 0, 0)
142 /* Enable Power Limit */
143 \_SB.PCI0.MCHC.CTLE (CTL_TDP_POWER_LIMIT)
145 Notify (\_TZ.THRM, 0x81)
150 /* Disable Power Limit */
151 \_SB.PCI0.MCHC.CTLD ()
153 Notify (\_TZ.THRM, 0x81)
157 PowerResource (TNP1, 0, 0)
168 Notify (\_TZ.THRM, 0x81)
172 Notify (\_TZ.THRM, 0x81)
178 Name (_HID, EISAID ("PNP0C0B"))
180 Name (_PR0, Package () { TNP0 })
185 Name (_HID, EISAID ("PNP0C0B"))
187 Name (_PR0, Package () { TNP1 })