| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
// Thermal Zone |
| 4 |
|
| 5 |
External (\PPKG, MethodObj) |
| 6 |
|
| 7 |
#define HAVE_THERMALZONE |
| 8 |
Scope (\_TZ) |
| 9 |
{ |
| 10 |
ThermalZone (THRM) |
| 11 |
{ |
| 12 |
Name (_TC1, 0x02) |
| 13 |
Name (_TC2, 0x03) |
| 14 |
|
| 15 |
// Thermal zone polling frequency: 10 seconds |
| 16 |
Name (_TZP, 100) |
| 17 |
|
| 18 |
// Thermal sampling period for passive cooling: 10 seconds |
| 19 |
Name (_TSP, 100) |
| 20 |
|
| 21 |
// Convert from Degrees C to 1/10 Kelvin for ACPI |
| 22 |
Method (CTOK, 1) |
| 23 |
{ |
| 24 |
// 10th of Degrees C |
| 25 |
Local0 = Arg0 * 10 |
| 26 |
|
| 27 |
// Convert to Kelvin |
| 28 |
Local0 += 2732 |
| 29 |
|
| 30 |
Return (Local0) |
| 31 |
} |
| 32 |
|
| 33 |
// Threshold for OS to shutdown |
| 34 |
Method (_CRT, 0, Serialized) |
| 35 |
{ |
| 36 |
Return (CTOK (\TCRT)) |
| 37 |
} |
| 38 |
|
| 39 |
// Threshold for passive cooling |
| 40 |
Method (_PSV, 0, Serialized) |
| 41 |
{ |
| 42 |
Return (CTOK (\TPSV)) |
| 43 |
} |
| 44 |
|
| 45 |
// Processors used for passive cooling |
| 46 |
Method (_PSL, 0, Serialized) |
| 47 |
{ |
| 48 |
Return (\PPKG ()) |
| 49 |
} |
| 50 |
|
| 51 |
Method (_TMP, 0, Serialized) |
| 52 |
{ |
| 53 |
// Returns Higher of the two readings for CPU & VGA Temperature |
| 54 |
If (\_SB.PCI0.LPCB.EC0.TMP2 > \_SB.PCI0.LPCB.EC0.TMP1) |
| 55 |
{ |
| 56 |
// CPU high temperature |
| 57 |
Local0 = \_SB.PCI0.LPCB.EC0.TMP2 |
| 58 |
} |
| 59 |
Else |
| 60 |
{ |
| 61 |
// VGA high temperature |
| 62 |
Local0 = \_SB.PCI0.LPCB.EC0.TMP1 |
| 63 |
} |
| 64 |
|
| 65 |
// If temp less 35 or great then 115, set default 35 |
| 66 |
If ((Local0 < 35) | (Local0 > 115)) |
| 67 |
{ |
| 68 |
Local0 = 35 |
| 69 |
} |
| 70 |
|
| 71 |
Return (CTOK (Local0)) |
| 72 |
} |
| 73 |
} |
| 74 |
} |