Debian Codegraph @

src/mainboard/samsung/stumpy/acpi/thermal.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 // Thermal Zone
4
5 External (\PPKG, MethodObj)
6
7 Scope (\_TZ)
8 {
9 ThermalZone (THRM)
10 {
11 Name (_TC1, 0x02)
12 Name (_TC2, 0x05)
13
14 // Thermal zone polling frequency: 10 seconds
15 Name (_TZP, 100)
16
17 // Thermal sampling period for passive cooling: 2 seconds
18 Name (_TSP, 20)
19
20 // Convert from Degrees C to 1/10 Kelvin for ACPI
21 Method (CTOK, 1) {
22 // 10th of Degrees C
23 Local0 = Arg0 * 10
24
25 // Convert to Kelvin
26 Local0 += 2732
27
28 Return (Local0)
29 }
30
31 // Threshold for OS to shutdown
32 Method (_CRT, 0, Serialized)
33 {
34 Return (CTOK (\TCRT))
35 }
36
37 // Threshold for passive cooling
38 Method (_PSV, 0, Serialized)
39 {
40 Return (CTOK (\TPSV))
41 }
42
43 // Processors used for passive cooling
44 Method (_PSL, 0, Serialized)
45 {
46 Return (\PPKG ())
47 }
48
49 Method (_TMP, 0, Serialized)
50 {
51 // Get CPU Temperature from PECI via SuperIO TMPIN3
52 Local0 = \_SB.PCI0.LPCB.SIO.ENVC.TIN3
53
54 // Check for invalid readings
55 If ((Local0 == 255) || (Local0 == 0)) {
56 Return (CTOK (\F2ON))
57 }
58
59 // PECI raw value is an offset from Tj_max
60 Local1 = 255 - Local0
61
62 // Handle values greater than Tj_max
63 If (Local1 >= \TMAX) {
64 Return (CTOK (\TMAX))
65 }
66
67 // Subtract from Tj_max to get temperature
68 Local0 = \TMAX - Local1
69 Return (CTOK (Local0))
70 }
71
72 Method (_AC0) {
73 If (\FLVL <= 0) {
74 Return (CTOK (\F0OF))
75 } Else {
76 Return (CTOK (\F0ON))
77 }
78 }
79
80 Method (_AC1) {
81 If (\FLVL <= 1) {
82 Return (CTOK (\F1OF))
83 } Else {
84 Return (CTOK (\F1ON))
85 }
86 }
87
88 Method (_AC2) {
89 If (\FLVL <= 2) {
90 Return (CTOK (\F2OF))
91 } Else {
92 Return (CTOK (\F2ON))
93 }
94 }
95
96 Method (_AC3) {
97 If (\FLVL <= 3) {
98 Return (CTOK (\F3OF))
99 } Else {
100 Return (CTOK (\F3ON))
101 }
102 }
103
104 Method (_AC4) {
105 If (\FLVL <= 4) {
106 Return (CTOK (\F4OF))
107 } Else {
108 Return (CTOK (\F4ON))
109 }
110 }
111
112 Name (_AL0, Package () { FAN0 })
113 Name (_AL1, Package () { FAN1 })
114 Name (_AL2, Package () { FAN2 })
115 Name (_AL3, Package () { FAN3 })
116 Name (_AL4, Package () { FAN4 })
117
118 PowerResource (FNP0, 0, 0)
119 {
120 Method (_STA) {
121 If (\FLVL <= 0) {
122 Return (1)
123 } Else {
124 Return (0)
125 }
126 }
127 Method (_ON) {
128 \FLVL = 0
129 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F0PW
130 Notify (\_TZ.THRM, 0x81)
131 }
132 Method (_OFF) {
133 \FLVL = 1
134 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW
135 Notify (\_TZ.THRM, 0x81)
136 }
137 }
138
139 PowerResource (FNP1, 0, 0)
140 {
141 Method (_STA) {
142 If (\FLVL <= 1) {
143 Return (1)
144 } Else {
145 Return (0)
146 }
147 }
148 Method (_ON) {
149 \FLVL = 1
150 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW
151 Notify (\_TZ.THRM, 0x81)
152 }
153 Method (_OFF) {
154 \FLVL = 2
155 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW
156 Notify (\_TZ.THRM, 0x81)
157 }
158 }
159
160 PowerResource (FNP2, 0, 0)
161 {
162 Method (_STA) {
163 If (\FLVL <= 2) {
164 Return (1)
165 } Else {
166 Return (0)
167 }
168 }
169 Method (_ON) {
170 \FLVL = 2
171 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW
172 Notify (\_TZ.THRM, 0x81)
173 }
174 Method (_OFF) {
175 \FLVL = 3
176 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW
177 Notify (\_TZ.THRM, 0x81)
178 }
179 }
180
181 PowerResource (FNP3, 0, 0)
182 {
183 Method (_STA) {
184 If (\FLVL <= 3) {
185 Return (1)
186 } Else {
187 Return (0)
188 }
189 }
190 Method (_ON) {
191 \FLVL = 3
192 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW
193 Notify (\_TZ.THRM, 0x81)
194 }
195 Method (_OFF) {
196 \FLVL = 4
197 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
198 Notify (\_TZ.THRM, 0x81)
199 }
200 }
201
202 PowerResource (FNP4, 0, 0)
203 {
204 Method (_STA) {
205 If (\FLVL <= 4) {
206 Return (1)
207 } Else {
208 Return (0)
209 }
210 }
211 Method (_ON) {
212 \FLVL = 4
213 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
214 Notify (\_TZ.THRM, 0x81)
215 }
216 Method (_OFF) {
217 \FLVL = 4
218 \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
219 Notify (\_TZ.THRM, 0x81)
220 }
221 }
222
223 Device (FAN0)
224 {
225 Name (_HID, EISAID ("PNP0C0B"))
226 Name (_UID, 0)
227 Name (_PR0, Package () { FNP0 })
228 }
229
230 Device (FAN1)
231 {
232 Name (_HID, EISAID ("PNP0C0B"))
233 Name (_UID, 1)
234 Name (_PR0, Package () { FNP1 })
235 }
236
237 Device (FAN2)
238 {
239 Name (_HID, EISAID ("PNP0C0B"))
240 Name (_UID, 2)
241 Name (_PR0, Package () { FNP2 })
242 }
243
244 Device (FAN3)
245 {
246 Name (_HID, EISAID ("PNP0C0B"))
247 Name (_UID, 3)
248 Name (_PR0, Package () { FNP3 })
249 }
250
251 Device (FAN4)
252 {
253 Name (_HID, EISAID ("PNP0C0B"))
254 Name (_UID, 4)
255 Name (_PR0, Package () { FNP4 })
256 }
257 }
258 }