#Maintained by: PHPdev32 for: Sourceforge into method label DTGP remove_entry; into definitionblock code_regex . insert begin Method (DTGP, 5, NotSerialized)\n {\n If (LEqual (Arg0, Buffer (0x10)\n {\n /* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, \n /* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B\n }))\n {\n If (LEqual (Arg1, One))\n {\n If (LEqual (Arg2, Zero))\n {\n Store (Buffer (One)\n {\n 0x03\n }, Arg4)\n Return (One)\n }\n If (LEqual (Arg2, One))\n {\n Return (One)\n }\n }\n }\n Store (Buffer (One)\n {\n 0x00\n }, Arg4)\n Return (Zero)\n } end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 00_Optimize.txt # Optimize (get rid of stuff that is WMI/BIOS related) # remove large chunk of symbols used only by device WMID and device WMID itself into all code_regex Name\s*\(WSIP,[\s\S]*Name\s*\(ETYP,\s*Buffer\s*\(.*\)\s*\{\}\) remove_matched; into device label WMID remove_entry; # remove references to device WMID into_all all code_regex .*WMID.*\(.*\) removeall_matched; into method label _TMP parent_label PCHZ code_regex Store\s*\(DerefOf\s*\(Index\s*\(DerefOf\s*\(Index\s*\(\\_SB\.WMID\.TSTV,[\s\S]*\} remove_matched; # remove all OEM _DSM methods into_all method label _DSM remove_entry; # remove ThermalZone into scope label \_TZ remove_entry; into_all method code_regex \\_TZ.* removeall_matched; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 01_Compilation.txt # Fix compilation errors # Fix _T_x compiler reserved warnings (not necessary to fix) #into_all all code_regex _T_0 replaceall_matched begin T_0 end; #into_all all code_regex _T_1 replaceall_matched begin T_1 end; #into_all all code_regex _T_2 replaceall_matched begin T_2 end; #into_all all code_regex _T_3 replaceall_matched begin T_3 end; #into_all all code_regex _T_4 replaceall_matched begin T_4 end; #into_all all code_regex _T_5 replaceall_matched begin T_5 end; #into_all all code_regex _T_6 replaceall_matched begin T_6 end; # Another way to fix the _T_x compiler reserved warnings (still not necessary) #into method label TRUP code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label TRUP code_regex Store\s+\(PRDT,\s+_T_0\) remove_matched; #into method label TRUP code_regex \(_T_0 replaceall_matched begin (PRDT end; #into method label VHIV code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label VHIV code_regex Store\s+\(Arg2,\s+_T_0\) remove_matched; #into method label VHIV code_regex \(_T_0 replaceall_matched begin (Arg2 end; #into method label \_SB.PCI0.LPCB.PS2M._HID code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label \_SB.PCI0.LPCB.PS2M._HID code_regex Store\s+\(PRDT,\s+_T_0\) remove_matched; #into method label \_SB.PCI0.LPCB.PS2M._HID code_regex \(_T_0 replaceall_matched begin (PRDT end; #into method label WQBI code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label WQBI code_regex Store\s+\(Arg0,\s+_T_0\) remove_matched; #into method label WQBI code_regex \(_T_0 replaceall_matched begin (Arg0 end; #into method label WQBC code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label WQBC code_regex Store\s+\(Local6,\s+_T_0\) remove_matched; #into method label WQBC code_regex \(_T_0 replaceall_matched begin (Local6 end; #into method label WQBC code_regex Name\s+\(_T_1,\s+Zero\) remove_matched; #into method label WQBC code_regex Store\s+\(DerefOf\s+\(Index\s+\(ST99,\s+0x00\)\),\s+_T_1\) replace_matched begin Store (DerefOf (Index (ST99, 0x00)), Local2) end; #into method label WQBC code_regex \(_T_1 replaceall_matched begin (Local2 end; #nto method label WMBA code_regex Name\s+\(_T_0,\s+Zero\) remove_matched; #into method label WMBA code_regex Store\s+\(Local6,\s+_T_0\) remove_matched; #into method label WMBA code_regex \(_T_0 replaceall_matched begin (Local6 end; # Fix parse errors into device label GFX0 code_regex If\s\(CondRefOf\s\(FPED\)\)\s*\n\s*\{\s*\n\s*FPED\s\(\)\s*\n\s*\} remove_matched; # Fix line 2169 2181 compilations errors (these are specfiic to 4530s) into_all all code_regex DWordMemory\s\(ResourceProducer,\sPosDecode,\sMinFixed,\sMaxFixed,\sCacheable,\sReadWrite,\n\s+0x00000000,\s+//\sGranularity\n\s+0x00000000,\s+//\sRange\sMinimum\n\s+0x00000000,\s+//\sRange\sMaximum\n\s+0x00000000,\s+//\sTranslation\sOffset\n\s+0x00000000,\s+//\sLength replace_matched begin DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,\n 0x00000000, // Granularity\n 0x00000000, // Range Minimum\n 0x00000000, // Range Maximum\n 0x00000000, // Translation Offset\n 0x00000001, // Length\n end; into_all all code_regex DWordMemory\s\(ResourceProducer,\sPosDecode,\sMinFixed,\sMaxFixed,\sCacheable,\sReadWrite,\n\s+0x00000000,\s+//\sGranularity\n\s+0x00000000,\s+//\sRange\sMinimum\n\s+0xFEDFFFFF,\s+//\sRange\sMaximum\n\s+0x00000000,\s+//\sTranslation\sOffset\n\s+0x00000000,\s+//\sLength replace_matched begin DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,\n 0x00000000, // Granularity\n 0x00000000, // Range Minimum\n 0xFEDFFFFF, // Range Maximum\n 0x00000000, // Translation Offset\n 0xFEE00000, // Length\n end; # Fix 3 compilation warnings #rehabman: These are warnings and not sure if it a good idea to "fix" them... #into_all all code_regex \\_SB\.F4EV,.0x0500 replaceall_matched begin F4EV, 0xFFFF end; #into_all all code_regex \\_SB\.BEVT,.0x10 replaceall_matched begin BEVT, 0xFFFF end; # Fix NBTT compilation warning #rehabman: These are also warnings, and not necessary to patch #into_all all code_regex Name\s\(NBTT,\sPackage\s\(0x08\) replaceall_matched #begin #Name (NBTT, Package() #end; # ProBook 4x40s specific into all code_regex Name\s+\(BB2S,\s+\"\s+\"\.\.\.\) replace_matched begin Name (BB2S, " ") end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 02_DSDTPatch.txt # Replace all instances of AC with ADP1 into_all all code_regex \.AC, replaceall_matched begin .ADP1, end; into_all all code_regex \(AC, replaceall_matched begin (ADP1, end; into all label AC set_label begin ADP1 end; # Power fix - uses AppleACPIBatteryManager.kext instead VoodooBattery into device label ADP1 code_regex Name\s+\(_PRW,[\s\S]*\}\) remove_matched; into device label ADP1 insert begin Name (_PRW, Package() { 0x18, 0x03 }) end; # Enable functions keys # Override DSDT oemId (for Clover, since it patches with "Apple ") into method label _DSM parent_label PS2K remove_entry; into device label PS2K insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "RM,oem-id", "HPQOEM",\n "RM,oem-table-id", "167C",\n })\n }\n end; # Inject Audio info into method label _DSM parent_label HDEF remove_entry; into device label HDEF insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "hda-gfx", Buffer() { "onboard-1" },\n "layout-id", Buffer() { 0x0C, 0x00, 0x00, 0x00 },\n "PinConfigurations", Buffer() { },\n //"MaximumBootBeepVolume", 77,\n })\n }\n end; # IRQ fix into device name_hid PNP0000 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0100 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0B00 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0103 code_regex IRQNoFlags\s\(\)\n\s+\{.*\} removeall_matched; into device name_hid PNP0103 code_regex Name\s\(([^,]+),\sResourceTemplate\s\(\)\n\s+\{((?:.|\n)*)\}\) replace_matched begin Name (%1, ResourceTemplate()\n {\n IRQNoFlags() { 0, 8, 11, 15 }\n %2 })\n end; # Rename all instances of GFX0 to IGPU into_all all code_regex GFX0 replaceall_matched begin IGPU end; into_all all label GFX0 set_label begin IGPU end; # RTC fix into device name_hid PNP0B00 code_regex (IO\s\((?:\s*[^,]+,\s*(?:\/\/\s.*)?\s*\n)+\s*)(\dx\d+)(,\s*(?:\/\/\s.*)?\s*\n\s*\)) replace_matched begin %10x02%3 end; # Shutdown fix into method label _PTS code_regex_not If\s\(LEqual\s\(Arg0,\s0x05\)\) code_regex ^((?:.|\n)*)$ replace_matched begin If (LEqual (Arg0, 0x05)) {}\n Else\n {\n %1 }\n end; # SMBUS fix into device label BUS0 parent_adr 0x001F0003 remove_entry; into device name_adr 0x001F0003 insert begin Device (BUS0)\n {\n Name (_CID, "smbus")\n Name (_ADR, Zero)\n Device (DVL0)\n {\n Name (_ADR, 0x57)\n Name (_CID, "diagsvault")\n Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package() { "address", 0x57 })\n }\n }\n }\n end; # USB sleep fix injects Macbook 8,1 device IDs into method label _DSM parent_adr 0x001D0001 remove_entry; into device name_adr 0x001D0001 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c27" },\n })\n }\n end; into method label _DSM parent_adr 0x001D0002 remove_entry; into device name_adr 0x001D0002 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c2c" },\n })\n }\n end; into method label _DSM parent_adr 0x001D0003 remove_entry; into device name_adr 0x001D0003 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c27" },\n })\n }\n end; into method label _DSM parent_adr 0x001D0004 remove_entry; into device name_adr 0x001D0004 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c2c" },\n })\n }\n end; into method label _DSM parent_adr 0x001A0001 remove_entry; into device name_adr 0x001A0001 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return(Package()\n {\n "device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c27" },\n })\n }\n end; into method label _DSM parent_adr 0x001A0002 remove_entry; into device name_adr 0x001A0002 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Store (Package()\n {\n "device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c2c" },\n })\n }\n end; into method label _DSM parent_adr 0x001A0003 remove_entry; into device name_adr 0x001A0003 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n "name", Buffer() { "pci8086,1c27" },\n })\n }\n end; # HPET fix to avoid AppleIntelCPUPowerManagement panic into method label _STA parent_hid PNP0103 remove_entry; into device name_hid PNP0103 code_regex Name\s\(_STA\,\s+0x0F\) remove_matched; into device name_hid PNP0103 insert begin Name (_STA, 0x0F)\n end; into method label _CRS parent_hid PNP0103 remove_entry; into device name_hid PNP0103 insert begin Method (_CRS, 0, NotSerialized) { Return (BUF0) }\n end; # Fix _WAK method to deal with bug in AppleACPIPlatform v1.8 (in 10.8.5+) into method label _WAK code_regex \s*(.?WAK\s+\([^)]*\)) replace_matched begin If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n %1 end; # Add missing IMEI device into device label IMEI parent_label PCI0 remove_entry; into device label PCI0 insert begin Device (IMEI)\n {\n Name (_ADR, 0x00160000)\n }\n end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 02a_EHCI_4x30s.txt # USB property injection for 4x30s (HM65) # EHCI fix inject Apple properties for device 0x1C26 into EHC1 into method label _DSM parent_adr 0x001D0000 remove_entry; into device name_adr 0x001D0000 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "built-in", Buffer() { 0x00 },\n "AAPL,clock-id", Buffer() { 0x01 },\n "device_type", Buffer() { "EHCI" },\n "AAPL,current-available", 2100,\n "AAPL,current-extra", 2200,\n "AAPL,current-extra-in-sleep", 1600,\n "AAPL,device-internal", 0x02,\n "AAPL,max-port-current-in-sleep", 2100,\n })\n }\n end; # EHCI fix inject Apple properties for device 0x1C2D into EHC2 into method label _DSM parent_adr 0x001A0000 remove_entry; into device name_adr 0x001A0000 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "built-in", Buffer() { 0x00 },\n "AAPL,clock-id", Buffer() { 0x01 },\n "device_type", Buffer() { "EHCI" },\n "AAPL,current-available", 2100,\n "AAPL,current-extra", 2200,\n "AAPL,current-extra-in-sleep", 1600,\n "AAPL,device-internal", 0x02,\n "AAPL,max-port-current-in-sleep", 2100,\n })\n }\n end; # LPC fix injects device 0x1C49 HM65 #rahabman: looks like this patch is not necessary since the native ID # is already 0x1c49. tested and ioreg looks same with and without # this patch. #into method label _DSM parent_adr 0x001F0000 remove_entry; #into device name_adr 0x001F0000 insert #begin #Method (_DSM, 4, NotSerialized)\n #{\n # If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n # Return (Package()\n # {\n # "device-id", Buffer() { 0x49, 0x1C, 0x00, 0x00\n },\n # "name", Buffer() { "pci8086,1c49" },\n # })\n #}\n #end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 03b_1080p+HDMI.txt # # Use this patch if your laptop has 1600x900 or higher # resolution screen. # # For example, 47x0s (17") or 45x0s with 1080p user # upgraded screen. # # Inject HDMI info and dual-link into GFX0/IGPU into method label _DSM parent_adr 0x00020000 remove_entry; into device name_adr 0x00020000 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "AAPL,snb-platform-id", Buffer() { 0x00, 0x00, 0x01, 0x00 },\n "AAPL,ig-platform-id", Buffer() { 0x04, 0x00, 0x66, 0x01 },\n "hda-gfx", Buffer() { "onboard-1" },\n "AAPL00,DualLink", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n // Note: below is for Snow Leopard booting via Clover\n //"AAPL,os-info", Buffer (0x14)\n // { 0x30, 0x49, 0x01, 0x11, 0x11, 0x11, 0x08, 0x00,\n // 0x00, 0x01, 0xF0, 0x1F, 0x01, 0x00, 0x00, 0x00,\n // 0x10, 0x07, 0x00, 0x00 },\n })\n }\n end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 04b_FanQuiet.txt # # This fan patch provides enhanced fan control. It does so by tricking # the system into thinking that the laptop is arbitrarily cool, such # that it can override the default behavior and have complete control # over the fan. # # More information on how this works is available at: # http://www.tonymacx86.com/hp-probook/72043-new-fan-control-dsdt-silent-fan-higher-temps.html # # add fan readings and fan control into device label SMCD remove_entry; into definitionblock code_regex . insert begin Device (SMCD)\n {\n Name (_HID, "FAN00000") // _HID: Hardware ID\n // ACPISensors.kext configuration\n Name (TACH, Package()\n {\n "System Fan", "FAN0",\n })\n Name (TEMP, Package()\n {\n "CPU Heatsink", "TCPU",\n "Ambient", "TAMB",\n //"Mainboard", "TSYS",\n //"CPU Proximity", "TCPP",\n })\n // Actual methods to implement fan/temp readings/control\n Method (FAN0, 0, Serialized)\n {\n Store (\_SB.PCI0.LPCB.EC0.FRDC, Local0)\n If (Local0) { Divide (Add(0x3C000, ShiftRight(Local0,1)), Local0,, Local0) }\n If (LEqual (0x03C4, Local0)) { Return (Zero) }\n Return (Local0)\n }\n Method (TCPU, 0, Serialized)\n {\n Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n Store (1, \_SB.PCI0.LPCB.EC0.CRZN)\n Store (\_SB.PCI0.LPCB.EC0.DTMP, Local0)\n Release (\_SB.PCI0.LPCB.EC0.ECMX)\n Return (Local0)\n }\n Method (TAMB, 0, Serialized)\n {\n Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n Store (4, \_SB.PCI0.LPCB.EC0.CRZN)\n Store (\_SB.PCI0.LPCB.EC0.TEMP, Local0)\n Release (\_SB.PCI0.LPCB.EC0.ECMX)\n Return (Local0)\n }\n // Fan Control Table (pairs of temp, fan control byte)\n Name (FTAB, Buffer()\n {\n 50, 255, // 255 is off (really auto, but at low temp it is off)\n 57, 128, // 128 is slowest speed\n 63, 82,\n 68, 74,\n 72, 59,\n 75, 49,\n 0xFF, 0 // last entry must be 0xFF, 0 is max fan speed\n })\n // Table to keep track of past temperatures (to track average)\n Name (FHST, Buffer(16) { 0x0, 0, 0, 0, 0x0, 0, 0, 0, 0x0, 0, 0, 0, 0x0, 0, 0, 0 })\n Name (FIDX, Zero) // current index in buffer above\n Name (FNUM, Zero) // number of entries in above buffer to count in avg\n Name (FSUM, Zero) // current sum of entries in buffer\n // Keeps track of last fan speed set, and counter to set new one\n Name (FLST, 0xFF) // last index for fan control\n Name (FCNT, 0) // count of times it has been "wrong", 0 means no counter\n Name (FCTU, 20) // timeout for changes (fan rpm going up)\n Name (FCTD, 40) // timeout for changes (fan rpm going down)\n \n // Fan control for CPU -- expects to be evaluated 1-per second\n Method (FCPU, 0, Serialized)\n {\n Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n \n // setup fake temperature (this is the key to controlling the fan!)\n Store (1, \_SB.PCI0.LPCB.EC0.CRZN) // select CPU temp\n Store (31, \_SB.PCI0.LPCB.EC0.TEMP) // write fake value there (31C)\n \n // get current temp into Local0 for eventual return\n // Note: reading from DTMP here instead of TEMP because we wrote\n // a fake temp to TEMP to trick the system into running the fan\n // at a lower speed than it otherwise would.\n Store (1, \_SB.PCI0.LPCB.EC0.CRZN) // select CPU temp\n Store (\_SB.PCI0.LPCB.EC0.DTMP, Local0) // Local0 is current temp\n \n // calculate average temperature\n Add (Local0, FSUM, Local1)\n Store (FIDX, Local2)\n Subtract (Local1, DerefOf (Index (FHST, Local2)), Local1)\n Store (Local0, Index (FHST, Local2))\n Store (Local1, FSUM) // Local1 is new sum\n \n // adjust current index into temp table\n Increment (Local2)\n if (LGreaterEqual (Local2, SizeOf(FHST))) { Store (0, Local2) }\n Store (Local2, FIDX)\n // adjust total items collected in temp table\n Store (FNUM, Local2)\n if (LNotEqual (Local2, SizeOf (FHST)))\n {\n Increment (Local2)\n Store (Local2, FNUM)\n }\n \n // Local1 is new sum, Local2 is number of entries in sum\n Divide (Local1, Local2,, Local0) // Local0 is now average temp\n \n // table based search (use avg temperature to search)\n if (LGreater (Local0, 255)) { Store (255, Local0) }\n Store (Zero, Local2)\n while (LGreater (Local0, DerefOf (Index (FTAB, Local2)))) { Add (Local2, 2, Local2) }\n \n // calculate difference between current and found index\n if (LGreater (Local2, FLST))\n {\n Subtract(Local2, FLST, Local1)\n Store(FCTU, Local4)\n }\n Else\n {\n Subtract(FLST, Local2, Local1)\n Store(FCTD, Local4)\n }\n \n // set new fan speed, if necessary\n if (LEqual (Local1, 0))\n {\n // no difference, so leave current fan speed and reset count\n Store (0, FCNT)\n }\n Else\n {\n // there is a difference, start/continue process of changing fan\n Store (FCNT, Local3)\n Increment (Local3)\n Store (Local3, FCNT)\n \n // how long to wait depends on how big the difference\n // 20 secs if diff is 2, 5 secs if diff is 4, etc.\n Divide (ShiftLeft (Local4, 1), Local1,, Local1)\n if (LGreaterEqual (Local3, Local1))\n {\n // timeout expired, so set new fan speed\n Store (Local2, FLST)\n Increment (Local2)\n Store (DerefOf (Index (FTAB, Local2)), \_SB.PCI0.LPCB.EC0.FTGC)\n Store (0, FCNT)\n }\n }\n \n Release (\_SB.PCI0.LPCB.EC0.ECMX)\n return (Local0) // returns average temp\n }\n // for debugging fan control\n Method (TCPP, 0, Serialized) // Average temp\n {\n Store (FNUM, Local0)\n if (LNotEqual (Local0, 0))\n {\n Store (FSUM, Local1)\n Divide (Local1, Local0,, Local0)\n }\n Return (Local0)\n }\n Method (TSYS, 0, Serialized) // fan counter\n {\n Return (FCNT)\n }\n }\n end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 05_OScheck.txt # patch _INI method in Scope(_SB) into method label _INI replace_content begin // always store 0x07D6 for "Darwin"\n Store (0x07D6, OSYS)\n //\_TZ.BOTT ()\n //\_TZ.RETD ()\n Store (One, PFLV)\n end; into method label WCOS replace_content begin // assume "Windows 2006" values\n Store (0x06, WOSI)\n Store (WOSI, WHOS)\n Return (WOSI)\n end; # patch OS checks #into_all all code_regex If\s\(_OSI\s\(\"Windows\s2006\"\)\) replaceall_matched #begin If (LOr (_OSI ("Darwin"), _OSI ("Windows 2006"))) end; #into_all all code_regex If\s\(\\_OSI\s\(\"Windows\s2006\"\)\) replaceall_matched #begin If (LOr (_OSI ("Darwin"), _OSI ("Windows 2006"))) end; # Remove icons on menu bar for SD card into method label _RMV parent_label SMHC replace_content begin Return (Zero) end; into method label _RMV parent_label MSHC replace_content begin Return (Zero) end; into method label _RMV parent_label XDCC replace_content begin Return (Zero) end; into method label _RMV parent_label I1C replace_content begin Return (Zero) end; #Maintained by: RehabMan for: HP Probook 4x30s/4x40s # 06_Battery.txt # Add cycle count and temperature to battery info method # 16-bit version into method label BTIF code_regex Store\s\(BDAT,\sLocal1\) replace_matched begin Store (BDAT, Local1)\n // battery cycle count\n Store (BCC, Index (DerefOf (Index (NBTI, Arg0)), 0x0D))\n // battery temperature\n Acquire (\\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n Store (5, \\_SB.PCI0.LPCB.EC0.CRZN)\n Store (\\_SB.PCI0.LPCB.EC0.TEMP, Local2)\n Release (\\_SB.PCI0.LPCB.EC0.ECMX)\n Add (Multiply (Local2, 10), 2732, Local2) // Celsius to .1K\n Store (Local2, Index (DerefOf (Index (NBTI, Arg0)), 0x0E))\n end; # Need to extend size of NBTI packages into all code_regex \"Hewlett\-Packard\"\s+\},\s+Package\s\(0x0D\) replaceall_matched begin "Hewlett-Packard",\n Zero,\n Zero,\n },\n Package(0x0F)\n end; into all code_regex Name\s\(NBTI,\sPackage\s\(0x02\)\s+\{\s+Package\s\(0x0D\) replaceall_matched begin Name (NBTI, Package(0x02)\n {\n Package(0x0F)\n end; into_all all code_regex \"LIon\",\s+\"Hewlett\-Packard\"\n\s+\}\n replaceall_matched begin "LIon",\n "Hewlett-Packard",\n Zero,\n Zero,\n }\n end; # Convert battery EC info from 16-bit to 8-bit fields... # Need this utility method B1B2(lowbyte, hibyte)... returns ((hibyte << 8) | lowbyte) into method label B1B2 remove_entry; into definitionblock code_regex . insert begin Method (B1B2, 2, NotSerialized)\n {\n ShiftLeft (Arg1, 8, Local0)\n Or (Arg0, Local0, Local0)\n Return (Local0)\n }\n end; # Change EC register declarations from 16-bit to 8-bit into device label EC0 code_regex BSN,\s+16 replace_matched begin BSN0, 8, BSN1, 8 end; into device label EC0 code_regex CBT,\s+16 replace_matched begin CBT0, 8, CBT1, 8 end; into device label EC0 code_regex BDC,\s+16 replace_matched begin BDC0, 8, BDC1, 8 end; into device label EC0 code_regex BFC,\s+16 replace_matched begin BFC0, 8, BFC1, 8 end; into device label EC0 code_regex BPR,\s+16 replace_matched begin BPR0, 8, BPR1, 8 end; into device label EC0 code_regex BCR,\s+16 replace_matched begin BCR0, 8, BCR1, 8 end; into device label EC0 code_regex BRC,\s+16 replace_matched begin BRC0, 8, BRC1, 8 end; into device label EC0 code_regex BCC,\s+16 replace_matched begin BCC0, 8, BCC1, 8 end; into device label EC0 code_regex BPV,\s+16 replace_matched begin BPV0, 8, BPV1, 8 end; into device label EC0 code_regex BME,\s+16 replace_matched begin BME0, 8, BME1, 8 end; into device label EC0 code_regex BDV,\s+16 replace_matched begin BDV0, 8, BDV1, 8 end; into device label EC0 code_regex BRTE,\s+16 replace_matched begin RTE0, 8, RTE1, 8 end; into device label EC0 code_regex BATE,\s+16 replace_matched begin ATE0, 8, ATE1, 8 end; into device label EC0 code_regex BCV1,\s+16 replace_matched begin BCX0, 8, BCX1, 8 end; into device label EC0 code_regex BCV2,\s+16 replace_matched begin BCA0, 8, BCA1, 8 end; into device label EC0 code_regex BCV3,\s+16 replace_matched begin BCB0, 8, BCB1, 8 end; into device label EC0 code_regex BCV4,\s+16 replace_matched begin BCP0, 8, BCP1, 8 end; into device label EC0 code_regex BATF,\s+16 replace_matched begin ATF0, 8, ATF1, 8 end; into device label EC0 code_regex MAXC,\s+16 replace_matched begin AXC0, 8, AXC1, 8 end; into device label EC0 code_regex BSTS,\s+16 replace_matched begin BST0, 8, BST1, 8 end; into device label EC0 code_regex BDAT,\s+16 replace_matched begin BDA0, 8, BDA1, 8 end; # Change access (reads) to those registers from 16-bit to 8-bit into_all method label BTIF code_regex \(BFC, replaceall_matched begin (B1B2 (BFC0, BFC1), end; into_all method label GBTI code_regex \(BFC, replaceall_matched begin (B1B2 (BFC0, BFC1), end; into_all method label BTIF code_regex \(BDV, replaceall_matched begin (B1B2 (BDV0, BDV1), end; into_all method label GBTI code_regex \(BDV, replaceall_matched begin (B1B2 (BDV0, BDV1), end; into_all method label BTIF code_regex \(BSN, replaceall_matched begin (B1B2 (BSN0, BSN1), end; into_all method label GBTI code_regex \(BSN, replaceall_matched begin (B1B2 (BSN0, BSN1), end; into_all method label BTST code_regex \(BPR, replaceall_matched begin (B1B2 (BPR0, BPR1), end; into_all method label GBTI code_regex \(BPR, replaceall_matched begin (B1B2 (BPR0, BPR1), end; into_all method label BTST code_regex \(BRC, replaceall_matched begin (B1B2 (BRC0, BRC1), end; into_all method label GBTI code_regex \(BRC, replaceall_matched begin (B1B2 (BRC0, BRC1), end; into_all method label GBTI code_regex \(BCR, replaceall_matched begin (B1B2 (BCR0, BCR1), end; into_all method label BTST code_regex \(BCR, replaceall_matched begin (B1B2 (BCR0, BCR1), end; into_all method label BTST code_regex \(BPV, replaceall_matched begin (B1B2 (BPV0, BPV1), end; into_all method label GBTI code_regex \(BPV, replaceall_matched begin (B1B2 (BPV0, BPV1), end; into_all method label GBTI code_regex \(BDC, replaceall_matched begin (B1B2 (BDC0, BDC1), end; into_all method label GBTI code_regex \(BME, replaceall_matched begin (B1B2 (BME0, BME1), end; into_all method label GBTI code_regex \(BCC, replaceall_matched begin (B1B2 (BCC0, BCC1), end; into_all method label BTIF code_regex \(BCC, replaceall_matched begin (B1B2 (BCC0, BCC1), end; into_all method label GBTI code_regex \(CBT, replaceall_matched begin (B1B2 (CBT0, CBT1), end; into_all method label GBTI code_regex \(BSTS, replaceall_matched begin (B1B2 (BST0, BST1), end; into_all method label BTIF code_regex \(BDAT, replaceall_matched begin (B1B2 (BDA0, BDA1), end; into_all method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2 (BDA0, BDA1), end; into_all method label GBTI code_regex \(BCV1, replaceall_matched begin (B1B2 (BCX0, BCX1), end; into_all method label GBTI code_regex \(BCV2, replaceall_matched begin (B1B2 (BCA0, BCA1), end; into_all method label GBTI code_regex \(BCV3, replaceall_matched begin (B1B2 (BCB0, BCB1), end; into_all method label GBTI code_regex \(BCV4, replaceall_matched begin (B1B2 (BCP0, BCP1), end; into_all method label GBTI code_regex \(BRTE, replaceall_matched begin (B1B2 (RTE0, RTE1), end; into_all method label GBTI code_regex \(BATE, replaceall_matched begin (B1B2 (ATE0, ATE1), end; into_all method label GBTI code_regex \(BATF, replaceall_matched begin (B1B2 (ATF0, ATF1), end; into_all method label GBTC code_regex \(MAXC, replaceall_matched begin (B1B2 (AXC0, AXC1), end; # Now deal with the writes to those registers # Store (0xFA, MAXC) into_all method label SBTC code_regex \(0xFA,\sMAXC\) replaceall_matched begin (0xFA, AXC0)\nStore (Zero, AXC1) end; # Store (Zero, MAXC) into_all method label SBTC code_regex \(Zero,\sMAXC\) replaceall_matched begin (Zero, AXC0)\nStore (Zero, AXC1) end; # Store (0x00, MAXC) into_all method label SBTC code_regex \(0x00,\sMAXC\) replaceall_matched begin (0x00, AXC0)\nStore (0x00, AXC1) end; # Store (GBSS (B1B2 (BSN0, BSN1), BDAT, BTSN) into_all method label GBTI code_regex Store\s\(GBSS\s\(B1B2\s\(BSN0,\sBSN1\),\sBDAT\),\sBTSN\) replaceall_matched begin Store (GBSS (B1B2 (BSN0, BSN1), B1B2 (BDA0, BDA1)), BTSN)\n end; # Disable BAT1 device into method label _STA parent_label BAT1 replace_content begin Return (Zero) end; into method label _DSM parent_label HDEF remove_entry; into device label HDEF insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package(0x12)\n {\n "AAPL,slot-name", "Built In",\n "name", "IDT Audio Controller",\n "model", Buffer (0x1E) { "IDT 92HD81B1X Audio Controller" },\n "device_type", Buffer (0x11) { "Audio Controller" },\n "built-in", Buffer (One) { 0x01 },\n "layout-id", Buffer(0x04) { 0x0C, 0x00, 0x00, 0x00 },\n "PinConfigurations", Buffer (Zero) {},\n "MaximumBootBeepVolume", Buffer (One) { 0x40 },\n "hda-gfx", Buffer() { "onboard-1" },\n })\n }\n end; into device label XDCC set_label begin SDXC end; into_all device label SDXC code_regex (\s+OperationRegion\s\(ARE1,\sPCI_Config,\sZero,\s0x04\)\n\s+Field\s\(ARE1,\sByteAcc,\sNoLock,\sPreserve\)\n\s+\{\n\s+AVND,\s+16\n\s+\}) remove_matched; into device label SDXC insert begin OperationRegion (ARE1, PCI_Config, Zero, 0x04)\n Field (ARE1, ByteAcc, NoLock, Preserve)\n {\n AVND, 16\n }\n end; into_all device label SDXC code_regex (Name\s\(_PRW,\sPackage\s\(0x02\)\s+\//\s_PRW:\sPower\sResources\sfor\sWake\n\s+\{\n\s+0x19,\n\s+0x03\n\s+\}\)) remove_matched; into device label SDXC insert begin Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake\n {\n 0x19,\n 0x03\n })\n end; into method label _DSM parent_label SDXC remove_entry; into device label SDXC insert begin Method (_DSM, 4, NotSerialized)\n {\n Store (Package (0x0A)\n {\n "AAPL,slot-name", "Built In",\n "name", Buffer (0x25) { "JMicron SD/MMC Cardreader Controller" },\n "model", Buffer (0x25) { "JMicron SD/MMC Cardreader Controller" },\n "device_type", Buffer (0x10) { "SDXC Controller" },\n "built-in", Buffer (One) { 0x01 }\n }, Local0)\n DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n Return (Local0)\n }\n end; # Enable functions keys # Override DSDT oemId (for Clover, since it patches with "Apple ") into method label _DSM parent_label PS2K remove_entry; into device label PS2K insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n // Note: Function key part seems to not be necessary // "AAPL,has-embedded-fn-keys", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n "RM,oem-id", "HPQOEM",\n "RM,oem-table-id", "161C",\n })\n }\n end; into device label ARPT remove_entry; into method label _DSM parent_label WNIC remove_entry; into device label WNIC replace_content begin Name (_ADR, Zero)\n Name (_PRW, Package (0x02) {0x09,0x04})\n Name (_SUN, One)\n Method (_DSM, 4, NotSerialized)\n {\n Store (Package (0x0C) {\n "AAPL,slot-name", "AirPort",\n "name", "AirPort Extreme",\n "model", Buffer () {"Broadcom BCM43224HMS 802.11 a/b/g/n Wireless Network Adapter"},\n "device_type", Buffer (0x07) {"AirPort"},\n "compatible", "pci14e4,43a0",\n "built-in", Buffer (One) {0x01}\n }, Local0)\n DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n Return (Local0)\n } end; into method label _DSM parent_label GLAN remove_entry; into device label GLAN insert begin Method (_DSM, 4, NotSerialized)\n {\n Store (Package (0x0C) {\n "AAPL,slot-name", "Built In",\n "name", "Intel Ethernet Controller",\n "model", "Intel I218-V Gigabit Network Controller",\n "device_type", Buffer (0x14) {"Ethernet Controller"},\n "built-in", Buffer (One) {0x01},\n "location", Buffer (0x02) {"1"}\n }, Local0)\n DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n Return (Local0)\n } end; into device label SMHC set_label begin FRWR end; into_all method label _Q06 code_regex (RP03.SMHC.D3EF) replaceall_matched begin RP03.FRWR.D3EF end; into_all device label FRWR code_regex (Name\s\(\_GPE,\s0x11\)\s\s\//\s\_GPE:\sGeneral\sPurpose\sEvents) remove_matched; into_all device label FRWR insert begin Name (_GPE, 0x11) // _GPE: General Purpose Events end; into method label _DSM parent_label FRWR remove_entry; into device label FRWR insert begin Method (_DSM, 4, NotSerialized)\n {\n Store (Package (0x0E)\n {\n "AAPL,slot-name", "Built In",\n "name", Buffer (0x1E) { "JMicron IEEE 1394a Controller" },\n "model", Buffer (0x1C) { "JMicron FireWire Controller" },\n "device_type", Buffer (0x08) { "FireWire" },\n "fwhub", Buffer (0x04) { 0x00, 0x00, 0x00, 0x00 },\n "fws0", Buffer (0x04) { 0x01, 0x00, 0x00, 0x00 },\n "built-in", Buffer (One) { 0x01 }\n }, Local0)\n DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n Return (Local0)\n }\n end; # Cleanup Warnings into_all method label VGDD code_regex (Return\s\(Zero\)) remove_matched; into_all method label VGDD insert begin Return (Zero) end; into_all all code_regex Wait\s\(F4EV,\s0x0500\) replace_matched begin Wait (F4EV, 0xFFFF) end; into_all all code_regex Wait\s\(\\_SB.F4EV,\s0x0500\) replace_matched begin Wait (\\_SB.F4EV, 0xFFFF) end; into_all method label _CRS parent_label LPT0 code_regex CreateWordField\s\(CRES,\s\\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y1B._DMA,\sDMA0\) replace_matched begin CreateByteField (CRES, \\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y1B._DMA, DMA0) end; into_all method label _CRS parent_label LPT0 code_regex CreateWordField\s\(CRES,\s\\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y24._DMA,\sDMA0\) replace_matched begin CreateByteField (CRES, \\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y24._DMA, DMA0) end; into_all device label PS2M parent_label LPCB code_regex (Name\s\(_ADR,\sZero\)\s\s\/\/\_ADR:\sAddress) remove_matched; into_all device label PS2M parent_label LPCB insert begin Name (_ADR, Zero) // _ADR: Address end; into_all method label _DIS code_regex (Return\s\(0x00\)) remove_matched; into_all method label \HWAK code_regex (Store\s\(\\_SB.PCI0.LPCB.EC0.GBAP\s\(\),\sLocal1\)) remove_matched; into_all method label BCL parent_label \_SB code_regex (Divide\s\(Add\s\(Local3,\s0x7F\),\s0xFF,\sLocal6,\sLocal2\)) remove_matched; into_all method label HDOS code_regex (Store\s\(Local2,\s\Local2\)) remove_matched; into_all method label HDOS insert begin Store (Local2, Local2) end; into_all method label GLEV code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label GLEV insert begin Store (Local0, Local0) end; into_all method label _DOS parent_label PEGP.DGFX code_regex (Store\s\(Local2,\s\Local2\)) remove_matched; into_all method label _DOS parent_label PEGP.DGFX insert begin Store (Local2, Local2) end; into_all method label SFSD parent_type device code_regex (Store\s\(Local2,\s\Local2\)) remove_matched; into_all method label SFSD parent_type device insert begin Store (Local2, Local2) end; into_all method label GFSD parent_type device code_regex (Divide\s\(Add\s\(Local0,\s0x20\),\s0x40,\sLocal2,\sLocal1\)) remove_matched; into_all method label ITLB parent_type device code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label ITLB parent_type device insert begin Store (Local0, Local0) end; into_all method label _Q05 parent_type device code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label _Q05 parent_type device insert begin Store (Local0, Local0) end; into_all method label _Q0A parent_type device code_regex (Store\s\(Local4,\s\Local4\)) remove_matched; into_all method label _Q0A parent_type device insert begin Store (Local4, Local4) end; into_all method label _Q0C parent_type device code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label _Q0C parent_type device insert begin Store (Local0, Local0) end; into_all method label PRIT parent_type device code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label PRIT parent_type device insert begin Store (Local0, Local0) end; into_all method label RPPC parent_type device code_regex (Store\s\(Local2,\s\Local2\)) remove_matched; into_all method label RPPC parent_type device insert begin Store (Local2, Local2) end; into_all method label RPPC parent_type device code_regex (Store\s\(Local5,\s\Local5\)) remove_matched; into_all method label RPPC parent_type device insert begin Store (Local5, Local5) end; into_all method label PPTS code_regex (Store\s\(0x00,\sLocal0\)) remove_matched; into_all method label BTST parent_type scope code_regex (Store\s\(\\_SB.PCI0.LPCB.EC0.BTST\s\(Arg0,\sLocal1\),\sLocal0\)) remove_matched; into_all method label BTST parent_type scope insert begin Store (\_SB.PCI0.LPCB.EC0.BTST (Arg0, Local1), Local0) end; into_all method label BTST parent_type scope code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label BTST parent_type scope insert begin Store (Local0, Local0) end; into_all method label BTST parent_type scope code_regex (Return\s\(DerefOf\s\(Index\s\(NBST,\sArg0\)\)\)) remove_matched; into_all method label BTST parent_type scope insert begin Return (DerefOf (Index (NBST, Arg0))) end; into_all method label LPON parent_type device code_regex (Store\s\(CondRefOf\s\(\\_GPE._L1C,\sLocal0\),\s\Local1\)) remove_matched; into_all method label LPON parent_type device insert begin Store (CondRefOf (\_GPE._L1C, Local0), Local1) end; into_all method label LPON parent_type device code_regex (Store\s\(Local0,\s\Local0\)) remove_matched; into_all method label LPON parent_type device insert begin Store (Local0, Local0) end; into_all method label LPON parent_type device code_regex (Return\s\(Local1\)) remove_matched; into_all method label LPON parent_type device insert begin Return (Local1) end; into_all method label HWAK code_regex (Store\s\(Local1,\sLocal1\)) remove_matched; into_all method label HWAK insert begin Store (Local1, Local1) end; into_all method label INTM parent_type scope code_regex (Store\s\(Local0,\sLocal0\)) remove_matched; into_all method label INTM parent_type scope insert begin Store (Local0, Local0) end; into_all method label ECTI parent_type scope code_regex (Store\s\(Local0,\sLocal0\)) remove_matched; into_all method label ECTI parent_type scope insert begin Store (Local0, Local0) end; into_all method label _CRS parent_label LPT0 code_regex CreateWordField\s\(CRES,\s\\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y1C._DMA,\sDMA0\) replace_matched begin CreateByteField (CRES, \\_SB.PCI0.LPCB.SIO.LPT0._CRS._Y1C._DMA, DMA0) end;