| 1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 |
|
| 3 |
#include "gpu_defines.h" |
| 4 |
|
| 5 |
Scope (\_SB.PCI0.RP12) |
| 6 |
{ |
| 7 |
#include "peg.asl" |
| 8 |
|
| 9 |
Device (PXSX) |
| 10 |
{ |
| 11 |
Name (_ADR, 0x0) |
| 12 |
OperationRegion (PCIC, PCI_Config, 0x00, 0x100) |
| 13 |
Field (PCIC, DWordAcc, NoLock, Preserve) |
| 14 |
{ |
| 15 |
NVID, 16, |
| 16 |
NDID, 16, |
| 17 |
Offset (0x40), |
| 18 |
NVSS, 32 |
| 19 |
} |
| 20 |
|
| 21 |
#include "utility.asl" |
| 22 |
#include "power.asl" |
| 23 |
#include "nvop.asl" |
| 24 |
#include "nvjt.asl" |
| 25 |
#include "nbci.asl" |
| 26 |
#include "gps.asl" |
| 27 |
#include "gpu_ec.asl" |
| 28 |
|
| 29 |
/* Convert D Notify from EC to GPU */ |
| 30 |
Method (CNVD, 1, NotSerialized) |
| 31 |
{ |
| 32 |
Switch (ToInteger(Arg0)) { |
| 33 |
Case (D1_EC) { Return (D1_GPU) } |
| 34 |
Case (D2_EC) { Return (D2_GPU) } |
| 35 |
Case (D3_EC) { Return (D3_GPU) } |
| 36 |
Case (D4_EC) { Return (D4_GPU) } |
| 37 |
Case (D5_EC) { Return (D5_GPU) } |
| 38 |
Default { Return (D5_GPU) } |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
/* Current D Notify Value, defaults to D1 |
| 43 |
* Arg0 == Shared value |
| 44 |
* Arg1 == force notification if no change (0 or 1) |
| 45 |
*/ |
| 46 |
Name (CDNV, D1_EC) |
| 47 |
Method (DNOT, 2, Serialized) |
| 48 |
{ |
| 49 |
Printf ("EC: GPU D-Notify, %o", Arg0) |
| 50 |
If ((Arg0 != CDNV) || (Arg1 == 1)) |
| 51 |
{ |
| 52 |
CDNV = Arg0 |
| 53 |
Local0 = CNVD (Arg0) |
| 54 |
Notify (\_SB.PCI0.RP12.PXSX, Local0) |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
Method (_DSM, 4, Serialized) |
| 59 |
{ |
| 60 |
If (Arg0 == ToUUID (UUID_NVOP)) |
| 61 |
{ |
| 62 |
If (ToInteger(Arg1) >= REVISION_MIN_NVOP) |
| 63 |
{ |
| 64 |
Return (NVOP (Arg2, Arg3)) |
| 65 |
} |
| 66 |
} |
| 67 |
ElseIf (Arg0 == ToUUID (UUID_NVJT)) |
| 68 |
{ |
| 69 |
If (ToInteger (Arg1) >= REVISION_MIN_NVJT) |
| 70 |
{ |
| 71 |
Return (NVJT (Arg2, Arg3)) |
| 72 |
} |
| 73 |
} |
| 74 |
ElseIf (Arg0 == ToUUID (UUID_NBCI)) |
| 75 |
{ |
| 76 |
If (ToInteger (Arg1) >= REVISION_MIN_NBCI) |
| 77 |
{ |
| 78 |
Return (NBCI (Arg2, Arg3)) |
| 79 |
} |
| 80 |
} |
| 81 |
ElseIf (Arg0 == ToUUID (UUID_GPS)) |
| 82 |
{ |
| 83 |
If (ToInteger (Arg1) >= REVISION_MIN_GPS) |
| 84 |
{ |
| 85 |
Return (GPS (Arg2, Arg3)) |
| 86 |
} |
| 87 |
} |
| 88 |
|
| 89 |
Return (NV_ERROR_UNSUPPORTED) |
| 90 |
} |
| 91 |
} |
| 92 |
} |