Skip to content

Instantly share code, notes, and snippets.

@peterychuang
Created August 6, 2017 12:24
Show Gist options
  • Save peterychuang/c91e8e8797aaca5d0df47c7911daddb5 to your computer and use it in GitHub Desktop.
Save peterychuang/c91e8e8797aaca5d0df47c7911daddb5 to your computer and use it in GitHub Desktop.
dsdt_blth.txt
Scope (URT0)
{
Device (BLTH)
{
Name (_HID, EisaId ("BCM2E7C")) // _HID: Hardware ID
Name (_CID, "apple-uart-blth") // _CID: Compatible ID
Name (_UID, One) // _UID: Unique ID
Name (_ADR, Zero) // _ADR: Address
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
If (OSDW ())
{
Return (Package (0x02)
{
0x6F,
0x04
})
}
Else
{
Return (Package (0x02)
{
0x6F,
0x03
})
}
}
Method (_CRS, 0, Serialized) // _CRS: Current Resource Settings
{
Name (UBUF, ResourceTemplate ()
{
UartSerialBusV2 (0x0001C200, DataBitsEight, StopBitsOne,
0xC0, LittleEndian, ParityTypeNone, FlowControlHardware,
0x0020, 0x0020, "\\_SB.PCI0.URT0",
0x00, ResourceProducer, , Exclusive,
)
})
Name (ABUF, ResourceTemplate ()
{
})
If (!OSDW ())
{
Return (UBUF) /* \_SB_.PCI0.URT0.BLTH._CRS.UBUF */
}
Return (ABUF) /* \_SB_.PCI0.URT0.BLTH._CRS.ABUF */
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((Arg0 == ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
{
Local0 = Package (0x08)
{
"baud",
Buffer (0x08)
{
0xC0, 0xC6, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00 /* ..-..... */
},
"parity",
Buffer (0x08)
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */
},
"dataBits",
Buffer (0x08)
{
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */
},
"stopBits",
Buffer (0x08)
{
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */
}
}
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Return (Zero)
}
Method (BTPU, 0, Serialized)
{
^^^LPCB.EC.BTPC = One
Sleep (0x0A)
}
Method (BTPD, 0, Serialized)
{
^^^LPCB.EC.BTPC = Zero
Sleep (0x0A)
}
Method (BTRS, 0, Serialized)
{
BTPD ()
BTPU ()
}
Method (BTLP, 1, Serialized)
{
If ((Arg0 == Zero))
{
SGDI (0x02010002)
}
If ((Arg0 == One))
{
SGOV (0x02010002, Zero)
SGDO (0x02010002)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment