1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <commonlib/include/commonlib/console/post_codes.h>
5 External(\_SB.MPTS, MethodObj)
6 External(\_SB.MWAK, MethodObj)
7 External(\_SB.PCI0.EGPM, MethodObj)
8 External(\_SB.PCI0.RGPM, MethodObj)
9 External(\_SB.PCI0.LPCB.EC0.PTS, MethodObj)
10 External(\_SB.PCI0.LPCB.EC0.WAK, MethodObj)
12 #include <arch/x86/acpi/post.asl>
15 * The _PTS method (Prepare To Sleep) is called before the OS is
16 * entering a sleep state. The sleep state number is passed in Arg0
21 DBG0 = POSTCODE_OS_ENTER_PTS
23 If (CondRefOf (\_SB.PCI0.LPCB.EC0.PTS))
25 \_SB.PCI0.LPCB.EC0.PTS (Arg0)
27 If (CondRefOf (\_SB.MPTS))
32 * Save the current PM bits then
33 * enable GPIO PM with MISCCFG_GPIO_PM_CONFIG_BITS
35 If (CondRefOf (\_SB.PCI0.EGPM))
41 /* The _WAK method is called on system wakeup */
45 DBG0 = POSTCODE_OS_ENTER_WAKE
47 If (CondRefOf (\_SB.PCI0.LPCB.EC0.WAK))
49 \_SB.PCI0.LPCB.EC0.WAK (Arg0)
51 If (CondRefOf (\_SB.MWAK))
55 /* Restore GPIO all Community PM */
56 If (CondRefOf (\_SB.PCI0.RGPM))
61 Return (Package(){0,0})