Closed xuanhung1509 closed 7 months ago
In most cases you can't trust ChatGPT when it comes to ACPI. This has to be tested first.
The table contains errors. And I don't like refactoring just for the sake of refactoring. The way the original table is written is understandable.
Sorry for that, because the nested "If" kinda bothers me when inspecting the code.
Eventually, I decided to drop the DGPU thing (as I already use Dortania Optimus Method to disable dGPU), and all the EXTs that I don't use, and _TTS method that my DSDT doesn't have.
My final version looks like this:
DefinitionBlock ("", "SSDT", 2, "OCLT", "PTSWAK", 0x00000000)
{
External (ZPTS, MethodObj) // 1 Arguments
External (ZWAK, MethodObj) // 1 Arguments
Scope (_SB)
{
Device (PCI9)
{
Name (_ADR, Zero) // _ADR: Address
Name (FNOK, Zero)
Name (MODE, Zero)
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
Method (_PTS, 1, NotSerialized) // _PTS: Prepare To Sleep
{
If (_OSI ("Darwin"))
{
If ((\_SB.PCI9.FNOK == One))
{
Arg0 = 0x03
}
}
ZPTS (Arg0)
}
Method (_WAK, 1, NotSerialized) // _WAK: Wake
{
If (_OSI ("Darwin"))
{
If ((\_SB.PCI9.FNOK == One))
{
\_SB.PCI9.FNOK = Zero
Arg0 = 0x03
}
If (((Arg0 < One) || (Arg0 > 0x05)))
{
Arg0 = 0x03
}
}
Local0 = ZWAK (Arg0)
Return (Local0)
}
}
Eliminate nested If statement, using ChatGPT =))