Angel Pons | 08da24e | 2020-04-03 01:21:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 2 | |
| 3 | //BTDC Due to IMC Fan, ACPI control codes |
| 4 | OperationRegion(IMIO, SystemIO, 0x3E, 0x02) |
| 5 | Field(IMIO , ByteAcc, NoLock, Preserve) { |
| 6 | IMCX,8, |
| 7 | IMCA,8 |
| 8 | } |
| 9 | |
| 10 | IndexField(IMCX, IMCA, ByteAcc, NoLock, Preserve) { |
| 11 | Offset(0x80), |
| 12 | MSTI, 8, |
| 13 | MITS, 8, |
| 14 | MRG0, 8, |
| 15 | MRG1, 8, |
| 16 | MRG2, 8, |
| 17 | MRG3, 8, |
| 18 | } |
| 19 | |
| 20 | Method(WACK, 0) |
| 21 | { |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 22 | Local0 = 0 |
| 23 | While (Local0 != 0xfa) { |
| 24 | Local0 = MRG0 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 25 | Sleep(10) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | //Init |
| 30 | Method (ITZE, 0) |
| 31 | { |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 32 | MRG0 = 0 |
| 33 | MRG1 = 0xb5 |
| 34 | MRG2 = 0 |
| 35 | MSTI = 0x96 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 36 | WACK() |
| 37 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 38 | MRG0 = 0 |
| 39 | MRG1 = 0 |
| 40 | MRG2 = 0 |
| 41 | MSTI = 0x80 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 42 | WACK() |
| 43 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 44 | Local0 = MRG2 | 0x01 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 45 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 46 | MRG0 = 0 |
| 47 | MRG1 = 0 |
| 48 | MRG2 = Local0 |
| 49 | MSTI = 0x81 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 50 | WACK() |
| 51 | } |
| 52 | |
| 53 | //Sleep |
| 54 | Method (IMSP, 0) |
| 55 | { |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 56 | MRG0 = 0 |
| 57 | MRG1 = 0xb5 |
| 58 | MRG2 = 0 |
| 59 | MSTI = 0x96 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 60 | WACK() |
| 61 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 62 | MRG0 = 0 |
| 63 | MRG1 = 1 |
| 64 | MRG2 = 0 |
| 65 | MSTI = 0x98 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 66 | WACK() |
| 67 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 68 | MRG0 = 0 |
| 69 | MRG1 = 0xb4 |
| 70 | MRG2 = 0 |
| 71 | MSTI = 0x96 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 72 | WACK() |
| 73 | } |
| 74 | |
| 75 | //Wake |
| 76 | Method (IMWK, 0) |
| 77 | { |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 78 | MRG0 = 0 |
| 79 | MRG1 = 0xb5 |
| 80 | MRG2 = 0 |
| 81 | MSTI = 0x96 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 82 | WACK() |
| 83 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 84 | MRG0 = 0 |
| 85 | MRG1 = 0 |
| 86 | MRG2 = 0 |
| 87 | MSTI = 0x80 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 88 | WACK() |
| 89 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 90 | Local0 = MRG2 | 0x01 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 91 | |
Elyes HAOUAS | d4ed0e1 | 2020-10-08 09:16:29 +0200 | [diff] [blame] | 92 | MRG0 = 0 |
| 93 | MRG1 = 0 |
| 94 | MRG2 = Local0 |
| 95 | MSTI = 0x81 |
Damien Zammit | d2b5b73 | 2017-10-04 20:07:47 +1100 | [diff] [blame] | 96 | WACK() |
| 97 | } |