• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3// Thermal Zone
4
5External (\PPKG, MethodObj)
6
7#define HAVE_THERMALZONE
8Scope (\_TZ)
9{
10	// Convert from Degrees C to 1/10 Kelvin for ACPI
11	Method (CTOK, 1) {
12		// 10th of Degrees C
13		Local0 = Arg0 * 10
14
15		// Convert to Kelvin
16		Local0 += 2732
17
18		Return (Local0)
19	}
20
21	ThermalZone (THRM)
22	{
23		Name (_TC1, 0x02)
24		Name (_TC2, 0x05)
25
26		// Thermal zone polling frequency: 10 seconds
27		Name (_TZP, 100)
28
29		// Thermal sampling period for passive cooling: 2 seconds
30		Name (_TSP, 20)
31
32		// Threshold for OS to shutdown
33		Method (_CRT, 0, Serialized)
34		{
35			Return (CTOK (\TCRT))
36		}
37
38		// Threshold for passive cooling
39		Method (_PSV, 0, Serialized)
40		{
41			Return (CTOK (\TPSV))
42		}
43
44		// Processors used for passive cooling
45		Method (_PSL, 0, Serialized)
46		{
47			Return (\PPKG ())
48		}
49
50		Method (_TMP, 0, NotSerialized)  // _TMP: Temperature
51		{
52			Local0 = \_SB.PCI0.LPCB.EC0.CPUT
53
54			If (Local0 >= 0x80)
55			{
56				Printf ("-----> CPU Temperature (INVALID): %o", Local0)
57				Return (CTOK (0))
58			}
59
60			Printf ("-----> CPU Temperature: %o", Local0)
61
62			Return (CTOK (Local0))
63		}
64	}
65
66	ThermalZone (TZ00)
67	{
68		// Thermal zone polling frequency: 10 seconds
69		Name (_TZP, 100)
70
71		// Thermal sampling period for passive cooling: 2 seconds
72		Name (_TSP, 20)
73
74		// Threshold for OS to shutdown
75		Method (_CRT, 0, Serialized)
76		{
77			Return (CTOK (106))
78		}
79
80		Method (_TMP, 0, NotSerialized)  // _TMP: Temperature
81		{
82			Local0 = \_SB.PCI0.LPCB.EC0.LOCT
83
84			If (Local0 >= 0x80)
85			{
86				Printf ("-----> LOC Temperature (INVALID): %o", Local0)
87				Return (CTOK (0))
88			}
89
90			Printf ("-----> LOC Temperature: %o", Local0)
91
92			Return (CTOK (Local0))
93		}
94	}
95
96	ThermalZone (TZ01)
97	{
98		// Thermal zone polling frequency: 10 seconds
99		Name (_TZP, 100)
100
101		// Thermal sampling period for passive cooling: 2 seconds
102		Name (_TSP, 20)
103
104		// Threshold for OS to shutdown
105		Method (_CRT, 0, Serialized)
106		{
107			Return (CTOK (106))
108		}
109
110		Method (_TMP, 0, NotSerialized)  // _TMP: Temperature
111		{
112			Local0 = \_SB.PCI0.LPCB.EC0.OEMT
113
114			If (Local0 >= 0x80)
115			{
116				Printf ("-----> OEM Temperature (INVALID): %o", Local0)
117				Return (CTOK (0))
118			}
119
120			Printf ("-----> OEM Temperature: %o", Local0)
121
122			Return (CTOK (Local0))
123		}
124	}
125}
126