Angel Pons | 08da24e | 2020-04-03 01:21:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 2 | |
| 3 | OperationRegion (IOID, SystemIO, 0x2E, 0x02) |
| 4 | Field (IOID, ByteAcc, NoLock, Preserve) |
| 5 | { |
| 6 | SIOI, 8, SIOD, 8 /* 0x2E and 0x2F */ |
| 7 | } |
| 8 | |
| 9 | IndexField (SIOI, SIOD, ByteAcc, NoLock, Preserve) |
| 10 | { |
| 11 | Offset (0x07), |
| 12 | LDN, 8, /* Logical Device Number */ |
| 13 | Offset (0x20), |
| 14 | CID1, 8, /* Chip ID Byte 1, 0x87 */ |
| 15 | CID2, 8, /* Chip ID Byte 2, 0x12 */ |
| 16 | Offset (0x30), |
| 17 | ACTR, 8, /* Function activate */ |
| 18 | Offset (0xF0), |
| 19 | APC0, 8, /* APC/PME Event Enable Register */ |
| 20 | APC1, 8, /* APC/PME Status Register */ |
| 21 | APC2, 8, /* APC/PME Control Register 1 */ |
| 22 | APC3, 8, /* Environment Controller Special Configuration Register */ |
| 23 | APC4, 8 /* APC/PME Control Register 2 */ |
| 24 | } |
| 25 | |
| 26 | /* Enter the 8728 Config */ |
| 27 | Method (EPNP) |
| 28 | { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 29 | SIOI = 0x87 |
| 30 | SIOI = 0x01 |
| 31 | SIOI = 0x55 |
| 32 | SIOI = 0x55 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | /* Exit the 8728 Config */ |
| 36 | Method (XPNP) |
| 37 | { |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 38 | SIOI = 0x02 |
| 39 | SIOD = 0x02 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | /* |
| 43 | * Keyboard PME is routed to SB700 Gevent3. We can wake |
| 44 | * up the system by pressing the key. |
| 45 | */ |
| 46 | Method (SIOS, 1) |
| 47 | { |
| 48 | /* We only enable KBD PME for S5. */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 49 | If (Arg0 < 0x05) |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 50 | { |
| 51 | EPNP() |
| 52 | /* DBGO("8728F\n") */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 53 | LDN = 0x4 |
| 54 | ACTR = 1 /* Enable EC */ |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 55 | /* |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 56 | LDN = 0x4 |
| 57 | APC4 = 0x04 |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 58 | */ /* falling edge. which mode? Not sure. */ |
Elyes HAOUAS | 635ac11 | 2020-10-08 09:17:27 +0200 | [diff] [blame] | 59 | LDN = 0x4 |
| 60 | APC1 = 0x08 /* clear PME status, Use 0x18 for mouse & KBD */ |
| 61 | LDN = 0x4 |
| 62 | APC0 = 0x08 /* enable PME, Use 0x18 for mouse & KBD */ |
Sergej Ivanov | d777c78 | 2015-04-03 18:10:27 +0300 | [diff] [blame] | 63 | XPNP() |
| 64 | } |
| 65 | } |