Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 2 | |
| 3 | Device (LPEA) |
| 4 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 5 | Name (_HID, "808622A8") |
| 6 | Name (_CID, "808622A8") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 7 | Name (_UID, 1) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 8 | Name (_DDN, "Intel(R) Low Power Audio Controller - 808622A8") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 9 | Name (_PR0, Package () { PLPE }) |
| 10 | |
| 11 | Name (RBUF, ResourceTemplate() |
| 12 | { |
| 13 | Memory32Fixed (ReadWrite, 0, 0x00200000, BAR0) |
| 14 | Memory32Fixed (ReadWrite, 0, 0x00001000, BAR1) |
Matt DeVillier | 83ef07a | 2018-01-21 16:37:24 -0600 | [diff] [blame] | 15 | Memory32Fixed (ReadWrite, 0, 0x00200000, BAR2) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 16 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 17 | { |
| 18 | LPE_DMA0_IRQ |
| 19 | } |
| 20 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 21 | { |
| 22 | LPE_DMA1_IRQ |
| 23 | } |
| 24 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 25 | { |
| 26 | LPE_SSP0_IRQ |
| 27 | } |
| 28 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 29 | { |
| 30 | LPE_SSP1_IRQ |
| 31 | } |
| 32 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 33 | { |
| 34 | LPE_SSP2_IRQ |
| 35 | } |
| 36 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 37 | { |
| 38 | LPE_IPC2HOST_IRQ |
| 39 | } |
| 40 | }) |
| 41 | |
| 42 | Method (_CRS) |
| 43 | { |
| 44 | /* Update BAR0 from NVS */ |
| 45 | CreateDwordField (^RBUF, ^BAR0._BAS, BAS0) |
| 46 | Store (\LPB0, BAS0) |
| 47 | |
| 48 | /* Update BAR1 from NVS */ |
| 49 | CreateDwordField (^RBUF, ^BAR1._BAS, BAS1) |
| 50 | Store (\LPB1, BAS1) |
| 51 | |
| 52 | /* Update LPE FW from NVS */ |
| 53 | CreateDwordField (^RBUF, ^BAR2._BAS, BAS2) |
| 54 | Store (\LPFW, BAS2) |
| 55 | |
| 56 | /* Append any Mainboard defined GPIOs */ |
Martin Roth | 10f7f50 | 2015-12-08 15:26:03 -0700 | [diff] [blame] | 57 | If (CondRefOf (^GBUF)) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 58 | ConcatenateResTemplate (^RBUF, ^GBUF, Local1) |
| 59 | Return (Local1) |
| 60 | } |
| 61 | |
| 62 | Return (^RBUF) |
| 63 | } |
| 64 | |
| 65 | Method (_STA) |
| 66 | { |
| 67 | If (LEqual (\LPEN, 1)) { |
| 68 | Return (0xF) |
| 69 | } Else { |
| 70 | Return (0x0) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | OperationRegion (KEYS, SystemMemory, LPB1, 0x100) |
| 75 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 76 | { |
| 77 | Offset (0x84), |
| 78 | PSAT, 32, |
| 79 | } |
| 80 | |
| 81 | PowerResource (PLPE, 0, 0) |
| 82 | { |
| 83 | Method (_STA) |
| 84 | { |
| 85 | Return (1) |
| 86 | } |
| 87 | |
| 88 | Method (_OFF) |
| 89 | { |
| 90 | Or (PSAT, 0x00000003, PSAT) |
| 91 | Or (PSAT, 0x00000000, PSAT) |
| 92 | } |
| 93 | |
| 94 | Method (_ON) |
| 95 | { |
| 96 | And (PSAT, 0xfffffffc, PSAT) |
| 97 | Or (PSAT, 0x00000000, PSAT) |
| 98 | } |
| 99 | } |
| 100 | } |