#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 11a_Radeon_OFF_SSDT.txt
# To disable the Radeon chipset
# Apply these patches to SSDT containing the secondary graphics routines
# "SgTabl"
# Include patched version as SSDT-1.aml
# PLEASE NOTE: These patches are a work-in-progress
# syntax fixes
into scope label \_SB.PCI0.GFX0 code_regex (OperationRegion.*)VRMB\s+\(VRMS\s+\(\)\), replace_matched begin %1VRMB(),VRMS())\n end;
into scope label \_SB.PCI0.GFX0 code_regex (Field\s+\(REVD,.*\n.*\n.*\n.*\n.*\})\) replace_matched begin %1 end;
into scope label \_SB.PCI0.PEGP code_regex (OperationRegion.*)\\XBAS\s+\(0x9000\), replace_matched begin %1\\XBAS,0x9000)\n end;
into scope label \_SB.PCI0.PEGP code_regex (Field\s+\(RPCX,.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\})\) replace_matched begin %1 end;
into scope label \_SB.PCI0.PEGP.DGFX code_regex (OperationRegion.*)\\GBAS\s+\(0x60\), replace_matched begin %1\\GBAS,0x60)\n end;
into scope label \_SB.PCI0.PEGP.DGFX code_regex (Field\s+\(GPIO,.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\})\) replace_matched begin %1 end;
into scope label \_SB.PCI0.PEGP.DGFX code_regex (OperationRegion.*)\\EECP\s+\(0x14\), replace_matched begin %1\\EECP,0x14)\n end;
into scope label \_SB.PCI0.PEGP.DGFX code_regex (Field\s+\(PCAP.*\n.*\n.*\n.*\n.*\})\) replace_matched begin %1 end;
into definitionblock code_regex External\s+\(\\_SB_\.PCI0\.GFX0\.DD02\._BCM,\s+IntObj\) replace_matched begin External(\\_SB_.PCI0.GFX0.DD02._BCM, MethodObj)
end;
into method label _BCM parent_label DD02 code_regex Return\s+\(([^\)]*)\)\n.*Arg0 replace_matched begin Return(%1(Arg0)) end;
# rename GFX0
into_all all code_regex \.GFX0 replaceall_matched begin .IGPU end;
into_all all label \_SB.PCI0.GFX0 set_label begin \_SB.PCI0.IGPU end;
#REVIEW: may not be necessary)
# remove wait for LNKS (while loop)
into method label _OFF parent_label \_SB.PCI0.PEGP.DGFX code_regex While\s+\([^\}]*\} remove_matched;
# call _OFF from _SB.PCI0.DGFX._INI
into method label _INI parent_label \_SB.PCI0.PEGP.DGFX code_regex . insert begin _OFF()\n end;