1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #define NVOP_FUNC_SUPPORT 0x00
4 #define NVOP_FUNC_GET_OBJ_BY_TYPE 0x10
5 #define NVOP_FUNC_OPTIMUS_CAPS 0x1a
6 #define NVOP_FUNC_OPTIMUS_STATUS 0x1b
8 Method (NVOP, 2, Serialized)
10 Switch (ToInteger (Arg0))
12 Case (NVOP_FUNC_SUPPORT)
15 (1 << NVOP_FUNC_SUPPORT) |
16 (1 << NVOP_FUNC_OPTIMUS_CAPS) |
17 (1 << NVOP_FUNC_OPTIMUS_STATUS)))
19 Case (NVOP_FUNC_OPTIMUS_CAPS)
21 CreateField(Arg1, 0, 1, FLUP) /* Flag Update */
22 CreateField(Arg1, 1, 1, CSOT) /* Change configuration Space Owner Target */
23 CreateField(Arg1, 2, 1, CSOW) /* Change configuration Space Owner Write */
24 CreateField(Arg1, 24, 2, NPCE) /* New Power Control Enable setting */
26 /* Change Optimus power control capabilities */
27 If (ToInteger (FLUP) != 0 && ToInteger (NPCE) != 0)
32 /* Change PCI configuration space save/restore owner */
33 If (ToInteger (CSOW) == 1)
38 /* Current GPU Control Status */
49 (1 << 0) | /* Optimus Enabled */
50 (Local0 << 3) | /* Current GPU Control Status */
51 (0 << 6) | /* Shared Discrete GPU Hotplug Capabilities */
52 (0 << 7) | /* MUXed DDC/Aux Capabilities */
53 (PCIO << 8) | /* PCIe Configuration Space Owner */
54 (1 << 24) | /* Platform Optimus Power Capabilities */
55 (0 << 27))) /* Optimus HD Audio Codec Capabilities */
57 Case (NVOP_FUNC_OPTIMUS_STATUS)
60 (0 << 0) | /* Optimus Audio Codec Control */
61 (0 << 2) | /* Request GPU Power State */
62 (0 << 4) | /* Evaluate Requested GPU Power State */
63 (0 << 5) | /* Request Optimus Adapter Policy */
64 (0 << 7))) /* Evaluate Requested Optimus Adapter Selection */
68 Return (NV_ERROR_UNSUPPORTED)