• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3// Thermal Zone
4
5External (\PPKG, MethodObj)
6
7Scope (\_TZ)
8{
9	ThermalZone (THRM)
10	{
11		Name (_TC1, 0x02)
12		Name (_TC2, 0x05)
13
14		// Thermal zone polling frequency: 0 seconds
15		Name (_TZP, 0)
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			Return (CTOK (50))
52		}
53
54		Method (_AC0) {
55			If (\FLVL <= 0) {
56				Return (CTOK (\F0OF))
57			} Else {
58				Return (CTOK (\F0ON))
59			}
60		}
61
62		Method (_AC1) {
63			If (\FLVL <= 1) {
64				Return (CTOK (\F1OF))
65			} Else {
66				Return (CTOK (\F1ON))
67			}
68		}
69
70		Method (_AC2) {
71			If (\FLVL <= 2) {
72				Return (CTOK (\F2OF))
73			} Else {
74				Return (CTOK (\F2ON))
75			}
76		}
77
78		Method (_AC3) {
79			If (\FLVL <= 3) {
80				Return (CTOK (\F3OF))
81			} Else {
82				Return (CTOK (\F3ON))
83			}
84		}
85
86		Method (_AC4) {
87			If (\FLVL <= 4) {
88				Return (CTOK (\F4OF))
89			} Else {
90				Return (CTOK (\F4ON))
91			}
92		}
93
94		Name (_AL0, Package () { FAN0 })
95		Name (_AL1, Package () { FAN1 })
96		Name (_AL2, Package () { FAN2 })
97		Name (_AL3, Package () { FAN3 })
98		Name (_AL4, Package () { FAN4 })
99
100		PowerResource (FNP0, 0, 0)
101		{
102			Method (_STA) {
103				If (\FLVL <= 0) {
104					Return (1)
105				} Else {
106					Return (0)
107				}
108			}
109			Method (_ON)  {
110				\FLVL = 0
111				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F0PW
112				Notify (\_TZ.THRM, 0x81)
113			}
114			Method (_OFF) {
115				\FLVL = 1
116				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW
117				Notify (\_TZ.THRM, 0x81)
118			}
119		}
120
121		PowerResource (FNP1, 0, 0)
122		{
123			Method (_STA) {
124				If (\FLVL <= 1) {
125					Return (1)
126				} Else {
127					Return (0)
128				}
129			}
130			Method (_ON)  {
131				\FLVL = 1
132				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW
133				Notify (\_TZ.THRM, 0x81)
134			}
135			Method (_OFF) {
136				\FLVL = 2
137				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW
138				Notify (\_TZ.THRM, 0x81)
139			}
140		}
141
142		PowerResource (FNP2, 0, 0)
143		{
144			Method (_STA) {
145				If (\FLVL <= 2) {
146					Return (1)
147				} Else {
148					Return (0)
149				}
150			}
151			Method (_ON)  {
152				\FLVL = 2
153				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW
154				Notify (\_TZ.THRM, 0x81)
155			}
156			Method (_OFF) {
157				\FLVL = 3
158				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW
159				Notify (\_TZ.THRM, 0x81)
160			}
161		}
162
163		PowerResource (FNP3, 0, 0)
164		{
165			Method (_STA) {
166				If (\FLVL <= 3) {
167					Return (1)
168				} Else {
169					Return (0)
170				}
171			}
172			Method (_ON)  {
173				\FLVL = 3
174				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW
175				Notify (\_TZ.THRM, 0x81)
176			}
177			Method (_OFF) {
178				\FLVL = 4
179				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
180				Notify (\_TZ.THRM, 0x81)
181			}
182		}
183
184		PowerResource (FNP4, 0, 0)
185		{
186			Method (_STA) {
187				If (\FLVL <= 4) {
188					Return (1)
189				} Else {
190					Return (0)
191				}
192			}
193			Method (_ON)  {
194				\FLVL = 4
195				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
196				Notify (\_TZ.THRM, 0x81)
197			}
198			Method (_OFF) {
199				\FLVL = 4
200				\_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW
201				Notify (\_TZ.THRM, 0x81)
202			}
203		}
204
205		Device (FAN0)
206		{
207			Name (_HID, EISAID ("PNP0C0B"))
208			Name (_UID, 0)
209			Name (_PR0, Package () { FNP0 })
210		}
211
212		Device (FAN1)
213		{
214			Name (_HID, EISAID ("PNP0C0B"))
215			Name (_UID, 1)
216			Name (_PR0, Package () { FNP1 })
217		}
218
219		Device (FAN2)
220		{
221			Name (_HID, EISAID ("PNP0C0B"))
222			Name (_UID, 2)
223			Name (_PR0, Package () { FNP2 })
224		}
225
226		Device (FAN3)
227		{
228			Name (_HID, EISAID ("PNP0C0B"))
229			Name (_UID, 3)
230			Name (_PR0, Package () { FNP3 })
231		}
232
233		Device (FAN4)
234		{
235			Name (_HID, EISAID ("PNP0C0B"))
236			Name (_UID, 4)
237			Name (_PR0, Package () { FNP4 })
238		}
239	}
240}
241