blob: 2f49ffe1dbc65a793e9e01a2b572d6c5f2e455c4 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Rothebabfad2016-04-10 11:09:16 -06002
Lee Leahy77ff0b12015-05-05 15:07:29 -07003/* Thermal Threshold Event Handler */
Frans Hendriks9cb88a72019-12-06 11:54:01 +01004#define HAVE_THERM_EVENT_HANDLER
5
6#if CONFIG(EC_SUPPORTS_DPTF_TEVT)
Lee Leahy77ff0b12015-05-05 15:07:29 -07007Method (TEVT, 1, NotSerialized)
8{
Felix Singer84e61232022-12-12 07:39:15 +01009 Local0 = ToInteger (Arg0)
Lee Leahy77ff0b12015-05-05 15:07:29 -070010
11#ifdef DPTF_TSR0_SENSOR_ID
Felix Singeredec4d92022-12-11 21:25:32 +010012 If (Local0 == DPTF_TSR0_SENSOR_ID) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070013 Notify (^TSR0, 0x90)
14 }
15#endif
16#ifdef DPTF_TSR1_SENSOR_ID
Felix Singeredec4d92022-12-11 21:25:32 +010017 If (Local0 == DPTF_TSR1_SENSOR_ID) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070018 Notify (^TSR1, 0x90)
19 }
20#endif
21#ifdef DPTF_TSR2_SENSOR_ID
Felix Singeredec4d92022-12-11 21:25:32 +010022 If (Local0 == DPTF_TSR2_SENSOR_ID) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070023 Notify (^TSR2, 0x90)
24 }
25#endif
26}
Frans Hendriks34510c32018-07-09 12:29:47 +020027#endif
Lee Leahy77ff0b12015-05-05 15:07:29 -070028
29/* Thermal device initialization - Disable Aux Trip Points */
30Method (TINI)
31{
32#ifdef DPTF_TSR0_SENSOR_ID
33 ^TSR0.PATD ()
34#endif
35#ifdef DPTF_TSR1_SENSOR_ID
36 ^TSR1.PATD ()
37#endif
38#ifdef DPTF_TSR2_SENSOR_ID
39 ^TSR2.PATD ()
40#endif
41}
42
43#ifdef DPTF_TSR0_SENSOR_ID
44Device (TSR0)
45{
46 Name (_HID, EISAID ("INT3403"))
47 Name (_UID, 1)
48 Name (PTYP, 0x03)
49 Name (TMPI, DPTF_TSR0_SENSOR_ID)
50 Name (_STR, Unicode (DPTF_TSR0_SENSOR_NAME))
51 Name (GTSH, 20) /* 2 degree hysteresis */
52
53 Method (_STA)
54 {
Felix Singer7b8ac002022-12-26 08:45:56 +010055 If (\DPTE == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070056 Return (0xF)
57 } Else {
58 Return (0x0)
59 }
60 }
61
62 Method (_TMP, 0, Serialized)
63 {
64 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
65 }
66
67 Method (_PSV)
68 {
Lee Leahy32471722015-04-20 15:20:28 -070069 Return (CTOK (DPTF_TSR0_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -070070 }
71
72 Method (_CRT)
73 {
Lee Leahy32471722015-04-20 15:20:28 -070074 Return (CTOK (DPTF_TSR0_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -070075 }
76
77 Name (PATC, 2)
78
79 /* Set Aux Trip Point */
80 Method (PAT0, 1, Serialized)
81 {
82 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
83 }
84
85 /* Set Aux Trip Point */
86 Method (PAT1, 1, Serialized)
87 {
88 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
89 }
90
91 /* Disable Aux Trip Point */
92 Method (PATD, 0, Serialized)
93 {
94 \_SB.PCI0.LPCB.EC0.PATD (TMPI)
95 }
96}
97#endif
98
99#ifdef DPTF_TSR1_SENSOR_ID
100Device (TSR1)
101{
102 Name (_HID, EISAID ("INT3403"))
103 Name (_UID, 2)
104 Name (PTYP, 0x03)
105 Name (TMPI, DPTF_TSR1_SENSOR_ID)
106 Name (_STR, Unicode (DPTF_TSR1_SENSOR_NAME))
107 Name (GTSH, 20) /* 2 degree hysteresis */
108
109 Method (_STA)
110 {
Felix Singer7b8ac002022-12-26 08:45:56 +0100111 If (\DPTE == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700112 Return (0xF)
113 } Else {
114 Return (0x0)
115 }
116 }
117
118 Method (_TMP, 0, Serialized)
119 {
120 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
121 }
122
123 Method (_PSV)
124 {
Lee Leahy32471722015-04-20 15:20:28 -0700125 Return (CTOK (DPTF_TSR1_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700126 }
127
128 Method (_CRT)
129 {
Lee Leahy32471722015-04-20 15:20:28 -0700130 Return (CTOK (DPTF_TSR1_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700131 }
132
133 Name (PATC, 2)
134
135 /* Set Aux Trip Point */
136 Method (PAT0, 1, Serialized)
137 {
138 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
139 }
140
141 /* Set Aux Trip Point */
142 Method (PAT1, 1, Serialized)
143 {
144 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
145 }
146
147 /* Disable Aux Trip Point */
148 Method (PATD, 0, Serialized)
149 {
150 \_SB.PCI0.LPCB.EC0.PATD (TMPI)
151 }
152}
153#endif
154
155#ifdef DPTF_TSR2_SENSOR_ID
156Device (TSR2)
157{
158 Name (_HID, EISAID ("INT3403"))
159 Name (_UID, 3)
160 Name (PTYP, 0x03)
161 Name (TMPI, DPTF_TSR2_SENSOR_ID)
162 Name (_STR, Unicode (DPTF_TSR2_SENSOR_NAME))
163 Name (GTSH, 20) /* 2 degree hysteresis */
164
165 Method (_STA)
166 {
Felix Singer7b8ac002022-12-26 08:45:56 +0100167 If (\DPTE == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700168 Return (0xF)
169 } Else {
170 Return (0x0)
171 }
172 }
173
174 Method (_TMP, 0, Serialized)
175 {
176 Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI))
177 }
178
179 Method (_PSV)
180 {
Lee Leahy32471722015-04-20 15:20:28 -0700181 Return (CTOK (DPTF_TSR2_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700182 }
183
184 Method (_CRT)
185 {
Lee Leahy32471722015-04-20 15:20:28 -0700186 Return (CTOK (DPTF_TSR2_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700187 }
188
189 Name (PATC, 2)
190
191 /* Set Aux Trip Point */
192 Method (PAT0, 1, Serialized)
193 {
194 \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0)
195 }
196
197 /* Set Aux Trip Point */
198 Method (PAT1, 1, Serialized)
199 {
200 \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0)
201 }
202
203 /* Disable Aux Trip Point */
204 Method (PATD, 0, Serialized)
205 {
206 \_SB.PCI0.LPCB.EC0.PATD (TMPI)
207 }
208}
209#endif