1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #define JT_FUNC_SUPPORT 0
5 #define JT_FUNC_POWERCONTROL 3
6 #define JT_FUNC_PLATPOLICY 4
8 Method (NVJT, 2, Serialized)
10 Switch (ToInteger(Arg0))
12 Case (JT_FUNC_SUPPORT)
15 (1 << JT_FUNC_SUPPORT) |
17 (1 << JT_FUNC_POWERCONTROL) |
18 (1 << JT_FUNC_PLATPOLICY)))
23 (0 << 0) | /* JTE: G-Sync NVSR Power Features Enabled */
24 (1 << 0) | /* NVSE: NVSR Disabled */
25 (0 << 3) | /* PPR: Panel Power Rail */
26 (0 << 5) | /* SRPR: Self-Refresh Controller Power Rail */
27 (0 << 6) | /* FBPR: FB Power Rail */
28 (0 << 8) | /* GPR: GPU Power Rail */
29 (0 << 10) | /* GCR: GC6 ROM */
30 (1 << 11) | /* PTH: No SMI Handler */
31 (0 << 12) | /* NOT: Supports Notify on GC6 State done */
32 (1 << 13) | /* MHYB: MS Hybrid Support (deferred GC6) */
33 (0 << 14) | /* RPC: Root Port Control */
34 (0 << 15) | /* GC6 Version (GC6-E) */
35 (0 << 17) | /* GEI: GC6 Exit ISR Support */
36 (0 << 18) | /* GSW: GC6 Self Wakeup */
37 (0x200 << 20))) /* MXRV: Highest Revision */
39 Case (JT_FUNC_POWERCONTROL)
41 CreateField (Arg1, 0, 3, GPC) /* GPU Power Control */
42 CreateField (Arg1, 4, 1, PPC) /* Panel Power Control */
43 CreateField (Arg1, 14, 2, DFGC) /* Defer GC6 enter/exit */
44 CreateField (Arg1, 16, 3, GPCX) /* Deferred GC6 exit */
46 /* Deferred GC6 entry/exit is requested */
47 If (ToInteger(GPC) != 0 || ToInteger(DFGC) != 0)
49 DFEN = ToInteger(DFGC)
51 DFCO = ToInteger(GPCX)
54 Local0 = Buffer (4) { 0x0 }
55 CreateField (Local0, 0, 3, CGCS) /* Current GC State */
56 CreateField (Local0, 3, 1, CGPS) /* Current GPU power status */
57 CreateField (Local0, 7, 1, CPSS) /* Current panel and SRC state */
59 /* Leave early if deferred GC6 is requested */
67 Switch (ToInteger(GPC))
69 /* Get GCU GCx Sleep Status */
85 /* Enter GC6; no self-refresh */
92 /* Enter GC6; enable self-refresh */
94 If (ToInteger (PPC) == 0)
102 /* Exit GC6; stop self-refresh */
106 If (ToInteger (PPC) != 0)
113 /* Exit GC6 for self-refresh */
117 If (ToInteger (PPC) != 0)
128 Return (NV_ERROR_UNSUPPORTED)