| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
// TODO: Does board actually support DPTF? |
| 4 |
#include "thermal.asl" |
| 5 |
|
| 6 |
Scope (_SB) |
| 7 |
{ |
| 8 |
Method (MPTS, 1, NotSerialized) // _PTS: Prepare To Sleep |
| 9 |
{ |
| 10 |
^PCI0.LPCB.EC0.ECPS (Arg0) |
| 11 |
/* TBT and DTS not supported, TPM.PTS can be called elsewhere */ |
| 12 |
} |
| 13 |
|
| 14 |
Method (MWAK, 1, Serialized) // _WAK: Wake |
| 15 |
{ |
| 16 |
^PCI0.LPCB.EC0.ECWK (Arg0) |
| 17 |
/* No GPIO expander, 8254 clock-gating and PCIe PME can be performed elsewhere */ |
| 18 |
|
| 19 |
If ((Arg0 == 3) || (Arg0 == 4)) |
| 20 |
{ |
| 21 |
/* DTS and TBT not supported, iGFX RC variable update stripped */ |
| 22 |
LIDS = ^LID0._LID () |
| 23 |
Notify (LID0, 0x80) // Status Change |
| 24 |
/* TODO: Bus checks? Based on KabylakeOpenBoardPkg - Platform.asl |
| 25 |
perhaps not (Warm insertion/removal not possible on mobile */ |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
Method (MS0X, 1, Serialized) // S0ix hook. Porting "GUAM" method - "Global User Absent Mode" |
| 30 |
{ |
| 31 |
If (Arg0 == 0) |
| 32 |
{ |
| 33 |
/* Exit "Connected Standby" */ |
| 34 |
#if 1 // EC Notification |
| 35 |
^PCI0.LPCB.EC0.EOSS = 0 |
| 36 |
#endif |
| 37 |
/* TODO: P-state capping, PL setting? */ |
| 38 |
} |
| 39 |
ElseIf (Arg0 == 1) |
| 40 |
{ |
| 41 |
/* Enter "Connected Standby" */ |
| 42 |
#if 1 // EC Notification |
| 43 |
^PCI0.LPCB.EC0.ECSS = 0x08 |
| 44 |
#endif |
| 45 |
/* TODO: P-state capping, PL setting? */ |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
Device (LID0) |
| 50 |
{ |
| 51 |
Name (_HID, EisaId ("PNP0C0D") /* Lid Device */) |
| 52 |
Method (_LID, 0, NotSerialized) // _LID: Lid Status |
| 53 |
{ |
| 54 |
#if CONFIG(EC_USE_LGMR) |
| 55 |
Return (^^PCI0.LPCB.EC0.MLID) |
| 56 |
#else |
| 57 |
Return (^^PCI0.LPCB.EC0.ELID) |
| 58 |
#endif |
| 59 |
} |
| 60 |
|
| 61 |
Method (_PSW, 1, NotSerialized) // _PSW: Power State Wake |
| 62 |
{ |
| 63 |
^^PCI0.LPCB.EC0.EIDW = Arg0 |
| 64 |
} |
| 65 |
|
| 66 |
Name (_PRW, Package () { 0x0A, 3 }) // _PRW: Power Resources for Wake |
| 67 |
} |
| 68 |
|
| 69 |
Device (SLPB) |
| 70 |
{ |
| 71 |
Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) |
| 72 |
Name (_PRW, Package () { 0x0A, 3 }) // _PRW: Power Resources for Wake |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
Scope (_GPE) |
| 77 |
{ |
| 78 |
/* TODO - Remaining Level-Triggered GPEs: PCH GPE, PCIe PME, TBT, DTS, GFX SCI and tier-2 (RTD3) */ |
| 79 |
Method (_L0A, 0, NotSerialized) |
| 80 |
{ |
| 81 |
Notify (\_SB.SLPB, 0x02) // Device Wake |
| 82 |
} |
| 83 |
} |