Angel Pons | 5c59680 | 2020-04-03 01:21:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 2 | |
| 3 | /* Wake status package */ |
| 4 | Name(WKST,Package(){Zero, Zero}) |
| 5 | |
| 6 | /* |
| 7 | * \_PTS - Prepare to Sleep method |
| 8 | * |
| 9 | * Entry: |
| 10 | * Arg0=The value of the sleeping state S1=1, S2=2, etc |
| 11 | * |
| 12 | * Exit: |
| 13 | * -none- |
| 14 | * |
| 15 | * The _PTS control method is executed at the beginning of the sleep process |
Marshall Dawson | a8025db | 2016-12-16 13:17:34 -0500 | [diff] [blame] | 16 | * for S1-S5. The sleeping value is passed to the _PTS control method. This |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 17 | * control method may be executed a relatively long time before entering the |
Marshall Dawson | a8025db | 2016-12-16 13:17:34 -0500 | [diff] [blame] | 18 | * sleep state and the OS may abort the operation without notification to |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 19 | * the ACPI driver. This method cannot modify the configuration or power |
| 20 | * state of any device in the system. |
| 21 | */ |
Zheng Bao | ddf58ef | 2013-11-21 16:11:40 +0800 | [diff] [blame] | 22 | |
| 23 | External(\_SB.APTS, MethodObj) |
| 24 | External(\_SB.AWAK, MethodObj) |
| 25 | |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 26 | Method(_PTS, 1) { |
| 27 | /* DBGO("\\_PTS\n") */ |
| 28 | /* DBGO("From S0 to S") */ |
| 29 | /* DBGO(Arg0) */ |
| 30 | /* DBGO("\n") */ |
| 31 | |
| 32 | /* Clear wake status structure. */ |
Elyes HAOUAS | db53013 | 2020-10-08 09:05:06 +0200 | [diff] [blame] | 33 | WKST [0] = 0 |
| 34 | WKST [1] = 0 |
| 35 | UPWS = 7 |
Zheng Bao | ddf58ef | 2013-11-21 16:11:40 +0800 | [diff] [blame] | 36 | \_SB.APTS(Arg0) |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 37 | } /* End Method(\_PTS) */ |
| 38 | |
| 39 | /* |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 40 | * \_WAK System Wake method |
| 41 | * |
| 42 | * Entry: |
| 43 | * Arg0=The value of the sleeping state S1=1, S2=2 |
| 44 | * |
| 45 | * Exit: |
| 46 | * Return package of 2 DWords |
| 47 | * Dword 1 - Status |
| 48 | * 0x00000000 wake succeeded |
| 49 | * 0x00000001 Wake was signaled but failed due to lack of power |
| 50 | * 0x00000002 Wake was signaled but failed due to thermal condition |
| 51 | * Dword 2 - Power Supply state |
| 52 | * if non-zero the effective S-state the power supply entered |
| 53 | */ |
| 54 | Method(\_WAK, 1) { |
| 55 | /* DBGO("\\_WAK\n") */ |
| 56 | /* DBGO("From S") */ |
| 57 | /* DBGO(Arg0) */ |
| 58 | /* DBGO(" to S0\n") */ |
Elyes HAOUAS | db53013 | 2020-10-08 09:05:06 +0200 | [diff] [blame] | 59 | USBS = 1 |
Zheng Bao | 1defc86 | 2013-11-21 16:12:27 +0800 | [diff] [blame] | 60 | |
Zheng Bao | ddf58ef | 2013-11-21 16:11:40 +0800 | [diff] [blame] | 61 | \_SB.AWAK(Arg0) |
Mike Loptien | ac90d80 | 2013-07-17 15:14:59 -0600 | [diff] [blame] | 62 | |
| 63 | Return(WKST) |
| 64 | } /* End Method(\_WAK) */ |