Overview
After applying this patch, the patched _INI now reads:
Code:
Method (_INI, 0, NotSerialized) // _INI: Initialize
{
Store (Zero, \_SB.PCI0.RP05.PEGP._ADR)
//added to turn nvidia/radeon off
External(\_SB.PCI0.RP05.PEGP._OFF, MethodObj)
_OFF()
}
Now we need to turn our attention to DSDT _REG. The _REG method needs to do the EC work that _OFF used to do before we patched it.
Here is the original _REG (for EC0) in DSDT:
Code:
Method (_REG, 2, NotSerialized) // _REG: Region Availability
{
If (LEqual (Arg0, 0x03))
{
Store (Arg1, ECFL)
}
}
There is a patch in my repo to call _OFF from _REG. We can use it as a base for what we need:
Code:
into method label _REG parent_hid PNP0C09 insert
begin
//added to turn nvidia/radeon off\n
If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))\n
{\n
External(\_SB.PCI0.PEG0.PEGP._OFF, MethodObj)\n
\_SB.PCI0.PEG0.PEGP._OFF()\n
}\n
end;
Instead of calling _OFF, we want it to call SPIN as the original _OFF did.
The modified patch is:
Code:
into method label _REG parent_hid PNP0C09 insert
begin
//added to turn nvidia/radeon off\n
If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))\n
{\n
\_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero)\n
}\n
end;
The modified _REG after patching:
Code:
Method (_REG, 2, NotSerialized) // _REG: Region Availability
{
If (LEqual (Arg0, 0x03))
{
Store (Arg1, ECFL)
}
//added to turn nvidia/radeon off
If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
{
\_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero)
}
}
And not all _OFF methods access the EC, so the movement of the EC related code to _REG is not needed.