1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* Thermal Threshold Event Handler */
4 #define HAVE_THERM_EVENT_HANDLER
6 #if CONFIG(EC_SUPPORTS_DPTF_TEVT)
7 Method (TEVT, 1, NotSerialized)
9 Local0 = ToInteger (Arg0)
11 #ifdef DPTF_TSR0_SENSOR_ID
12 If (Local0 == DPTF_TSR0_SENSOR_ID) {
16 #ifdef DPTF_TSR1_SENSOR_ID
17 If (Local0 == DPTF_TSR1_SENSOR_ID) {
21 #ifdef DPTF_TSR2_SENSOR_ID
22 If (Local0 == DPTF_TSR2_SENSOR_ID) {
29 /* Thermal device initialization - Disable Aux Trip Points */
32 #ifdef DPTF_TSR0_SENSOR_ID
35 #ifdef DPTF_TSR1_SENSOR_ID
38 #ifdef DPTF_TSR2_SENSOR_ID
43 #ifdef DPTF_TSR0_SENSOR_ID
46 Name (_HID, EISAID ("INT3403"))
49 Name (TMPI, DPTF_TSR0_SENSOR_ID)
50 Name (_STR, Unicode (DPTF_TSR0_SENSOR_NAME))
51 Name (GTSH, 20) /* 2 degree hysteresis */
62 Method (_TMP, 0, Serialized)
64 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
69 Return (CTOK (DPTF_TSR0_PASSIVE))
74 Return (CTOK (DPTF_TSR0_CRITICAL))
79 /* Set Aux Trip Point */
80 Method (PAT0, 1, Serialized)
82 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
85 /* Set Aux Trip Point */
86 Method (PAT1, 1, Serialized)
88 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
91 /* Disable Aux Trip Point */
92 Method (PATD, 0, Serialized)
94 \_SB.PCI0.LPCB.EC0.PATD (TMPI)
99 #ifdef DPTF_TSR1_SENSOR_ID
102 Name (_HID, EISAID ("INT3403"))
105 Name (TMPI, DPTF_TSR1_SENSOR_ID)
106 Name (_STR, Unicode (DPTF_TSR1_SENSOR_NAME))
107 Name (GTSH, 20) /* 2 degree hysteresis */
118 Method (_TMP, 0, Serialized)
120 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
125 Return (CTOK (DPTF_TSR1_PASSIVE))
130 Return (CTOK (DPTF_TSR1_CRITICAL))
135 /* Set Aux Trip Point */
136 Method (PAT0, 1, Serialized)
138 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
141 /* Set Aux Trip Point */
142 Method (PAT1, 1, Serialized)
144 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
147 /* Disable Aux Trip Point */
148 Method (PATD, 0, Serialized)
150 \_SB.PCI0.LPCB.EC0.PATD (TMPI)
155 #ifdef DPTF_TSR2_SENSOR_ID
158 Name (_HID, EISAID ("INT3403"))
161 Name (TMPI, DPTF_TSR2_SENSOR_ID)
162 Name (_STR, Unicode (DPTF_TSR2_SENSOR_NAME))
163 Name (GTSH, 20) /* 2 degree hysteresis */
174 Method (_TMP, 0, Serialized)
176 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
181 Return (CTOK (DPTF_TSR2_PASSIVE))
186 Return (CTOK (DPTF_TSR2_CRITICAL))
191 /* Set Aux Trip Point */
192 Method (PAT0, 1, Serialized)
194 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
197 /* Set Aux Trip Point */
198 Method (PAT1, 1, Serialized)
200 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
203 /* Disable Aux Trip Point */
204 Method (PATD, 0, Serialized)
206 \_SB.PCI0.LPCB.EC0.PATD (TMPI)