blob: 348ae5612cadc46b96ef70bfc5d789811e960b31 [file] [log] [blame]
Venkata Krishna Nimmagadda6f48df12020-04-07 15:49:55 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Venkata Krishna Nimmagadda6f48df12020-04-07 15:49:55 -07002
3#define LPID_DSM_ARG2_ENUM_FUNCTIONS 0
4#define LPID_DSM_ARG2_GET_DEVICE_CONSTRAINTS 1
5
6#define LPID_DSM_ARG2_GET_CRASH_DUMP_DEV 2
7#define LPID_DSM_ARG2_DISPLAY_OFF_NOTIFY 3
8#define LPID_DSM_ARG2_DISPLAY_ON_NOTIFY 4
9#define LPID_DSM_ARG2_S0IX_ENTRY 5
10#define LPID_DSM_ARG2_S0IX_EXIT 6
11
12External(\_SB.MS0X, MethodObj)
13External(\_SB.PCI0.LPCB.EC0.S0IX, MethodObj)
14External(\_SB.PCI0.EGPM, MethodObj)
15External(\_SB.PCI0.RGPM, MethodObj)
16
17Scope(\_SB)
18{
19 Device(LPID)
20 {
21 Name(_ADR, 0x00000000)
22 Name(_CID, EISAID("PNP0D80"))
23 Name(UUID, ToUUID("c4eb40a0-6cd2-11e2-bcfd-0800200c9a66"))
24 Method(_DSM, 4)
25 {
26 If(Arg0 == ^UUID) {
27 /*
28 * Enum functions
29 */
30 If(Arg2 == LPID_DSM_ARG2_ENUM_FUNCTIONS) {
31 Return(Buffer(One) {0x60})
32 }
33 /*
34 * Function 1 - Get Device Constraints
35 */
36 If(Arg2 == LPID_DSM_ARG2_GET_DEVICE_CONSTRAINTS) {
37 Return(Package(5) {0, Ones, Ones, Ones, Ones})
38 }
39 /*
40 * Function 2 - Get Crash Dump Device
41 */
42 If(Arg2 == LPID_DSM_ARG2_GET_CRASH_DUMP_DEV) {
43 Return(Buffer(One) {0x0})
44 }
45 /*
46 * Function 3 - Display Off Notification
47 */
48 If(Arg2 == LPID_DSM_ARG2_DISPLAY_OFF_NOTIFY) {
49 }
50 /*
51 * Function 4 - Display On Notification
52 */
53 If(Arg2 == LPID_DSM_ARG2_DISPLAY_ON_NOTIFY) {
54 }
55 /*
56 * Function 5 - Low Power S0 Entry Notification
57 */
58 If(Arg2 == LPID_DSM_ARG2_S0IX_ENTRY) {
59 /* Inform the EC */
60 If (CondRefOf (\_SB.PCI0.LPCB.EC0.S0IX)) {
61 \_SB.PCI0.LPCB.EC0.S0IX(1)
62 }
63
64 /* provide board level S0ix hook */
65 If (CondRefOf (\_SB.MS0X)) {
66 \_SB.MS0X(1)
67 }
68
69 /*
70 * Save the current PM bits then
71 * enable GPIO PM with MISCCFG_ENABLE_GPIO_PM_CONFIG
Elyes HAOUASbda27cd2020-06-27 07:17:16 +020072 */
Venkata Krishna Nimmagadda6f48df12020-04-07 15:49:55 -070073 If (CondRefOf (\_SB.PCI0.EGPM))
74 {
75 \_SB.PCI0.EGPM ()
76 }
77 }
78 /*
79 * Function 6 - Low Power S0 Exit Notification
80 */
81 If(Arg2 == LPID_DSM_ARG2_S0IX_EXIT) {
82 /* Inform the EC */
83 If (CondRefOf (\_SB.PCI0.LPCB.EC0.S0IX)) {
84 \_SB.PCI0.LPCB.EC0.S0IX(0)
85 }
86
87 /* provide board level S0ix hook */
88 If (CondRefOf (\_SB.MS0X)) {
89 \_SB.MS0X(0)
90 }
91
92 /* Restore GPIO all Community PM */
93 If (CondRefOf (\_SB.PCI0.RGPM))
94 {
95 \_SB.PCI0.RGPM ()
96 }
97 }
98 }
99
100 Return(Buffer(One) {0x00})
101 } // Method(_DSM)
102 } // Device (LPID)
103} // End Scope(\_SB)