mainboard.asl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /** @file
  2. Copyright (c) 2021, Benjamin Doran
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. // TODO: Add HID support for touchpad, etc.
  6. #include "thermal.asl"
  7. External (\_SB.SLPB, DeviceObj)
  8. // TODO: Need hooks from BoardAcpiDxe
  9. Scope (_SB)
  10. {
  11. Method (MPTS, 1, NotSerialized) // _PTS: Prepare To Sleep
  12. {
  13. ^PCI0.LPCB.EC0.ECPS (Arg0)
  14. }
  15. Method (MWAK, 1, Serialized) // _WAK: Wake
  16. {
  17. ^PCI0.LPCB.EC0.ECWK (Arg0)
  18. If ((Arg0 == 3) || (Arg0 == 4))
  19. {
  20. Notify (LID0, 0x80) // Status Change
  21. }
  22. }
  23. Method (MS0X, 1, NotSerialized) // S0ix hook. Porting "GUAM" method - "Global User Absent Mode"
  24. {
  25. If (Arg0 == 0)
  26. {
  27. /* Exit "Connected Standby" */
  28. #if 1 // EC Notification
  29. ^PCI0.LPCB.EC0.EOSS = 0
  30. #endif
  31. }
  32. ElseIf (Arg0 == 1)
  33. {
  34. /* Enter "Connected Standby" */
  35. #if 1 // EC Notification
  36. ^PCI0.LPCB.EC0.ECSS = 0x08
  37. #endif
  38. }
  39. }
  40. Device (LID0)
  41. {
  42. Name (_HID, EisaId ("PNP0C0D") /* Lid Device */) // _HID: Hardware ID
  43. Method (_LID, 0, NotSerialized) // _LID: Lid Status
  44. {
  45. #ifdef LGMR_ENABLED
  46. Return (^^PCI0.LPCB.EC0.MLID)
  47. #else
  48. Return (^^PCI0.LPCB.EC0.ELID)
  49. #endif
  50. }
  51. Method (_PSW, 1, NotSerialized) // _PSW: Power State Wake
  52. {
  53. ^^PCI0.LPCB.EC0.EIDW = Arg0
  54. }
  55. Name (_PRW, Package () { 0x0A, 3 }) // _PRW: Power Resources for Wake
  56. }
  57. // Add a GPE to device
  58. Scope (SLPB)
  59. {
  60. Name (_PRW, Package () { 0x0A, 3 }) // _PRW: Power Resources for Wake
  61. }
  62. }
  63. Scope (_GPE)
  64. {
  65. /* TODO - Remaining Level-Triggered GPEs: PCH GPE, PCIe PME, TBT, DTS, GFX SCI and tier-2 (RTD3) */
  66. Method (_L0A, 0, NotSerialized)
  67. {
  68. Notify (\_SB.SLPB, 0x02) // Device Wake
  69. }
  70. }