1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* The _PTS method (Prepare To Sleep) is called before the OS is
4 * entering a sleep state. The sleep state number is passed in Arg0
14 // Are we going to S4?
20 // Are we going to S5?
25 // The 2.6.12.5 ACPI engine seems to optimize the
26 // If(Arg0 == 5) path away. This keeps it from doing so:
29 // End of ugly OS bug workaround
32 /* The _WAK method is called on system wakeup */
39 // Wake from S3 or S4?
40 If ((Arg0 == 0x03) || (Arg0 == 0x04)) {
41 If (CFGD & 0x01000000) {
42 If ((CFGD & 0xF0) && (OSYS == 2001)) {
48 // Notify PCI Express slots in case a card
49 // was inserted while a sleep state was active.
52 Notify(\_SB.PCI0.RP01, 0)
56 Notify(\_SB.PCI0.RP03, 0)
60 Notify(\_SB.PCI0.RP04, 0)
63 // Are we coming from S3?
69 // Are we coming from S4?
77 // Windows XP SP2 P-State restore
78 If ((OSYS == 2002) && (CFGD & 0x01)) {
79 If (\_SB.CP00._PPC > 0) {
92 Return(Package(){0,0})
95 // Hardcoded for now..
96 Name (CFGD, 0x113B69F1)
102 /* This method is placed on the top level, so we can make sure it's the
103 * first executed _INI method.
107 /* The DTS data in NVS is probably not up to date.
108 * Update temperature values and make sure AP thermal
109 * interrupts can happen
117 /* And the OS workarounds start right after we know what we're
118 * running: Windows XP SP1 needs to have C-State coordination
121 If ((OSYS == 2001) && MPEN) {