Angel Pons | 60ec365 | 2020-04-03 01:22:13 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 2 | |
Arthur Heymans | f7d1c8d | 2018-11-28 12:22:59 +0100 | [diff] [blame] | 3 | /* Generated by acpigen */ |
| 4 | External (\PPKG, MethodObj) |
| 5 | |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 6 | // Thermal Zone |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 7 | #include "../thermal.h" |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 8 | |
| 9 | Scope (\_TZ) |
| 10 | { |
| 11 | ThermalZone (THRM) |
| 12 | { |
| 13 | Name (_TC1, 0x02) |
| 14 | Name (_TC2, 0x05) |
| 15 | |
| 16 | // Thermal zone polling frequency: 0 seconds |
| 17 | Name (_TZP, 0) |
| 18 | |
| 19 | // Thermal sampling period for passive cooling: 2 seconds |
| 20 | Name (_TSP, 20) |
| 21 | |
| 22 | // Convert from Degrees C to 1/10 Kelvin for ACPI |
| 23 | Method (CTOK, 1) { |
| 24 | // 10th of Degrees C |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 25 | Local0 = Arg0 * 10 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 26 | |
| 27 | // Convert to Kelvin |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 28 | Local0 += 2732 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 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 | Return (CTOK (30)) |
| 54 | } |
| 55 | |
| 56 | Method (_AC0) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 57 | If (\FLVL <= 0) { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 58 | Return (CTOK (FAN0_THRESHOLD_OFF)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 59 | } Else { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 60 | Return (CTOK (FAN0_THRESHOLD_ON)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | |
| 64 | Method (_AC1) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 65 | If (\FLVL <= 1) { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 66 | Return (CTOK (FAN1_THRESHOLD_OFF)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 67 | } Else { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 68 | Return (CTOK (FAN1_THRESHOLD_ON)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 69 | } |
| 70 | } |
| 71 | |
| 72 | Method (_AC2) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 73 | If (\FLVL <= 2) { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 74 | Return (CTOK (FAN2_THRESHOLD_OFF)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 75 | } Else { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 76 | Return (CTOK (FAN2_THRESHOLD_ON)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 77 | } |
| 78 | } |
| 79 | |
| 80 | Method (_AC3) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 81 | If (\FLVL <= 3) { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 82 | Return (CTOK (FAN3_THRESHOLD_OFF)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 83 | } Else { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 84 | Return (CTOK (FAN3_THRESHOLD_ON)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 85 | } |
| 86 | } |
| 87 | |
| 88 | Method (_AC4) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 89 | If (\FLVL <= 4) { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 90 | Return (CTOK (FAN4_THRESHOLD_OFF)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 91 | } Else { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame] | 92 | Return (CTOK (FAN4_THRESHOLD_ON)) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 93 | } |
| 94 | } |
| 95 | |
| 96 | Name (_AL0, Package () { FAN0 }) |
| 97 | Name (_AL1, Package () { FAN1 }) |
| 98 | Name (_AL2, Package () { FAN2 }) |
| 99 | Name (_AL3, Package () { FAN3 }) |
| 100 | Name (_AL4, Package () { FAN4 }) |
| 101 | |
| 102 | PowerResource (FNP0, 0, 0) |
| 103 | { |
| 104 | Method (_STA) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 105 | If (\FLVL <= 0) { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 106 | Return (1) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 107 | } Else { |
| 108 | Return (Zero) |
| 109 | } |
| 110 | } |
| 111 | Method (_ON) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 112 | \FLVL = 0 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 113 | Notify (\_TZ.THRM, 0x81) |
| 114 | } |
| 115 | Method (_OFF) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 116 | \FLVL = 1 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 117 | Notify (\_TZ.THRM, 0x81) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | PowerResource (FNP1, 0, 0) |
| 122 | { |
| 123 | Method (_STA) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 124 | If (\FLVL <= 1) { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 125 | Return (1) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 126 | } Else { |
| 127 | Return (Zero) |
| 128 | } |
| 129 | } |
| 130 | Method (_ON) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 131 | \FLVL = 1 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 132 | Notify (\_TZ.THRM, 0x81) |
| 133 | } |
| 134 | Method (_OFF) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 135 | \FLVL = 2 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 136 | Notify (\_TZ.THRM, 0x81) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | PowerResource (FNP2, 0, 0) |
| 141 | { |
| 142 | Method (_STA) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 143 | If (\FLVL <= 2) { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 144 | Return (1) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 145 | } Else { |
| 146 | Return (Zero) |
| 147 | } |
| 148 | } |
| 149 | Method (_ON) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 150 | \FLVL = 2 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 151 | Notify (\_TZ.THRM, 0x81) |
| 152 | } |
| 153 | Method (_OFF) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 154 | \FLVL = 3 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 155 | Notify (\_TZ.THRM, 0x81) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | PowerResource (FNP3, 0, 0) |
| 160 | { |
| 161 | Method (_STA) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 162 | If (\FLVL <= 3) { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 163 | Return (1) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 164 | } Else { |
| 165 | Return (Zero) |
| 166 | } |
| 167 | } |
| 168 | Method (_ON) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 169 | \FLVL = 3 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 170 | Notify (\_TZ.THRM, 0x81) |
| 171 | } |
| 172 | Method (_OFF) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 173 | \FLVL = 4 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 174 | Notify (\_TZ.THRM, 0x81) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | PowerResource (FNP4, 0, 0) |
| 179 | { |
| 180 | Method (_STA) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 181 | If (\FLVL <= 4) { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 182 | Return (1) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 183 | } Else { |
| 184 | Return (Zero) |
| 185 | } |
| 186 | } |
| 187 | Method (_ON) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 188 | \FLVL = 4 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 189 | Notify (\_TZ.THRM, 0x81) |
| 190 | } |
| 191 | Method (_OFF) { |
Elyes HAOUAS | b4b4fa5 | 2020-10-08 09:39:22 +0200 | [diff] [blame] | 192 | \FLVL = 4 |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 193 | Notify (\_TZ.THRM, 0x81) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | Device (FAN0) |
| 198 | { |
| 199 | Name (_HID, EISAID ("PNP0C0B")) |
| 200 | Name (_UID, 0) |
| 201 | Name (_PR0, Package () { FNP0 }) |
| 202 | } |
| 203 | |
| 204 | Device (FAN1) |
| 205 | { |
| 206 | Name (_HID, EISAID ("PNP0C0B")) |
| 207 | Name (_UID, 1) |
| 208 | Name (_PR0, Package () { FNP1 }) |
| 209 | } |
| 210 | |
| 211 | Device (FAN2) |
| 212 | { |
| 213 | Name (_HID, EISAID ("PNP0C0B")) |
| 214 | Name (_UID, 2) |
| 215 | Name (_PR0, Package () { FNP2 }) |
| 216 | } |
| 217 | |
| 218 | Device (FAN3) |
| 219 | { |
| 220 | Name (_HID, EISAID ("PNP0C0B")) |
| 221 | Name (_UID, 3) |
| 222 | Name (_PR0, Package () { FNP3 }) |
| 223 | } |
| 224 | |
| 225 | Device (FAN4) |
| 226 | { |
| 227 | Name (_HID, EISAID ("PNP0C0B")) |
| 228 | Name (_UID, 4) |
| 229 | Name (_PR0, Package () { FNP4 }) |
| 230 | } |
| 231 | } |
| 232 | } |