Skip to content

Instantly share code, notes, and snippets.

@pfactum
Created November 21, 2017 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfactum/2c69d6e4eb4b5c256601847a9c6aec45 to your computer and use it in GitHub Desktop.
Save pfactum/2c69d6e4eb4b5c256601847a9c6aec45 to your computer and use it in GitHub Desktop.
Device (GPED)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "INT0002" /* Virtual GPIO Controller */) // _HID: Hardware ID
Name (_CID, "INT0002" /* Virtual GPIO Controller */) // _CID: Compatible ID
Name (_DDN, "Virtual GPIO controller") // _DDN: DOS Device Name
Name (_UID, One) // _UID: Unique ID
Name (INST, One)
Name (XTMP, Zero)
OperationRegion (SCIS, SystemMemory, 0xFED030C0, 0x04)
Field (SCIS, DWordAcc, NoLock, Preserve)
{
, 1,
LHAD, 1,
LATA, 1,
LDIO, 1,
LARD, 1,
LIO1, 1,
LCEP, 1,
LANB, 1,
LHCI, 1,
LOTG, 1,
LECI, 1,
LHSI, 1
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((Arg0 == ToUUID ("8b38b469-6f95-4b08-9b02-2defcc2d2c35")))
{
If ((Arg2 == Zero))
{
If ((Arg1 == One))
{
Return (Buffer (One)
{
0x03 // .
})
}
}
If ((Arg2 == One))
{
Return ((PMBS + 0x20))
}
Return (Zero)
}
Else
{
Return (Buffer (One)
{
0x00 // .
})
}
}
Method (_CRS, 0, Serialized) // _CRS: Current Resource Settings
{
Name (RBUF, ResourceTemplate ()
{
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
{
0x00000009,
}
})
Return (RBUF) /* \_SB_.GPED._CRS.RBUF */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
If ((OSYS >= 0x07DD))
{
If ((PB1E & One))
{
Return (Zero)
}
}
Return (Zero)
}
Method (_AEI, 0, Serialized) // _AEI: ACPI Event Interrupts
{
Name (RBUF, ResourceTemplate ()
{
GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullDown, 0x0000,
"\\_SB.GPED", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x0002
}
})
Return (RBUF) /* \_SB_.GPED._AEI.RBUF */
}
Method (_E02, 0, NotSerialized) // _Exx: Edge-Triggered GPE
{
If ((PWBS == One))
{
PWBS = One
Notify (PWRB, 0x80) // Status Change
}
If ((PMEB == One))
{
PMEB = One
}
If ((^^PCI0.SATA.PMES == One))
{
^^PCI0.SATA.PMES = One
Notify (^^PCI0.SATA, 0x02) // Device Wake
}
If ((^^PCI0.HDEF.PMES == One))
{
^^PCI0.HDEF.PMES = One
Notify (^^PCI0.HDEF, 0x02) // Device Wake
}
If ((^^PCI0.XHC1.PMES == One))
{
^^PCI0.XHC1.PMES = One
Notify (^^PCI0.XHC1, 0x02) // Device Wake
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment