├── .gitignore ├── .maciasl ├── License.md ├── NullPatch.txt ├── Patches.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── README.md ├── audio ├── audio_HDEF-layout12.txt ├── audio_HDEF-layout12a.txt ├── audio_HDEF-layout14.txt ├── audio_HDEF-layout2.txt └── audio_HDEF-layout3.txt ├── battery ├── battery_ASUS-G75vw.txt ├── battery_ASUS-N55SL.txt ├── battery_Acer-3820tg.txt ├── battery_Acer-Aspire-4830T.txt ├── battery_Acer-Aspire-5737z.txt ├── battery_Acer-Aspire-5741g.txt ├── battery_Acer-Aspire-5750g.txt ├── battery_Acer-Aspire-E1-571.txt ├── battery_Acer-S7-391.txt ├── battery_Alienware-m15x.txt ├── battery_Clevo-M860TU.txt ├── battery_Clevo-P15SM.txt ├── battery_Clevo-W170HN.txt ├── battery_Compaq-CQ60.txt ├── battery_Dell-Inspiron-13z.txt ├── battery_Dell-Inspiron-15-7xxx.txt ├── battery_Dell-Inspiron-5548.txt ├── battery_Dell-Studio-1558.txt ├── battery_Dell-Vostro-15xx.txt ├── battery_Dell-XPS-13.txt ├── battery_Dell-XPS-14Z-L412Z.txt ├── battery_Dell-XPS-18.txt ├── battery_Dell-XPS-L502x.txt ├── battery_Fujitsu-Lifebook-A555.txt ├── battery_Gateway-ID49C07u.txt ├── battery_Gigabyte-Aero15V8.txt ├── battery_Gigabyte-P35Xv3.txt ├── battery_Gigabyte-u2442N.txt ├── battery_HP-DM4T-1000.txt ├── battery_HP-DV2-2500.txt ├── battery_HP-DV6-3165sf.txt ├── battery_HP-DV6t-6b00.txt ├── battery_HP-DV7-1120.txt ├── battery_HP-DV7-6xxx.txt ├── battery_HP-DV7-7xxx.txt ├── battery_HP-Elite-X2.txt ├── battery_HP-Envy-14.txt ├── battery_HP-Envy-17t.txt ├── battery_HP-Envy-4.txt ├── battery_HP-Envy-DV6.txt ├── battery_HP-Envy-M4.txt ├── battery_HP-Folio-13-1010es.txt ├── battery_HP-G6-2221ss.txt ├── battery_HP-G62-B13SL.txt ├── battery_HP-Pavilion-n012tx.txt ├── battery_HP-ProBook-4x0s-G1.txt ├── battery_HP-ProBook-Generic.txt ├── battery_HP-Spectre-XT.txt ├── battery_HP-x360.txt ├── battery_LG-N450.txt ├── battery_Lenovo-E430.txt ├── battery_Lenovo-G50-70.txt ├── battery_Lenovo-Ideapad-100.txt ├── battery_Lenovo-Ideapad-Y700.txt ├── battery_Lenovo-L420.txt ├── battery_Lenovo-Miix-720.txt ├── battery_Lenovo-N480.txt ├── battery_Lenovo-Rescuer-ISK.txt ├── battery_Lenovo-T430u.txt ├── battery_Lenovo-T440p.txt ├── battery_Lenovo-ThinkPad-W550s.txt ├── battery_Lenovo-Twist.txt ├── battery_Lenovo-Ux10-Z580.txt ├── battery_Lenovo-V510-15IKB.txt ├── battery_Lenovo-X201.txt ├── battery_Lenovo-X210.txt ├── battery_Lenovo-X220.txt ├── battery_Lenovo-X230i.txt ├── battery_Lenovo-Y50.txt ├── battery_Lenovo-Yoga-13.txt ├── battery_Lenovo-Yoga-900-13ISK.txt ├── battery_Lenovo-Yoga-Pro2.txt ├── battery_Lenovo-Yoga-S1.txt ├── battery_Lenovo-Z50-70.txt ├── battery_Lenovo-y510p.txt ├── battery_Lenovo-y570.txt ├── battery_Lenovo-y580.txt ├── battery_Lenovo-z470-z370.txt ├── battery_MECHREVO-x6TI.txt ├── battery_MSI-CX61-2PC.txt ├── battery_Medion-Akoya-P6630.txt ├── battery_Microxperts-u731ga1.txt ├── battery_Partaker_G3.txt ├── battery_Razer-Blade-2014.txt ├── battery_Razer-Blade-Pro.txt ├── battery_Samsung-NP300E5K-XF3BR.txt ├── battery_Samsung-NP470R5E.txt ├── battery_Samsung-RF411.txt ├── battery_Samsung-Series3-NP300.txt ├── battery_Samsung-r528.txt ├── battery_Samsung_NP730U3E_X04IT.txt ├── battery_Sony-VAIO-S.txt ├── battery_Sony-VAIO-SVE1511.txt ├── battery_Sony-VAIO-SZ1XP.txt ├── battery_Surface-Pro-v1.txt ├── battery_Surface-Pro-v2.txt ├── battery_Surface-Pro-v3.txt ├── battery_Surface-Pro-v4.txt ├── battery_TabletKiosk-i575.txt ├── battery_Thunderobot-911.txt ├── battery_Toshiba-A660-16Z.txt ├── battery_Vizio-Ultrabook-CT14.txt └── battery_WBIN-AirBook.txt ├── graphics ├── graphics_EDID.txt ├── graphics_HD3K_high.txt ├── graphics_HD3K_low.txt ├── graphics_HD4600_yosemite.txt ├── graphics_HD4K_high.txt ├── graphics_HD4K_low.txt ├── graphics_Haswell_0a260006.txt ├── graphics_INI-disable.txt ├── graphics_MEI_ivy.txt ├── graphics_MEI_sandy.txt ├── graphics_PNLF-ACPI100.txt ├── graphics_PNLF-Lenovo-Ux10a.txt ├── graphics_PNLF-Lenovo-Ux10b.txt ├── graphics_PNLF.txt ├── graphics_PNLF_haswell.txt ├── graphics_PNLF_ivy_sandy.txt ├── graphics_PTS_WAK-disable.txt ├── graphics_REG-disable.txt ├── graphics_Rename-B0D3.txt ├── graphics_Rename-GFX0.txt ├── graphics_Rename-PCI0_GFX0.txt ├── graphics_Rename-PCI0_VID.txt ├── graphics_Rename-VID_AGP1.txt ├── graphics_SSDT-disable-cleanup.txt ├── graphics_nvidia_gt520m.txt ├── graphics_nvidia_laptop.txt └── graphics_nvidia_laptop2.txt ├── misc ├── control_AcerFan.txt ├── misc_Haswell-LPC.txt ├── misc_LidPoll.txt ├── misc_Lid_PRW.txt └── misc_Skylake-LPC.txt ├── syntax ├── fix_ADBG.txt ├── fix_FDE.txt ├── fix_FPED.txt ├── fix_HID_pnp.txt ├── fix_IRC.txt ├── fix_MMTB.txt ├── fix_PARSEOP_ZERO.txt ├── fix_PARSEOP_ZERO_agressive.txt ├── fix_PLD.txt ├── fix_PSS.txt ├── fix_TNOT.txt ├── remove_DSM.txt └── rename_DSM.txt ├── system ├── system_ADP1.txt ├── system_HPET.txt ├── system_IAOE.txt ├── system_IMEI.txt ├── system_IRQ.txt ├── system_MCHC.txt ├── system_Mutex.txt ├── system_OSYS.txt ├── system_OSYS_linux.txt ├── system_OSYS_win10.txt ├── system_OSYS_win7.txt ├── system_OSYS_win8.txt ├── system_PNOT.txt ├── system_RTC.txt ├── system_SMBUS.txt ├── system_Shutdown.txt ├── system_Shutdown2.txt ├── system_Shutdown_restart.txt ├── system_WAK1.txt └── system_WAK2.txt ├── usb ├── usb_6-series-id.txt ├── usb_6-series.txt ├── usb_7-series-id.txt ├── usb_7-series-multiplex.txt ├── usb_7-series.txt ├── usb_prw_0x0d_xhc.txt ├── usb_prw_0x0d_xhc_skl.txt ├── usb_prw_0x6d_xhc.txt └── usb_prw_0x6d_xhc_skl.txt └── wifi ├── wifi_AR9285-RP02-PXSX.txt ├── wifi_AR9285-RP02-WLAN.txt └── wifi_AR9285-RP02-WNIC.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | DerivedData/ 3 | Patches.xcodeproj/project.xcworkspace/xcuserdata/ 4 | Patches.xcodeproj/xcuserdata/ 5 | -------------------------------------------------------------------------------- /NullPatch.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: HP Probook 2 | #NullPatch.txt 3 | 4 | # This is not a patch.... -------------------------------------------------------------------------------- /Patches.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## RehabMan's laptop patch repository 2 | 3 | This set of patches can be used in DSDT Editor or (preferably) MaciASL to apply 4 | some common patches to your laptop for running OS X. These patches are common 5 | for Sandy Bridge or Ivy Bridge laptops. 6 | 7 | Many of these patches came from work on the HP ProBook patches and/or work on my 8 | own Intel DH67GD desktop. 9 | 10 | Many of the battery patches were created over time, published as individual posts 11 | by me on tonymacx86.com, and collected here in this repository. 12 | 13 | To add these patches to MaciASL as a repository: 14 | - Run MaciASL 15 | - choose Preferences from the MaciASL menu bar 16 | - select Sources 17 | - click the [+] button 18 | - give it a name (eg. "Laptop Patches") 19 | - type the following URL: http://raw.github.com/RehabMan/Laptop-DSDT-Patch/master 20 | 21 | 22 | ### MaciASL and iasl 23 | 24 | I recommend you use my version of MaciASL: 25 | 26 | https://github.com/RehabMan/OS-X-MaciASL-patchmatic 27 | 28 | And my version of iasl: 29 | 30 | https://github.com/RehabMan/Intel-iasl 31 | 32 | 33 | ### ACPI patching guide 34 | 35 | For detailed information on ACPI patching, read here: 36 | 37 | http://www.tonymacx86.com/el-capitan-laptop-support/152573-guide-patching-laptop-dsdt-ssdts.html 38 | 39 | -------------------------------------------------------------------------------- /audio/audio_HDEF-layout12.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #audio_HDEF-layout12.txt 3 | 4 | # Note: Change your layout ID if you need something different 5 | # Note: "hda-gfx" is not needed with Haswell and should probably be removed 6 | 7 | # Inject Audio info 8 | into method label _DSM parent_label HDEF remove_entry; 9 | into device label HDEF insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "layout-id", Buffer() { 12, 0x00, 0x00, 0x00 },\n 17 | "hda-gfx", Buffer() { "onboard-1" },\n 18 | "PinConfigurations", Buffer() { },\n 19 | //"MaximumBootBeepVolume", 77,\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | into method label _DSM parent_label HDAS remove_entry; 25 | into device label HDAS insert 26 | begin 27 | Method (_DSM, 4, NotSerialized)\n 28 | {\n 29 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 30 | Return (Package()\n 31 | {\n 32 | "layout-id", Buffer() { 12, 0x00, 0x00, 0x00 },\n 33 | "hda-gfx", Buffer() { "onboard-1" },\n 34 | "PinConfigurations", Buffer() { },\n 35 | //"MaximumBootBeepVolume", 77,\n 36 | })\n 37 | }\n 38 | end; 39 | -------------------------------------------------------------------------------- /audio/audio_HDEF-layout12a.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #audio_HDEF-layout12a.txt 3 | 4 | # Note: Change your layout-id if you need something different 5 | # 6 | # Also, this version of the patch allows you to set a few more 7 | # properties than the normal layout12 patch does. 8 | # 9 | # You will need to research to find the correct values for your 10 | # patched AppleHDA/codec 11 | 12 | # Inject Audio info 13 | into method label _DSM parent_label HDEF remove_entry; 14 | into device label HDEF insert 15 | begin 16 | Method (_DSM, 4, NotSerialized)\n 17 | {\n 18 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 19 | Return (Package()\n 20 | {\n 21 | "AAPL,slot-name", Buffer() { "Built in" },\n 22 | "device-id", Buffer() { 0x6E, 0x50, 0xF1, 0x14 },\n 23 | "layout-id", Buffer() { 12, 0x00, 0x00, 0x00 },\n 24 | "codec-id", Buffer() { 0x3E, 0x3A, 0xEC, 0x10 },\n 25 | "model", Buffer() { "Conexant 20672 SmartAudio HD" },\n 26 | "name", Buffer() { "Conexant Cx20590" },\n 27 | "device_type", Buffer() { "Audio Controller" },\n 28 | "built-in", Buffer() { 0x00 },\n 29 | "PinConfigurations", Buffer() { },\n 30 | "hda-gfx", Buffer() { "onboard-1" },\n 31 | //"MaximumBootBeepVolume", 77,\n 32 | })\n 33 | }\n 34 | end; 35 | 36 | into method label _DSM parent_label HDAS remove_entry; 37 | into device label HDAS insert 38 | begin 39 | Method (_DSM, 4, NotSerialized)\n 40 | {\n 41 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 42 | Return (Package()\n 43 | {\n 44 | "AAPL,slot-name", Buffer() { "Built in" },\n 45 | "device-id", Buffer() { 0x6E, 0x50, 0xF1, 0x14 },\n 46 | "layout-id", Buffer() { 12, 0x00, 0x00, 0x00 },\n 47 | "codec-id", Buffer() { 0x3E, 0x3A, 0xEC, 0x10 },\n 48 | "model", Buffer() { "Conexant 20672 SmartAudio HD" },\n 49 | "name", Buffer() { "Conexant Cx20590" },\n 50 | "device_type", Buffer() { "Audio Controller" },\n 51 | "built-in", Buffer() { 0x00 },\n 52 | "PinConfigurations", Buffer() { },\n 53 | "hda-gfx", Buffer() { "onboard-1" },\n 54 | //"MaximumBootBeepVolume", 77,\n 55 | })\n 56 | }\n 57 | end; 58 | -------------------------------------------------------------------------------- /audio/audio_HDEF-layout14.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #audio_HDEF-layout14.txt 3 | 4 | # Note: Change your layout ID if you need something different 5 | # Note: "hda-gfx" is not needed with Haswell and should probably be removed 6 | 7 | # Inject Audio info 8 | into method label _DSM parent_label HDEF remove_entry; 9 | into device label HDEF insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "layout-id", Buffer() { 14, 0x00, 0x00, 0x00 },\n 17 | "hda-gfx", Buffer() { "onboard-1" },\n 18 | "PinConfigurations", Buffer() { },\n 19 | //"MaximumBootBeepVolume", 77,\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | into method label _DSM parent_label HDAS remove_entry; 25 | into device label HDAS insert 26 | begin 27 | Method (_DSM, 4, NotSerialized)\n 28 | {\n 29 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 30 | Return (Package()\n 31 | {\n 32 | "layout-id", Buffer() { 14, 0x00, 0x00, 0x00 },\n 33 | "hda-gfx", Buffer() { "onboard-1" },\n 34 | "PinConfigurations", Buffer() { },\n 35 | //"MaximumBootBeepVolume", 77,\n 36 | })\n 37 | }\n 38 | end; 39 | -------------------------------------------------------------------------------- /audio/audio_HDEF-layout2.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #audio_HDEF-layout2.txt 3 | 4 | # Note: Change your layout ID if you need something different 5 | # Note: "hda-gfx" is not needed with Haswell and should probably be removed 6 | 7 | # Inject Audio info 8 | into method label _DSM parent_label HDEF remove_entry; 9 | into device label HDEF insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "layout-id", Buffer() { 2, 0x00, 0x00, 0x00 },\n 17 | "hda-gfx", Buffer() { "onboard-1" },\n 18 | "PinConfigurations", Buffer() { },\n 19 | //"MaximumBootBeepVolume", 77,\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | into method label _DSM parent_label HDAS remove_entry; 25 | into device label HDAS insert 26 | begin 27 | Method (_DSM, 4, NotSerialized)\n 28 | {\n 29 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 30 | Return (Package()\n 31 | {\n 32 | "layout-id", Buffer() { 2, 0x00, 0x00, 0x00 },\n 33 | "hda-gfx", Buffer() { "onboard-1" },\n 34 | "PinConfigurations", Buffer() { },\n 35 | //"MaximumBootBeepVolume", 77,\n 36 | })\n 37 | }\n 38 | end; 39 | -------------------------------------------------------------------------------- /audio/audio_HDEF-layout3.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #audio_HDEF-layout3.txt 3 | 4 | # Note: Change your layout ID if you need something different 5 | # Note: "hda-gfx" is not needed with Haswell and should probably be removed 6 | 7 | # Inject Audio info 8 | into method label _DSM parent_label HDEF remove_entry; 9 | into device label HDEF insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "layout-id", Buffer() { 3, 0x00, 0x00, 0x00 },\n 17 | "hda-gfx", Buffer() { "onboard-1" },\n 18 | "PinConfigurations", Buffer() { },\n 19 | //"MaximumBootBeepVolume", 77,\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | into method label _DSM parent_label HDAS remove_entry; 25 | into device label HDAS insert 26 | begin 27 | Method (_DSM, 4, NotSerialized)\n 28 | {\n 29 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 30 | Return (Package()\n 31 | {\n 32 | "layout-id", Buffer() { 3, 0x00, 0x00, 0x00 },\n 33 | "hda-gfx", Buffer() { "onboard-1" },\n 34 | "PinConfigurations", Buffer() { },\n 35 | //"MaximumBootBeepVolume", 77,\n 36 | })\n 37 | }\n 38 | end; 39 | -------------------------------------------------------------------------------- /battery/battery_Acer-3820tg.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Acer-3820tg.txt 3 | 4 | # created by pontyl 2013-12-08 5 | # bugs/typos fixed by RehabMan 2015-04-04 6 | 7 | # works for: 8 | # Acer 3820tg 9 | # Acer 4738z (per dhnguyen92) 10 | # Acer Aspire 4741G-382G50Mnsk/C002 11 | # Acer Aspire V Nitro VN7-591G-744N (per ylums) 12 | # Acer Aspire V Nitro VN7-791G-573T (per dyland) 13 | 14 | # requires mutex fix too (2x to work around MaciASL bug...) 15 | into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 16 | into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 17 | 18 | into method label B1B2 remove_entry; 19 | into definitionblock code_regex . insert 20 | begin 21 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 22 | end; 23 | 24 | # utility methods to read/write buffers from/to EC 25 | into method label RE1B remove_entry; 26 | into method label RECB remove_entry; 27 | into scope label _SB.PCI0.LPCB.EC0 insert 28 | begin 29 | Method (RE1B, 1, NotSerialized)\n 30 | {\n 31 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 32 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 33 | Return(BYTE)\n 34 | }\n 35 | Method (RECB, 2, Serialized)\n 36 | {\n 37 | ShiftRight(Arg1, 3, Arg1)\n 38 | Name(TEMP, Buffer(Arg1) { })\n 39 | Add(Arg0, Arg1, Arg1)\n 40 | Store(0, Local0)\n 41 | While (LLess(Arg0, Arg1))\n 42 | {\n 43 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 44 | Increment(Arg0)\n 45 | Increment(Local0)\n 46 | }\n 47 | Return(TEMP)\n 48 | }\n 49 | end; 50 | 51 | # 16-bit registers 52 | into scope label _SB.AMWA code_regex SDTA,\s+16 replace_matched begin DTA0,8,DTA1,8 end; 53 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSDC,\s+16 replace_matched begin SDC0,8,SDC1,8 end; 54 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSDV,\s+16 replace_matched begin SDV0,8,SDV1,8 end; 55 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSSN,\s+16 replace_matched begin SSN0,8,SSN1,8 end; 56 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSRC,\s+16 replace_matched begin SRC0,8,SRC1,8 end; 57 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSFC,\s+16 replace_matched begin SFC0,8,SFC1,8 end; 58 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSAC,\s+16 replace_matched begin SAC0,8,SAC1,8 end; 59 | into scope label _SB.PCI0.LPCB.EC0 code_regex BSVO,\s+16 replace_matched begin SVO0,8,SVO1,8 end; 60 | 61 | # fix 16-bit methods 62 | into method label WMCE code_regex \(SDTA, replaceall_matched begin (B1B2(DTA0,DTA1), end; 63 | into method label GBIF code_regex \(BSDC, replaceall_matched begin (B1B2(SDC0,SDC1), end; 64 | into method label GBIF code_regex \(BSDV, replaceall_matched begin (B1B2(SDV0,SDV1), end; 65 | into method label GBIF code_regex \(BSSN, replaceall_matched begin (B1B2(SSN0,SSN1), end; 66 | into method label GBST code_regex \(BSRC, replaceall_matched begin (B1B2(SRC0,SRC1), end; 67 | into method label GBST code_regex \(BSFC, replaceall_matched begin (B1B2(SFC0,SFC1), end; 68 | into method label GBIF code_regex \(BSFC, replaceall_matched begin (B1B2(SFC0,SFC1), end; 69 | into method label GBST code_regex \(BSAC, replaceall_matched begin (B1B2(SAC0,SAC1), end; 70 | into method label GBST code_regex \(BSVO, replaceall_matched begin (B1B2(SVO0,SVO1), end; 71 | 72 | # 128-bit 73 | into scope label _SB.PCI0.LPCB.EC0 code_regex (BSCH,)\s+(128) replace_matched begin SCHX,%2,//%1%2 end; 74 | into scope label _SB.PCI0.LPCB.EC0 insert begin Method (RSCH, 0, Serialized) { Return(RECB(0xE0,128)) } end; 75 | into method label GBIF code_regex \(BSCH, replaceall_matched begin (RSCH(), end; 76 | 77 | into scope label _SB.PCI0.LPCB.EC0 code_regex (BSDN,)\s+(128) replace_matched begin SDNX,%2,//%1%2 end; 78 | into scope label _SB.PCI0.LPCB.EC0 insert begin Method (RSDN, 0, Serialized) { Return(RECB(0xE0,128)) } end; 79 | into method label GBIF code_regex \(BSDN, replaceall_matched begin (RSDN(), end; 80 | 81 | into scope label _SB.PCI0.LPCB.EC0 code_regex (BSMN,)\s+(128) replace_matched begin SMNX,%2,//%1%2 end; 82 | into scope label _SB.PCI0.LPCB.EC0 insert begin Method (RSMN, 0, Serialized) { Return(RECB(0xE0,128)) } end; 83 | into method label GBIF code_regex \(BSMN, replaceall_matched begin (RSMN(), end; 84 | 85 | -------------------------------------------------------------------------------- /battery/battery_Acer-Aspire-4830T.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Acer-Aspire-4830T.txt 3 | 4 | # created by RehabMan 9/13/2013 5 | # created originally for GoobyPls 6 | 7 | # works for: 8 | # Acer Aspire 5750g 9 | # Acer Aspire 3830tg (per artar94) 10 | # Acer 4830T 11 | # Packard Bell Easynote TS44hr-035UK 12 | # Packard Bell TS11HR (per xapai1988) 13 | 14 | into method label B1B2 remove_entry; 15 | into definitionblock code_regex . insert 16 | begin 17 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 18 | end; 19 | 20 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 21 | 22 | # fan EC (not really necessary but might be handy for fan access) 23 | into device label EC0 code_regex ENIB,\s+16 replace_matched begin ENI0,8,ENI1,8 end; 24 | 25 | # battery EC 26 | into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8 end; 27 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin SN00,8,SN01,8 end; 28 | into device label EC0 code_regex BPV0,\s+16 replace_matched begin PV00,8,PV01,8 end; 29 | into device label EC0 code_regex BDV0,\s+16 replace_matched begin DV00,8,DV01,8 end; 30 | into device label EC0 code_regex BDC0,\s+16 replace_matched begin DC00,8,DC01,8 end; 31 | into device label EC0 code_regex BFC0,\s+16 replace_matched begin FC00,8,FC01,8 end; 32 | into device label EC0 code_regex BAC0,\s+16 replace_matched begin AC00,8,AC01,8 end; 33 | into device label EC0 code_regex BPC0,\s+16 replace_matched begin PC00,8,PC01,8 end; 34 | into device label EC0 code_regex BCG0,\s+16 replace_matched begin CG00,8,CG01,8 end; 35 | into device label EC0 code_regex BSSB,\s+16 replace_matched begin SSB0,8,SSB1,8 end; 36 | into device label EC0 code_regex BCV1,\s+16 replace_matched begin CV10,8,CV11,8 end; 37 | into device label EC0 code_regex BCV2,\s+16 replace_matched begin CV20,8,CV21,8 end; 38 | into device label EC0 code_regex BCV3,\s+16 replace_matched begin CV30,8,CV31,8 end; 39 | into device label EC0 code_regex BCV4,\s+16 replace_matched begin CV40,8,CV41,8 end; 40 | into device label EC0 code_regex BMD0,\s+16 replace_matched begin MD00,8,MD01,8 end; 41 | into device label EC0 code_regex BACV,\s+16 replace_matched begin ACV0,8,ACV1,8 end; 42 | 43 | # fan 16-bit 44 | into method label FANG code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched 45 | begin 46 | Store(Arg0, ENI0) Store(ShiftRight(Arg0, 8), ENI1) 47 | end; 48 | 49 | into method label FANW code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched 50 | begin 51 | Store(Arg0, ENI0) Store(ShiftRight(Arg0, 8), ENI1) 52 | end; 53 | 54 | # _BIF 16-bit 55 | into method label _BIF code_regex \(\^\^EC0\.BSN0, replaceall_matched begin (B1B2(^^EC0.SN00,^^EC0.SN01), end; 56 | into method label _BIF code_regex Store\s+\(\^\^EC0\.BDC0, replaceall_matched 57 | begin 58 | Store(^^EC0.DC00, Local7)\n 59 | Sleep(0x32)\n 60 | Store(B1B2(Local7,^^EC0.DC01), 61 | end; 62 | 63 | into method label _BIF code_regex Store\s+\(\^\^EC0\.BFC0, replaceall_matched 64 | begin 65 | Store(^^EC0.FC00, Local7)\n 66 | Sleep(0x32)\n 67 | Store(B1B2(Local7,^^EC0.FC01), 68 | end; 69 | 70 | into method label _BIF code_regex Store\s+\(\^\^EC0\.BDV0, replaceall_matched 71 | begin 72 | Store(^^EC0.DV00, Local7)\n 73 | Sleep(0x32)\n 74 | Store(B1B2(Local7,^^EC0.DV01), 75 | end; 76 | 77 | # _BST 16-bit 78 | 79 | into method label _BST code_regex Store\s+\(\^\^EC0\.BPV0, replaceall_matched 80 | begin 81 | Store(^^EC0.PV00, Local7)\n 82 | Sleep(0x32)\n 83 | Store(B1B2(Local7,^^EC0.PV01), 84 | end; 85 | 86 | into method label _BST code_regex Store\s+\(\^\^EC0\.BFC0, replaceall_matched 87 | begin 88 | Store(^^EC0.FC00, Local7)\n 89 | Sleep(0x32)\n 90 | Store(B1B2(Local7,^^EC0.FC01), 91 | end; 92 | 93 | into method label _BST code_regex Store\s+\(\^\^EC0\.BAC0, replaceall_matched 94 | begin 95 | Store(^^EC0.AC00, Local7)\n 96 | Sleep(0x32)\n 97 | Store(B1B2(Local7,^^EC0.AC01), 98 | end; 99 | 100 | -------------------------------------------------------------------------------- /battery/battery_Acer-Aspire-5750g.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Acer-Aspire-5750g.txt 3 | 4 | # created originally for GoobyPls 5 | # created by RehabMan 9/13/2013 6 | 7 | # works for: 8 | # Acer Aspire 5750g 9 | # Acer Aspire 7750G (per TruckerMK) 10 | 11 | into method label B1B2 remove_entry; 12 | into definitionblock code_regex . insert 13 | begin 14 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 15 | end; 16 | 17 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 18 | 19 | # fan EC (not really necessary but might be handy for fan access) 20 | into device label EC0 code_regex ENIB,\s+16 replace_matched begin ENI0,8,ENI1,8 end; 21 | 22 | # battery EC 23 | into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8 end; 24 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin SN00,8,SN01,8 end; 25 | into device label EC0 code_regex BPV0,\s+16 replace_matched begin PV00,8,PV01,8 end; 26 | into device label EC0 code_regex BDV0,\s+16 replace_matched begin DV00,8,DV01,8 end; 27 | into device label EC0 code_regex BDC0,\s+16 replace_matched begin DC00,8,DC01,8 end; 28 | into device label EC0 code_regex BFC0,\s+16 replace_matched begin FC00,8,FC01,8 end; 29 | into device label EC0 code_regex BAC0,\s+16 replace_matched begin AC00,8,AC01,8 end; 30 | into device label EC0 code_regex BPC0,\s+16 replace_matched begin PC00,8,PC01,8 end; 31 | into device label EC0 code_regex BCG0,\s+16 replace_matched begin CG00,8,CG01,8 end; 32 | into device label EC0 code_regex BSSB,\s+16 replace_matched begin SSB0,8,SSB1,8 end; 33 | into device label EC0 code_regex BCV1,\s+16 replace_matched begin CV10,8,CV11,8 end; 34 | into device label EC0 code_regex BCV2,\s+16 replace_matched begin CV20,8,CV21,8 end; 35 | into device label EC0 code_regex BCV3,\s+16 replace_matched begin CV30,8,CV31,8 end; 36 | into device label EC0 code_regex BCV4,\s+16 replace_matched begin CV40,8,CV41,8 end; 37 | into device label EC0 code_regex BMD0,\s+16 replace_matched begin MD00,8,MD01,8 end; 38 | into device label EC0 code_regex BACV,\s+16 replace_matched begin ACV0,8,ACV1,8 end; 39 | 40 | # fan 16-bit 41 | into method label FANG code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched 42 | begin 43 | Store(Arg0, ENI0) Store(ShiftRight(Arg0, 8), ENI1) 44 | end; 45 | 46 | into method label FANW code_regex Store\s+\(Arg0,\s+ENIB\) replace_matched 47 | begin 48 | Store(Arg0, ENI0) Store(ShiftRight(Arg0, 8), ENI1) 49 | end; 50 | 51 | # _BIF 16-bit 52 | into method label _BIF code_regex \(\^\^EC0\.BSN0, replaceall_matched begin (B1B2(^^EC0.SN00,^^EC0.SN01), end; 53 | into method label _BIF code_regex \(\^\^EC0\.BDC0, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end; 54 | into method label _BIF code_regex \(\^\^EC0\.BFC0, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end; 55 | into method label _BIF code_regex \(\^\^EC0\.BDV0, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end; 56 | 57 | # _BST 16-bit 58 | into method label _BST code_regex \(\^\^EC0\.BPV0, replaceall_matched begin (B1B2(^^EC0.PV00,^^EC0.PV01), end; 59 | into method label _BST code_regex \(\^\^EC0\.BFC0, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end; 60 | into method label _BST code_regex \(\^\^EC0\.BAC0, replaceall_matched begin (B1B2(^^EC0.AC00,^^EC0.AC01), end; 61 | 62 | -------------------------------------------------------------------------------- /battery/battery_Acer-Aspire-E1-571.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Acer-Aspire-E1-571.txt 3 | 4 | # initial work by ayyoouubb 2014-02-26, 5 | # finished/corrected by RehabMan 2014-02-26 6 | 7 | # works for: 8 | # Acer Aspire E1-571 9 | # Acer Aspire V5-171-6675 (per shinzon) 10 | # Gateway NE56R49U 11 | # Dell Precision M3800 12 | # Acer Travelmate T253M (per Simmy) 13 | # Acer Aspire V3-571G (per mpckid) 14 | # Acer Travelmate P278-M-586U (per doc32) 15 | 16 | # create B1B2 Method 17 | into method label B1B2 remove_entry; 18 | into definitionblock code_regex . insert 19 | begin 20 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 21 | end; 22 | 23 | # utility methods to read/write buffers from/to EC by RehabMan 24 | into method label RE1B parent_label EC0 remove_entry; 25 | into method label RECB parent_label EC0 remove_entry; 26 | into device label EC0 insert 27 | begin 28 | Method (RE1B, 1, NotSerialized)\n 29 | {\n 30 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 31 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 32 | Return(BYTE)\n 33 | }\n 34 | Method (RECB, 2, Serialized)\n 35 | {\n 36 | ShiftRight(Arg1, 3, Arg1)\n 37 | Name(TEMP, Buffer(Arg1) { })\n 38 | Add(Arg0, Arg1, Arg1)\n 39 | Store(0, Local0)\n 40 | While (LLess(Arg0, Arg1))\n 41 | {\n 42 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 43 | Increment(Arg0)\n 44 | Increment(Local0)\n 45 | }\n 46 | Return(TEMP)\n 47 | }\n 48 | end; 49 | into method label WE1B parent_label EC0 remove_entry; 50 | into method label WECB parent_label EC0 remove_entry; 51 | into device label EC0 insert 52 | begin 53 | Method (WE1B, 2, NotSerialized)\n 54 | {\n 55 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 56 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 57 | Store(Arg1, BYTE)\n 58 | }\n 59 | Method (WECB, 3, Serialized)\n 60 | {\n 61 | ShiftRight(Arg1, 3, Arg1)\n 62 | Name(TEMP, Buffer(Arg1) { })\n 63 | Store(Arg2, TEMP)\n 64 | Add(Arg0, Arg1, Arg1)\n 65 | Store(0, Local0)\n 66 | While (LLess(Arg0, Arg1))\n 67 | {\n 68 | WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n 69 | Increment(Arg0)\n 70 | Increment(Local0)\n 71 | }\n 72 | }\n 73 | end; 74 | 75 | # 16-bit register fixes (ERIB) 76 | into device label EC0 code_regex ERIB,\s+16, replace_matched begin IB00,8,IB01,8, end; 77 | into method label FANG code_regex \(ERIB, replaceall_matched begin (B1B2(IB00,IB01), end; 78 | into method label FANW code_regex \(ERIB, replaceall_matched begin (B1B2(IB00,IB01), end; 79 | into method label FANG code_regex Store\s+\((.*),\s+ERIB\) replaceall_matched 80 | begin 81 | Store(%1,IB00) 82 | Store(ShiftRight(%1,8),IB01) 83 | end; 84 | into method label FANW code_regex Store\s+\((.*),\s+ERIB\) replaceall_matched 85 | begin 86 | Store(%1,IB00) 87 | Store(ShiftRight(%1,8),IB01) 88 | end; 89 | 90 | # 256-bit register fixes (SMD0) 91 | into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end; 92 | into method label CFUN code_regex \(SMD0 replaceall_matched begin (RECB(0x64,256) end; 93 | into method label CFUN code_regex Store\s+\((.*),\s+SMD0\) replaceall_matched begin WECB(0x64,256,%1) end; 94 | -------------------------------------------------------------------------------- /battery/battery_Acer-S7-391.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Acer-S7-391.txt 3 | 4 | # created by dadaist 2013-11-14 5 | 6 | # works for: 7 | # Acer S7-391 8 | # Acer Iconia w700 (per polygaryd) 9 | 10 | into method label B1B2 remove_entry; 11 | into definitionblock code_regex . insert 12 | begin 13 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 14 | end; 15 | 16 | # 16-bit registers 17 | into device label EC0 code_regex BVLT,\s+16, replace_matched begin VLT0,8,VLT1,8, end; 18 | into device label EC0 code_regex BRMC,\s+16, replace_matched begin RMC0,8,RMC1,8, end; 19 | into device label EC0 code_regex BFCC,\s+16, replace_matched begin FCC0,8,FCC1,8, end; 20 | into device label EC0 code_regex BDSC,\s+16, replace_matched begin DSC0,8,DSC1,8, end; 21 | into device label EC0 code_regex BDSV,\s+16, replace_matched begin DSV0,8,DSV1,8, end; 22 | into device label EC0 code_regex BPRA,\s+16, replace_matched begin PRA0,8,PRA1,8, end; 23 | 24 | # fix 16-bit methods 25 | into method label _BST code_regex \(\^\^EC0\.BVLT, replaceall_matched begin (B1B2(^^EC0.VLT0,^^EC0.VLT1), end; 26 | into method label _BST code_regex \(\^\^EC0\.BRMC, replaceall_matched begin (B1B2(^^EC0.RMC0,^^EC0.RMC1), end; 27 | into method label _BST code_regex \(\^\^EC0\.BFCC, replaceall_matched begin (B1B2(^^EC0.FCC0,^^EC0.FCC1), end; 28 | into method label _BIF code_regex \(\^\^EC0\.BFCC, replaceall_matched begin (B1B2(^^EC0.FCC0,^^EC0.FCC1), end; 29 | into method label _BIF code_regex \(\^\^EC0\.BDSC, replaceall_matched begin (B1B2(^^EC0.DSC0,^^EC0.DSC1), end; 30 | into method label _BIF code_regex \(\^\^EC0\.BDSV, replaceall_matched begin (B1B2(^^EC0.DSV0,^^EC0.DSV1), end; 31 | into method label _BST code_regex \(\^\^EC0\.BPRA, replaceall_matched begin (B1B2(^^EC0.PRA0,^^EC0.PRA1), end; 32 | 33 | # added for Acer Iconia w700 34 | into device label EC0 code_regex ERIB,\s+16, replace_matched begin ERI0,8,ERI1,8, end; 35 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 36 | begin 37 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 38 | end; 39 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 40 | begin 41 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 42 | end; 43 | 44 | # utility methods to read/write buffers from/to EC 45 | into method label RE1B parent_label EC0 remove_entry; 46 | into method label RECB parent_label EC0 remove_entry; 47 | into device label EC0 insert 48 | begin 49 | Method (RE1B, 1, NotSerialized)\n 50 | {\n 51 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 52 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 53 | Return(BYTE)\n 54 | }\n 55 | Method (RECB, 2, Serialized)\n 56 | // Arg0 - offset in bytes from zero-based EC\n 57 | // Arg1 - size of buffer in bits\n 58 | {\n 59 | ShiftRight(Arg1, 3, Arg1)\n 60 | Name(TEMP, Buffer(Arg1) { })\n 61 | Add(Arg0, Arg1, Arg1)\n 62 | Store(0, Local0)\n 63 | While (LLess(Arg0, Arg1))\n 64 | {\n 65 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 66 | Increment(Arg0)\n 67 | Increment(Local0)\n 68 | }\n 69 | Return(TEMP)\n 70 | }\n 71 | end; 72 | into method label WE1B parent_label EC0 remove_entry; 73 | into method label WECB parent_label EC0 remove_entry; 74 | into device label EC0 insert 75 | begin 76 | Method (WE1B, 2, NotSerialized)\n 77 | {\n 78 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 79 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 80 | Store(Arg1, BYTE)\n 81 | }\n 82 | Method (WECB, 3, Serialized)\n 83 | // Arg0 - offset in bytes from zero-based EC\n 84 | // Arg1 - size of buffer in bits\n 85 | // Arg2 - value to write\n 86 | {\n 87 | ShiftRight(Arg1, 3, Arg1)\n 88 | Name(TEMP, Buffer(Arg1) { })\n 89 | Store(Arg2, TEMP)\n 90 | Add(Arg0, Arg1, Arg1)\n 91 | Store(0, Local0)\n 92 | While (LLess(Arg0, Arg1))\n 93 | {\n 94 | WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n 95 | Increment(Arg0)\n 96 | Increment(Local0)\n 97 | }\n 98 | }\n 99 | end; 100 | 101 | into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end; 102 | into method label CFUN code_regex Store\s+\(Zero,\s+SMD0\) replaceall_matched begin WECB(0x96,256,Zero) end; 103 | into method label CFUN code_regex \(SMD0, replaceall_matched begin (RECB(0x94,256), end; 104 | -------------------------------------------------------------------------------- /battery/battery_Clevo-P15SM.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Clevo-P15SM.txt 3 | 4 | # created by RehabMan 2014-07-16 5 | 6 | # works for: 7 | # Clevo P15SM 8 | # Clevo P150SM 9 | # Clevo W740SU 10 | 11 | # Use this patch if your _BST method returns invalid data when discharging. 12 | 13 | into method label UPBS code_regex And.*Local1.*0x8000.*Local7.*\n.*If.*LEqual.*Local7.*\n.*\{.*\n.*Store.*0xFFFFFFFF.*Local1.*\n.*\}\n remove_matched; 14 | 15 | -------------------------------------------------------------------------------- /battery/battery_Clevo-W170HN.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Clevo-W170HN.txt 3 | 4 | # created by hitman478 2015-03-05 5 | 6 | # works for: 7 | # Clevo W170HN (Schenker XMG a702) 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | into method label B1B4 remove_entry; 15 | into definitionblock code_regex . insert 16 | begin 17 | Method (B1B4, 4, NotSerialized)\n 18 | {\n 19 | Store(Arg3, Local0)\n 20 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 21 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 22 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 23 | Return(Local0)\n 24 | }\n 25 | end; 26 | 27 | 28 | into device label EC code_regex PSV,\s+16, replace_matched begin SV0,8,SV1,8, end; 29 | into method label _PSV parent_label TZ0 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.PSV replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.SV0,\\_SB.PCI0.LPCB.EC.SV1) end; 30 | 31 | into device label EC code_regex TMP,\s+16, replace_matched begin MP0,8,MP1,8, end; 32 | into method label _TMP parent_label TZ0 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.TMP replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.MP0,\\_SB.PCI0.LPCB.EC.MP1) end; 33 | 34 | into device label EC code_regex BDC0,\s+32 replace_matched begin DC0,8,DC1,8,DC2,8,DC3,8 end; 35 | into method label UPBI code_regex \(BDC0, replaceall_matched begin (B1B4(DC0,DC1,DC2,DC3), end; 36 | into method label WMBB code_regex \(\^\^PCI0\.LPCB\.EC\.BDC0, replaceall_matched begin (B1B4(^^PCI0.LPCB.EC.DC0,^^PCI0.LPCB.EC.DC1,^^PCI0.LPCB.EC.DC2,^^PCI0.LPCB.EC.DC3), end; 37 | 38 | into device label EC code_regex BFC0,\s+32 replace_matched begin FC0,8,FC1,8,FC2,8,FC3,8 end; 39 | into method label UPBI code_regex \(BFC0, replaceall_matched begin (B1B4(FC0,FC1,FC2,FC3), end; 40 | into method label WMBB code_regex \(\^\^PCI0\.LPCB\.EC\.BFC0, replaceall_matched begin (B1B4(^^PCI0.LPCB.EC.FC0,^^PCI0.LPCB.EC.FC1,^^PCI0.LPCB.EC.FC2,^^PCI0.LPCB.EC.FC3), end; 41 | 42 | into device label EC code_regex BDV0,\s+32 replace_matched begin DV0,8,DV1,8,DV2,8,DV3,8 end; 43 | into method label UPBI code_regex \(BDV0, replaceall_matched begin (B1B4(DV0,DV1,DV2,DV3), end; 44 | 45 | into device label EC code_regex BST0,\s+32 replace_matched begin ST0,8,ST1,8,ST2,8,ST3,8 end; 46 | into method label UPBS code_regex \(BST0, replaceall_matched begin (B1B4(ST0,ST1,ST2,ST3), end; 47 | 48 | into device label EC code_regex BPR0,\s+32 replace_matched begin PR0,8,PR1,8,PR2,8,PR3,8 end; 49 | into method label UPBS code_regex \(BPR0, replaceall_matched begin (B1B4(PR0,PR1,PR2,PR3), end; 50 | 51 | into device label EC code_regex BRC0,\s+32 replace_matched begin RC0,8,RC1,8,RC2,8,RC3,8 end; 52 | into method label UPBS code_regex \(BRC0, replaceall_matched begin (B1B4(RC0,RC1,RC2,RC3), end; 53 | 54 | into device label EC code_regex BPV0,\s+32 replace_matched begin PV0,8,PV1,8,PV2,8,PV3,8 end; 55 | into method label UPBS code_regex \(BPV0, replaceall_matched begin (B1B4(PV0,PV1,PV2,PV3), end; 56 | 57 | into device label EC code_regex BCW0,\s+32 replace_matched begin CW0,8,CW1,8,CW2,8,CW3,8 end; 58 | into method label UPBI code_regex \(BCW0, replaceall_matched begin (B1B4(CW0,CW1,CW2,CW3), end; 59 | 60 | into device label EC code_regex BCL0,\s+32 replace_matched begin CL0,8,CL1,8,CL2,8,CL3,8 end; 61 | into method label UPBI code_regex \(BCL0, replaceall_matched begin (B1B4(CL0,CL1,CL2,CL3), end; 62 | 63 | -------------------------------------------------------------------------------- /battery/battery_Dell-Inspiron-13z.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-Inspiron-13z.txt 3 | 4 | # created by lilryu 2014-09-20 5 | 6 | # works for: 7 | # Dell Inspiron 13z i13Z-3636sLV 8 | # Dell Vostro 3750, per 459below 9 | # Dell Inspiron 17 (N7110), per scififan68 10 | # Dell Inspiron 17r (per conath) 11 | # Dell Insprion 7720 (per gabberZ) 12 | 13 | into method label B1B2 remove_entry; 14 | into definitionblock code_regex . insert 15 | begin 16 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 17 | end; 18 | 19 | # 16-bit registers 20 | into device label EC0 code_regex CAP0,\s+16 replace_matched begin DAP0,8,DAP1,8 end; 21 | into device label EC0 code_regex VOT0,\s+16 replace_matched begin WOT0,8,WOT1,8 end; 22 | into device label EC0 code_regex CRT0,\s+16 replace_matched begin DRT0,8,DRT1,8 end; 23 | into device label EC0 code_regex FCP0,\s+16 replace_matched begin GCP0,8,GCP1,8 end; 24 | into device label EC0 code_regex DCP0,\s+16 replace_matched begin ECP0,8,ECP1,8 end; 25 | into device label EC0 code_regex DVT0,\s+16 replace_matched begin EVT0,8,EVT1,8 end; 26 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin CSN0,8,CSN1,8 end; 27 | 28 | # fix 16-bit methods 29 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CAP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.DAP0,^^PCI0.LPCB.EC0.DAP1), end; 30 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.VOT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.WOT0,^^PCI0.LPCB.EC0.WOT1), end; 31 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CRT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.DRT0,^^PCI0.LPCB.EC0.DRT1), end; 32 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.FCP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.GCP0,^^PCI0.LPCB.EC0.GCP1), end; 33 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DCP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ECP0,^^PCI0.LPCB.EC0.ECP1), end; 34 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DVT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.EVT0,^^PCI0.LPCB.EC0.EVT1), end; 35 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BSN0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.CSN0,^^PCI0.LPCB.EC0.CSN1), end; 36 | 37 | -------------------------------------------------------------------------------- /battery/battery_Dell-Inspiron-15-7xxx.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-Inspiron-15-7xxx.txt 3 | 4 | # created by lisai9093, 2015-04-04 5 | # modified by RehabMan, 2015-12-12 to add SOST fix 6 | 7 | # works for: 8 | # Dell Inspiron 15 7000 Series (late 2014) 9 | # Dell Inspiron 14 7000 Series (14-7447 confirmed, courtesy isnowbee) 10 | # Dell Latitude E7440 (per MBTallan) 11 | 12 | # fix SOST _OSI check 13 | into method label SOST code_regex _OSI\s+\(WIN7\) replaceall_matched begin LOr(_OSI(WIN7),_OSI("Darwin")) end; 14 | # "OS Check Fix (Windows 7)" 15 | into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2009\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2009"))) end; 16 | 17 | into method label B1B2 remove_entry; 18 | into definitionblock code_regex . insert 19 | begin 20 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 21 | end; 22 | 23 | # 16-bit registers 24 | into device label EC code_regex CAP0,\s+16 replace_matched begin DAP0,8,DAP1,8 end; 25 | into device label EC code_regex VOT0,\s+16 replace_matched begin WOT0,8,WOT1,8 end; 26 | into device label EC code_regex CRT0,\s+16 replace_matched begin DRT0,8,DRT1,8 end; 27 | into device label EC code_regex FCP0,\s+16 replace_matched begin GCP0,8,GCP1,8 end; 28 | into device label EC code_regex DCP0,\s+16 replace_matched begin ECP0,8,ECP1,8 end; 29 | into device label EC code_regex DVT0,\s+16 replace_matched begin EVT0,8,EVT1,8 end; 30 | into device label EC code_regex BSN0,\s+16 replace_matched begin CSN0,8,CSN1,8 end; 31 | 32 | # fix 16-bit methods 33 | into method label _BST code_regex \(\^\^EC\.CAP0, replaceall_matched begin (B1B2(^^EC.DAP0,^^EC.DAP1), end; 34 | into method label _BST code_regex \(\^\^EC\.VOT0, replaceall_matched begin (B1B2(^^EC.WOT0,^^EC.WOT1), end; 35 | into method label _BST code_regex \(\^\^EC\.CRT0, replaceall_matched begin (B1B2(^^EC.DRT0,^^EC.DRT1), end; 36 | into method label _BIF code_regex \(\^\^EC\.FCP0, replaceall_matched begin (B1B2(^^EC.GCP0,^^EC.GCP1), end; 37 | into method label _BIF code_regex \(\^\^EC\.DCP0, replaceall_matched begin (B1B2(^^EC.ECP0,^^EC.ECP1), end; 38 | into method label _BIF code_regex \(\^\^EC\.DVT0, replaceall_matched begin (B1B2(^^EC.EVT0,^^EC.EVT1), end; 39 | into method label _BIF code_regex \(\^\^EC\.BSN0, replaceall_matched begin (B1B2(^^EC.CSN0,^^EC.CSN1), end; 40 | -------------------------------------------------------------------------------- /battery/battery_Dell-Inspiron-5548.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-Inspiron-5548.txt 3 | 4 | # Battery patch for Dell Inspiron 5548 Broadwell 5 | # created by Resset 2015-10-28 6 | 7 | # Works for 8 | # Dell Inspiron 5548 (Broadwell) 9 | 10 | # Split 16-bit fields into 8-bit fields 11 | into device label EC0 code_regex BRC0,\s+16, replace_matched begin RC00,8,RC01,8, end; 12 | into device label EC0 code_regex BSN0,\s+16, replace_matched begin SN00,8,SN01,8, end; 13 | into device label EC0 code_regex BPV0,\s+16, replace_matched begin PV00,8,PV01,8, end; 14 | into device label EC0 code_regex BDV0,\s+16, replace_matched begin DV00,8,DV01,8, end; 15 | into device label EC0 code_regex BDC0,\s+16, replace_matched begin DC00,8,DC01,8, end; 16 | into device label EC0 code_regex BFC0,\s+16, replace_matched begin FC00,8,FC01,8, end; 17 | into device label EC0 code_regex BAC0,\s+16, replace_matched begin AC00,8,AC01,8, end; 18 | into device label EC0 code_regex BFCB,\s+16, replace_matched begin FCB0,8,FCB1,8, end; 19 | into device label EC0 code_regex ERIB,\s+16, replace_matched begin ERI0,8,ERI1,8, end; 20 | 21 | # Fix BIFX-related values 22 | into method label BIFX code_regex \(\^\^EC0\.BDV0, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end; 23 | into method label BIFX code_regex \(\^\^EC0\.BDC0, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end; 24 | into method label BIFX code_regex \(\^\^EC0\.BFC0, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end; 25 | into method label BIFX code_regex \(\^\^EC0\.BFCB, replaceall_matched begin (B1B2(^^EC0.FCB0,^^EC0.FCB1), end; 26 | 27 | # Fix GUBS-related values 28 | into method label GUBS code_regex \(\^\^EC0\.BSN0, replaceall_matched begin (B1B2(^^EC0.SN00,^^EC0.SN01), end; 29 | into method label GUBS code_regex \(\^EC0\.BSN0, replaceall_matched begin (B1B2(^EC0.SN00,^EC0.SN01), end; 30 | 31 | # Fix _BST-related values 32 | into method label _BST code_regex \(\^\^EC0\.BRC0, replaceall_matched begin (B1B2(^^EC0.RC00,^^EC0.RC01), end; 33 | into method label _BST code_regex \s\^\^EC0\.BPV0\) replaceall_matched begin B1B2(^^EC0.PV00,^^EC0.PV01)) end; 34 | into method label _BST code_regex \(\^\^EC0\.BPV0, replaceall_matched begin (B1B2(^^EC0.PV00,^^EC0.PV01), end; 35 | into method label _BST code_regex \(\^\^EC0\.BAC0, replaceall_matched begin (B1B2(^^EC0.AC00,^^EC0.AC01), end; 36 | 37 | # Fix FAN-related values 38 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched begin Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) end; 39 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched begin Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) end; 40 | 41 | # Deal with 128-bit BATN field 42 | into device label EC0 code_regex (BATN,)\s+(128) replace_matched begin BATX,%2,//%1%2 end; 43 | into method label GBMN code_regex \(\^\EC0\.BATN, replaceall_matched begin (^EC0.RECB(0x90,128), end; 44 | 45 | 46 | # Add utility methods to DSDT in order to deal with more than 8-bit fields by RehabMan 47 | 48 | # method to read from 16-bit fields 49 | into method label B1B2 remove_entry; 50 | into definitionblock code_regex . insert 51 | begin 52 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 53 | end; 54 | 55 | # utility methods to read/write buffers from/to EC 56 | into method label RE1B parent_label EC0 remove_entry; 57 | into method label RECB parent_label EC0 remove_entry; 58 | into device label EC0 insert 59 | begin 60 | Method (RE1B, 1, NotSerialized)\n 61 | {\n 62 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 63 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 64 | Return(BYTE)\n 65 | }\n 66 | Method (RECB, 2, Serialized)\n 67 | // Arg0 - offset in bytes from zero-based EC\n 68 | // Arg1 - size of buffer in bits\n 69 | {\n 70 | ShiftRight(Arg1, 3, Arg1)\n 71 | Name(TEMP, Buffer(Arg1) { })\n 72 | Add(Arg0, Arg1, Arg1)\n 73 | Store(0, Local0)\n 74 | While (LLess(Arg0, Arg1))\n 75 | {\n 76 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 77 | Increment(Arg0)\n 78 | Increment(Local0)\n 79 | }\n 80 | Return(TEMP)\n 81 | }\n 82 | end; 83 | 84 | #EOF 85 | -------------------------------------------------------------------------------- /battery/battery_Dell-Studio-1558.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: Draekko for: Laptop Patches 2 | #battery_Dell-Studio-1558.txt 3 | 4 | # created by Draekko 2015-05-02 5 | 6 | # works for: 7 | # Dell Studio 1558 / Intel HD Graphics 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | # fix an error in this DSDT 16 | into method label _DSM parent_label PEGP code_regex Arg0\n.*Arg1\n.*Arg2\n.*Arg3\n remove_matched; 17 | 18 | # 16-bit registers 19 | into device label EC0 code_regex CTL1,\s+16 replace_matched begin TL10,8,TL11,8 end; 20 | into device label EC0 code_regex CTL2,\s+16 replace_matched begin TL20,8,TL21,8 end; 21 | into device label EC0 code_regex RPM2,\s+16 replace_matched begin PM20,8,PM21,8 end; 22 | into device label EC0 code_regex FTAC,\s+16 replace_matched begin TAC0,8,TAC1,8 end; 23 | into device label EC0 code_regex FSPD,\s+16 replace_matched begin SPD0,8,SPD1,8 end; 24 | into device label EC0 code_regex CAP0,\s+16 replace_matched begin AP00,8,AP01,8 end; 25 | into device label EC0 code_regex RCP0,\s+16 replace_matched begin RP00,8,RP01,8 end; 26 | into device label EC0 code_regex VOT0,\s+16 replace_matched begin OT00,8,OT01,8 end; 27 | into device label EC0 code_regex CRT0,\s+16 replace_matched begin RT00,8,RT01,8 end; 28 | into device label EC0 code_regex BTM0,\s+16 replace_matched begin TM00,8,TM01,8 end; 29 | into device label EC0 code_regex BST0,\s+16 replace_matched begin ST00,8,ST01,8 end; 30 | into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8 end; 31 | into device label EC0 code_regex FCP0,\s+16 replace_matched begin CP00,8,CP01,8 end; 32 | into device label EC0 code_regex DCP0,\s+16 replace_matched begin DP00,8,DP01,8 end; 33 | into device label EC0 code_regex DVT0,\s+16 replace_matched begin VT00,8,VT01,8 end; 34 | into device label EC0 code_regex MER0,\s+16 replace_matched begin ER00,8,ER01,8 end; 35 | into device label EC0 code_regex MFD0,\s+16 replace_matched begin FD00,8,FD01,8 end; 36 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin SN00,8,SN01,8 end; 37 | into device label EC0 code_regex MAS0,\s+16 replace_matched begin AS00,8,AS01,8 end; 38 | into device label EC0 code_regex CAP1,\s+16 replace_matched begin AP10,8,AP11,8 end; 39 | into device label EC0 code_regex RCP1,\s+16 replace_matched begin CP10,8,CP11,8 end; 40 | into device label EC0 code_regex VOT1,\s+16 replace_matched begin OT10,8,OT11,8 end; 41 | into device label EC0 code_regex CRT1,\s+16 replace_matched begin RT10,8,RT11,8 end; 42 | into device label EC0 code_regex BTM1,\s+16 replace_matched begin TM10,8,TM11,8 end; 43 | into device label EC0 code_regex BST1,\s+16 replace_matched begin ST10,8,ST11,8 end; 44 | into device label EC0 code_regex BRC1,\s+16 replace_matched begin RC10,8,RC11,8 end; 45 | into device label EC0 code_regex FCP1,\s+16 replace_matched begin FP10,8,FP11,8 end; 46 | into device label EC0 code_regex DCP1,\s+16 replace_matched begin DP10,8,DP11,8 end; 47 | into device label EC0 code_regex DVT1,\s+16 replace_matched begin VT10,8,VT11,8 end; 48 | into device label EC0 code_regex MER1,\s+16 replace_matched begin ER10,8,ER11,8 end; 49 | into device label EC0 code_regex MFD1,\s+16 replace_matched begin FD10,8,FD11,8 end; 50 | into device label EC0 code_regex BSN1,\s+16 replace_matched begin SN10,8,SN11,8 end; 51 | into device label EC0 code_regex MAS1,\s+16 replace_matched begin AS10,8,AS11,8 end; 52 | 53 | # fix 16-bit methods 54 | into method label GTIF code_regex \(\^\^PCI0\.LPCB\.EC0\.CAP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.AP00,^^PCI0.LPCB.EC0.AP01), end; 55 | into method label GTIF code_regex \(\^\^PCI0\.LPCB\.EC0\.VOT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.OT00,^^PCI0.LPCB.EC0.OT01), end; 56 | into method label GTIF code_regex \(\^\^PCI0\.LPCB\.EC0\.CRT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.RT00,^^PCI0.LPCB.EC0.RT01), end; 57 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DCP0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.DP00,^^PCI0.LPCB.EC0.DP01), end; 58 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.FCP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.CP00,^^PCI0.LPCB.EC0.CP01), end; 59 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DVT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.VT00,^^PCI0.LPCB.EC0.VT01), end; 60 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BSN0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.SN00,^^PCI0.LPCB.EC0.SN01), end; 61 | -------------------------------------------------------------------------------- /battery/battery_Dell-XPS-13.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-XPS-13.txt 3 | 4 | # created by RehabMan 9/25/2013 5 | # created originally for ivan0309 6 | 7 | # works for: 8 | # Dell XPS 13 9 | # Dell Insprion 14z 10 | # Dell XPS 15z 11 | # Dell Inspiron 14r n4110 12 | # Dell Vostro 5470 (per sonic1978) 13 | # Dell Vostro 3750 (per Moorre) 14 | # Dell Vostro 3460 (per Vampnight) 15 | 16 | into method label B1B2 remove_entry; 17 | into definitionblock code_regex . insert 18 | begin 19 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 20 | end; 21 | 22 | # battery EC 23 | into device label EC0 code_regex CAP0,\s+16 replace_matched begin CAPX,8,CAPY,8 end; 24 | into device label EC0 code_regex VOT0,\s+16 replace_matched begin VOTX,8,VOTY,8 end; 25 | into device label EC0 code_regex CRT0,\s+16 replace_matched begin CRTX,8,CRTY,8 end; 26 | into device label EC0 code_regex FCP0,\s+16 replace_matched begin FCPX,8,FCPY,8 end; 27 | into device label EC0 code_regex DCP0,\s+16 replace_matched begin DCPX,8,DCPY,8 end; 28 | into device label EC0 code_regex DVT0,\s+16 replace_matched begin DVTX,8,DVTY,8 end; 29 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin BSNX,8,BSNY,8 end; 30 | 31 | # battery methods 32 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DCP0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.DCPX,^^PCI0.LPCB.EC0.DCPY), end; 33 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.FCP0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.FCPX,^^PCI0.LPCB.EC0.FCPY), end; 34 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DVT0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.DVTX,^^PCI0.LPCB.EC0.DVTY), end; 35 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BSN0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.BSNX,^^PCI0.LPCB.EC0.BSNY), end; 36 | 37 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CAP0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.CAPX,^^PCI0.LPCB.EC0.CAPY), end; 38 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.VOT0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.VOTX,^^PCI0.LPCB.EC0.VOTY), end; 39 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CRT0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.CRTX,^^PCI0.LPCB.EC0.CRTY), end; 40 | 41 | -------------------------------------------------------------------------------- /battery/battery_Dell-XPS-14Z-L412Z.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-XPS-14Z-L412Z.txt 3 | 4 | # created by hogfan 2015-05-06 5 | # works for: 6 | # Dell XPS 14Z (L412Z) 7 | 8 | into method label B1B2 remove_entry; 9 | into definitionblock code_regex . insert 10 | begin 11 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 12 | end; 13 | 14 | # utility methods to read/write buffers from/to EC 15 | into method label RE1B parent_label EC0 remove_entry; 16 | into method label RECB parent_label EC0 remove_entry; 17 | into device label EC0 insert 18 | begin 19 | Method (RE1B, 1, NotSerialized)\n 20 | {\n 21 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 22 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 23 | Return(BYTE)\n 24 | }\n 25 | Method (RECB, 2, Serialized)\n 26 | {\n 27 | ShiftRight(Arg1, 3, Arg1)\n 28 | Name(TEMP, Buffer(Arg1) { })\n 29 | Add(Arg0, Arg1, Arg1)\n 30 | Store(0, Local0)\n 31 | While (LLess(Arg0, Arg1))\n 32 | {\n 33 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 34 | Increment(Arg0)\n 35 | Increment(Local0)\n 36 | }\n 37 | Return(TEMP)\n 38 | }\n 39 | end; 40 | 41 | # Discovered registers larger than 8 bits that are accessed 42 | # 43 | # BRC0, 16, 44 | # BSN0, 16, 45 | # BPV0, 16, 46 | # BDV0, 16, 47 | # BDC0, 16, 48 | # BFC0, 16, 49 | # BAC0, 16, 50 | # ERIB, 16, 51 | # BATN, 128, 52 | 53 | #Deal with 128-bit buffer field 54 | into device label EC0 code_regex (BATN,)\s+(128) replace_matched begin BATX,%2,//%1%2 end; 55 | into method label _BIF code_regex \(\^\^EC0\.BATN, replaceall_matched begin (^^EC0.RECB(0x90,128), end; 56 | 57 | #patch 16-bit registers 58 | into device label EC0 code_regex BRC0,\s+16, replace_matched begin RC00,8,RC01,8, end; 59 | into device label EC0 code_regex BSN0,\s+16, replace_matched begin SN00,8,SN01,8, end; 60 | into device label EC0 code_regex BPV0,\s+16, replace_matched begin PV00,8,PV01,8, end; 61 | into device label EC0 code_regex BDV0,\s+16, replace_matched begin DV00,8,DV01,8, end; 62 | into device label EC0 code_regex BDC0,\s+16, replace_matched begin DC00,8,DC01,8, end; 63 | into device label EC0 code_regex BFC0,\s+16, replace_matched begin FC00,8,FC01,8, end; 64 | into device label EC0 code_regex BAC0,\s+16, replace_matched begin AC00,8,AC01,8, end; 65 | into device label EC0 code_regex ERIB,\s+16, replace_matched begin RIB0,8,RIB1,8, end; 66 | 67 | #fix 16-bit _BST methods 68 | into method label _BST code_regex \(\^\^EC0\.BRC0, replaceall_matched begin (B1B2(^^EC0.RC00,^^EC0.RC01), end; 69 | into method label _BST code_regex \(\^\^EC0\.BPV0, replaceall_matched begin (B1B2(^^EC0.PV00,^^EC0.PV01), end; 70 | into method label _BST code_regex \(\^\^EC0\.BAC0, replaceall_matched begin (B1B2(^^EC0.AC00,^^EC0.AC01), end; 71 | 72 | #fix 16-bit _BIF methods 73 | into method label _BIF code_regex \(\^\^EC0\.BSN0, replaceall_matched begin (B1B2(^^EC0.SN00,^^EC0.SN01), end; 74 | into method label _BIF code_regex \(\^\^EC0\.BDV0, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end; 75 | into method label _BIF code_regex \(\^\^EC0\.BDC0, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end; 76 | into method label _BIF code_regex \(\^\^EC0\.BFC0, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end; 77 | 78 | #fix 16-bit fan-related methods 79 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched begin Store(Arg0, RIB0) Store(ShiftRight(Arg0, 8), RIB1) end; 80 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched begin Store(Arg0, RIB0) Store(ShiftRight(Arg0, 8), RIB1) end; 81 | 82 | -------------------------------------------------------------------------------- /battery/battery_Dell-XPS-18.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-XPS-18.txt 3 | 4 | # created by esaylors 2013-11-16 5 | # modifications/fixes by RehabMan 2014-09-24 6 | 7 | # works for: 8 | # Dell XPS 18 9 | # Cintiq Companion 2 (per Bertolin) 10 | 11 | into method label B1B2 remove_entry; 12 | into definitionblock code_regex . insert 13 | begin 14 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 15 | end; 16 | 17 | # new fixes (for more recent BIOS?) 18 | into method label BRCP code_regex ,\sB0RC, replaceall_matched begin ,B1B2(RC00,RC01), end; 19 | into method label BRCP code_regex Subtract\s+\((.*),\sB0RC\) replaceall_matched 20 | begin 21 | Store(Subtract(%1),RC00)\n 22 | Store(ShiftRight(Subtract(%1),8),RC01)\n 23 | end; 24 | 25 | # 16-bit registers 26 | into device label EC0 code_regex B0VL,\s+16 replace_matched begin VL00,8,VL01,8 end; 27 | into device label EC0 code_regex B0CC,\s+16 replace_matched begin CC01,8,CC02,8 end; 28 | into device label EC0 code_regex B0RC,\s+16 replace_matched begin RC00,8,RC01,8 end; 29 | into device label EC0 code_regex BFCP,\s+16 replace_matched begin FCP0,8,FCP1,8 end; 30 | into device label EC0 code_regex B0ST,\s+16 replace_matched begin ST00,8,ST01,8 end; 31 | into device label EC0 code_regex BDCP,\s+16 replace_matched begin DCP0,8,DCP1,8 end; 32 | into device label EC0 code_regex BDVL,\s+16 replace_matched begin DVL0,8,DVL1,8 end; 33 | into device label EC0 code_regex B0MD,\s+16 replace_matched begin MD00,8,MD01,8 end; 34 | 35 | # fix 16-bit methods 36 | into method label BCRT code_regex \(B0CC, replaceall_matched begin (B1B2(CC01,CC02), end; 37 | into method label BIF0 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end; 38 | into method label BIF1 code_regex \(BDCP, replaceall_matched begin (B1B2(DCP0,DCP1), end; 39 | into method label BIF2 code_regex \(BFCP, replaceall_matched begin (B1B2(FCP0,FCP1), end; 40 | into method label BIF3 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end; 41 | into method label BIF4 code_regex \(BDVL, replaceall_matched begin (B1B2(DVL0,DVL1), end; 42 | into method label BRCP code_regex \(B0RC, replaceall_matched begin (B1B2(RC00,RC01), end; 43 | into method label BRCP code_regex \(BFCP, replaceall_matched begin (B1B2(FCP0,FCP1), end; 44 | into method label BRCP code_regex \(B0ST, replaceall_matched begin (B1B2(ST00,ST01), end; 45 | into method label BSTS code_regex \(B0ST, replaceall_matched begin (B1B2(ST00,ST01), end; 46 | into method label BVOT code_regex \(B0VL, replaceall_matched begin (B1B2(VL00,VL01), end; 47 | 48 | -------------------------------------------------------------------------------- /battery/battery_Dell-XPS-L502x.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Dell-XPS-L502x.txt 3 | 4 | # created by Dangersam 2013-11-27 5 | 6 | # works for: 7 | # Dell XPS L502x 8 | # Dell 1464/1564 (per dhnguyen92) 9 | # Dell XPS L501x (per wofy) 10 | 11 | into method label B1B2 remove_entry; 12 | into definitionblock code_regex . insert 13 | begin 14 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 15 | end; 16 | 17 | # fix an error in this DSDT 18 | into method label _DSM parent_label PEGP code_regex Arg0\n.*Arg1\n.*Arg2\n.*Arg3\n remove_matched; 19 | 20 | # 16-bit registers 21 | into device label EC0 code_regex CAP0,\s+16 replace_matched begin AP00,8,AP01,8 end; 22 | into device label EC0 code_regex VOT0,\s+16 replace_matched begin OT00,8,OT01,8 end; 23 | into device label EC0 code_regex CRT0,\s+16 replace_matched begin RT00,8,RT01,8 end; 24 | into device label EC0 code_regex FCP0,\s+16 replace_matched begin CP00,8,CP01,8 end; 25 | into device label EC0 code_regex DCP0,\s+16 replace_matched begin DP00,8,DP01,8 end; 26 | into device label EC0 code_regex DVT0,\s+16 replace_matched begin VT00,8,VT01,8 end; 27 | into device label EC0 code_regex BSN0,\s+16 replace_matched begin SN00,8,SN01,8 end; 28 | 29 | # fix 16-bit methods 30 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CAP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.AP00,^^PCI0.LPCB.EC0.AP01), end; 31 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.VOT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.OT00,^^PCI0.LPCB.EC0.OT01), end; 32 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.CRT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.RT00,^^PCI0.LPCB.EC0.RT01), end; 33 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DCP0, replace_matched begin (B1B2(^^PCI0.LPCB.EC0.DP00,^^PCI0.LPCB.EC0.DP01), end; 34 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.FCP0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.CP00,^^PCI0.LPCB.EC0.CP01), end; 35 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.DVT0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.VT00,^^PCI0.LPCB.EC0.VT01), end; 36 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BSN0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.SN00,^^PCI0.LPCB.EC0.SN01), end; -------------------------------------------------------------------------------- /battery/battery_Gigabyte-Aero15V8.txt: -------------------------------------------------------------------------------- 1 | #battery_Gigabyte-Aero15V8.txt 2 | 3 | # created by neocoma504 2018-06-02 4 | 5 | # works for: 6 | # Gigabyte Aero15 V8 7 | 8 | #16-bit Registers 9 | into device label ECDV code_regex B1DC,\s+16, replace_matched begin ZDC0,8,ZDC1,8, end; 10 | into device label ECDV code_regex B1FC,\s+16, replace_matched begin ZFC0,8,ZFC1,8, end; 11 | into device label ECDV code_regex B1RC,\s+16, replace_matched begin ZRC0,8,ZRC1,8, end; 12 | into device label ECDV code_regex B1FV,\s+16, replace_matched begin ZFV0,8,ZFV1,8, end; 13 | into device label ECDV code_regex B1DG,\s+16, replace_matched begin ZDG0,8,ZDG1,8, end; 14 | into device label ECDV code_regex B1CR,\s+16, replace_matched begin ZCR0,8,ZCR1,8, end; 15 | 16 | into device label ECDV code_regex RPM1,\s+16, replace_matched begin RPMX,8,RPMY,8, end; 17 | into device label ECDV code_regex RPM2,\s+16 replace_matched begin RMPX,8,RMPY,8, end; 18 | into device label ECDV code_regex XFN1,\s+16, replace_matched begin XFNX,8,XFNY,8, end; 19 | 20 | into method label B1B2 remove_entry; 21 | into definitionblock code_regex . insert 22 | begin 23 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 24 | end; 25 | 26 | # fix 16-bit Methods 27 | into method label _BIF code_regex B1DC replaceall_matched begin B1B2(ZDC0,ZDC1) end; 28 | into method label _BIF code_regex B1FC replaceall_matched begin B1B2(ZFC0,ZFC1) end; 29 | into method label _BST code_regex B1FC replaceall_matched begin B1B2(ZFC0,ZFC1) end; 30 | into method label BATS code_regex B1RC replaceall_matched begin B1B2(ZRC0,ZRC1) end; 31 | into method label _BST code_regex B1RC replaceall_matched begin B1B2(ZRC0,ZRC1) end; 32 | into method label _BST code_regex B1FV replaceall_matched begin B1B2(ZFV0,ZFV1) end; 33 | into method label _BIF code_regex B1DG replaceall_matched begin B1B2(ZDG0,ZDG1) end; 34 | into method label _BST code_regex B1CR replaceall_matched begin B1B2(ZCR0,ZCR1) end; 35 | 36 | #into method label WMBC code_regex RPM1 replaceall_matched begin B1B2(RPMX,RPMY) end; 37 | #into method label WMBC code_regex RPM2 replaceall_matched begin B1B2(RMPX,RMPY) end; 38 | #into method label WMBC code_regex XFN1 replaceall_matched begin B1B2(XFNX,XFNY) end; 39 | 40 | into method label WMBC code_regex \(\^\^LPCB\.ECDV\.RPM1 replaceall_matched begin (B1B2(\^\^LPCB.ECDV.RPMX,\^\^LPCB.ECDV.RPMY) end; 41 | into method label WMBC code_regex \(\^\^LPCB\.ECDV\.RPM2 replaceall_matched begin (B1B2(\^\^LPCB.ECDV.RMPX,\^\^LPCB.ECDV.RMPY) end; 42 | into method label WMBC code_regex \(\^\^LPCB\.ECDV\.XFN1 replaceall_matched begin (B1B2(\^\^LPCB.ECDV.XFNX,\^\^LPCB.ECDV.XFNY) end; 43 | 44 | #32-bit Registers 45 | into device label ECDV code_regex XFNW,\s+24, replace_matched begin FNW0,8,FNW1,8,FNW2,8, end; 46 | 47 | into method label B1B4 remove_entry; 48 | into definitionblock code_regex . insert 49 | begin 50 | Method (B1B3, 3, NotSerialized)\n 51 | {\n 52 | Store(Arg2, Local0)\n 53 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 54 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 55 | Return(Local0)\n 56 | }\n 57 | end; 58 | 59 | #fix 32-bit Methods 60 | #into method label WMBD code_regex \(XFNW, replaceall_matched begin (B1B3(FNW0,FNW1,FNW2,FNW3), end; 61 | 62 | into method label WMBD code_regex \(\^\^LPCB\.ECDV\.XFNW replaceall_matched begin (B1B3(\^\^LPCB.ECDV.FNW0,\^\^LPCB.ECDV.FNW1,\^\^LPCB.ECDV.FNW2) end; 63 | into method label WMBD code_regex \^\^LPCB\.ECDV\.XFNW replaceall_matched begin B1B3(\^\^LPCB.ECDV.FNW0,\^\^LPCB.ECDV.FNW1,\^\^LPCB.ECDV.FNW2) end; -------------------------------------------------------------------------------- /battery/battery_Gigabyte-P35Xv3.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Gigabyte-P35Xv3.txt 3 | 4 | # created by jhax01 2016-01-07 5 | 6 | # works for: 7 | # Gigabyte P35Xv3 8 | 9 | into device label H_EC code_regex B1DC,\s+16, replace_matched begin ZDC0,8,ZDC1,8, end; 10 | into device label H_EC code_regex B1FC,\s+16, replace_matched begin ZFC0,8,ZFC1,8, end; 11 | into device label H_EC code_regex B1RC,\s+16, replace_matched begin ZRC0,8,ZRC1,8, end; 12 | into device label H_EC code_regex B1FV,\s+16, replace_matched begin ZFV0,8,ZFV1,8, end; 13 | into device label H_EC code_regex B1DG,\s+16, replace_matched begin ZDG0,8,ZDG1,8, end; 14 | into device label H_EC code_regex B1CR,\s+16, replace_matched begin ZCR0,8,ZCR1,8, end; 15 | 16 | into device label H_EC code_regex RPM1,\s+16, replace_matched begin RPMX,8,RPMY,8, end; 17 | into device label H_EC code_regex RPM2,\s+16 replace_matched begin RMPX,8,RMPY,8, end; 18 | 19 | into method label _BIF code_regex B1DC replaceall_matched begin B1B2(ZDC0,ZDC1) end; 20 | into method label _BIF code_regex B1FC replaceall_matched begin B1B2(ZFC0,ZFC1) end; 21 | into method label _BST code_regex B1FC replaceall_matched begin B1B2(ZFC0,ZFC1) end; 22 | into method label BATS code_regex B1RC replaceall_matched begin B1B2(ZRC0,ZRC1) end; 23 | into method label _BST code_regex B1RC replaceall_matched begin B1B2(ZRC0,ZRC1) end; 24 | into method label _BST code_regex B1FV replaceall_matched begin B1B2(ZFV0,ZFV1) end; 25 | into method label _BIF code_regex B1DG replaceall_matched begin B1B2(ZDG0,ZDG1) end; 26 | into method label _BST code_regex B1CR replaceall_matched begin B1B2(ZCR0,ZCR1) end; 27 | 28 | #into method label WMBC code_regex RPM1 replaceall_matched begin B1B2(RPMX,RPMY) end; 29 | #into method label WMBC code_regex RPM2 replaceall_matched begin B1B2(RMPX,RMPY) end; 30 | 31 | into method label WMBC code_regex \(\^\^LPCB\.H_EC\.RPM1 replaceall_matched begin (B1B2(\^\^LPCB.H_EC.RPMX,\^\^LPCB.H_EC.RPMY) end; 32 | into method label WMBC code_regex \(\^\^LPCB\.H_EC\.RPM2 replaceall_matched begin (B1B2(\^\^LPCB.H_EC.RMPX,\^\^LPCB.H_EC.RMPY) end; 33 | 34 | into method label B1B2 remove_entry; 35 | into definitionblock code_regex . insert 36 | begin 37 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 38 | end; 39 | 40 | -------------------------------------------------------------------------------- /battery/battery_Gigabyte-u2442N.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Gigabyte-u2442N.txt 3 | 4 | # created by venu2062 2013-11-25 5 | # changes for P34W by sztupy 2015-08-26 6 | 7 | # works for: 8 | # Gigabyte u2442N Ultrabook 9 | # Gigabyte P34W v3 gaming notebook 10 | 11 | into definitionblock code_regex . insert 12 | begin 13 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 14 | end; 15 | 16 | into device label H_EC code_regex B1DC,\s+16 replace_matched begin DC10,8,DC11,8 end; 17 | into device label H_EC code_regex B1FC,\s+16 replace_matched begin FC10,8,FC11,8 end; 18 | into device label H_EC code_regex B1RC,\s+16 replace_matched begin RC10,8,RC11,8 end; 19 | into device label H_EC code_regex B1FV,\s+16 replace_matched begin FV10,8,FV11,8 end; 20 | into device label H_EC code_regex B1DG,\s+16 replace_matched begin DG10,8,DG11,8 end; 21 | into device label H_EC code_regex B1CR,\s+16 replace_matched begin CR10,8,CR11,8 end; 22 | 23 | # added for P34W v3 (EC device is EC instead of H_EC) 24 | into device label EC code_regex B1DC,\s+16 replace_matched begin DC10,8,DC11,8 end; 25 | into device label EC code_regex B1FC,\s+16 replace_matched begin FC10,8,FC11,8 end; 26 | into device label EC code_regex B1RC,\s+16 replace_matched begin RC10,8,RC11,8 end; 27 | into device label EC code_regex B1FV,\s+16 replace_matched begin FV10,8,FV11,8 end; 28 | into device label EC code_regex B1DG,\s+16 replace_matched begin DG10,8,DG11,8 end; 29 | into device label EC code_regex B1CR,\s+16 replace_matched begin CR10,8,CR11,8 end; 30 | 31 | into method label _BIF code_regex \(B1DC, replaceall_matched begin (B1B2(DC10,DC11), end; 32 | into method label _BIF code_regex \(B1FC, replaceall_matched begin (B1B2(FC10,FC11), end; 33 | into method label _BIF code_regex \(B1DG, replaceall_matched begin (B1B2(DG10,DG11), end; 34 | into method label _BST code_regex \(B1CR, replaceall_matched begin (B1B2(CR10,CR11), end; 35 | into method label _BST code_regex \(B1RC, replaceall_matched begin (B1B2(RC10,RC11), end; 36 | into method label _BST code_regex \(B1FV, replaceall_matched begin (B1B2(FV10,FV11), end; 37 | into method label BATS code_regex \(B1RC, replaceall_matched begin (B1B2(RC10,RC11), end; 38 | into method label _BIF code_regex \(B1FC\) replaceall_matched begin (B1B2(FC10,FC11)) end; 39 | 40 | # added for P34W v3 41 | into method label _BST code_regex B1FC, replaceall_matched begin B1B2(FC10,FC11), end; 42 | -------------------------------------------------------------------------------- /battery/battery_HP-DV7-1120.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_HP-DV7-1120.txt 3 | 4 | # created by Swavek 2013-11-28 5 | # (credits to RehabMan for the guide) 6 | 7 | # works for: 8 | # HP DV7-1120 9 | # HP DV3-2150EL 10 | 11 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 12 | 13 | into method label B1B2 remove_entry; 14 | into definitionblock code_regex . insert 15 | begin 16 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 17 | end; 18 | 19 | # remove WMI related items; makes it easier to patch battery EC0 20 | #into device label WMID remove_entry; 21 | #into method label _Q06 parent_label EC0 remove_entry; 22 | #into method label _Q08 parent_label EC0 remove_entry; 23 | #into method label _Q1F parent_label EC0 remove_entry; 24 | #into method label _Q3A parent_label EC0 remove_entry; 25 | #into method label _Q43 parent_label EC0 remove_entry; 26 | #into method label _Q20 parent_label EC0 remove_entry; 27 | #into method label _QCC parent_label EC0 remove_entry; 28 | 29 | 30 | # 16-bit EC0 registers 31 | into device label EC0 code_regex BDC0,\s+16 replace_matched begin BDCA,8,BDCB,8 end; 32 | into device label EC0 code_regex BFC0,\s+16 replace_matched begin BFCA,8,BFCB,8 end; 33 | into device label EC0 code_regex BDV0,\s+16 replace_matched begin BDVA,8,BDVB,8 end; 34 | into device label EC0 code_regex BRC0,\s+16 replace_matched begin BRCA,8,BRCB,8 end; 35 | into device label EC0 code_regex BPV0,\s+16 replace_matched begin BPVA,8,BPVB,8 end; 36 | 37 | # _BIF method 38 | into method label _BIF code_regex \(\^\^PCI0\.LPC\.EC0\.BDC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BDCA,^^PCI0.LPC.EC0.BDCB), end; 39 | into method label _BIF code_regex \(\^\^PCI0\.LPC\.EC0\.BFC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BFCA,^^PCI0.LPC.EC0.BFCB), end; 40 | into method label _BIF code_regex \(\^\^PCI0\.LPC\.EC0\.BDV0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BDVA,^^PCI0.LPC.EC0.BDVB), end; 41 | 42 | # _BST method 43 | into method label _BST code_regex \(\^\^PCI0\.LPC\.EC0\.BRC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BRCA,^^PCI0.LPC.EC0.BRCB), end; 44 | into method label _BST code_regex \(\^\^PCI0\.LPC\.EC0\.BPV0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BPVA,^^PCI0.LPC.EC0.BPVB), end; 45 | 46 | # Method BATT /WMID 47 | into method label BATT code_regex \(\^\^PCI0\.LPC\.EC0\.BDC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BDCA,^^PCI0.LPC.EC0.BDCB), end; 48 | into method label BATT code_regex \(\^\^PCI0\.LPC\.EC0\.BFC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BFCA,^^PCI0.LPC.EC0.BFCB), end; 49 | into method label BATT code_regex \(\^\^PCI0\.LPC\.EC0\.BDV0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BDVA,^^PCI0.LPC.EC0.BDVB), end; 50 | into method label BATT code_regex \(\^\^PCI0\.LPC\.EC0\.BRC0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BRCA,^^PCI0.LPC.EC0.BRCB), end; 51 | into method label BATT code_regex \(\^\^PCI0\.LPC\.EC0\.BPV0, replaceall_matched begin (B1B2(^^PCI0.LPC.EC0.BPVA,^^PCI0.LPC.EC0.BPVB), end; 52 | 53 | -------------------------------------------------------------------------------- /battery/battery_HP-G62-B13SL.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_HP-G62-B13SL.txt 3 | 4 | # created by RehabMan 2013-01-21 5 | # created for giofrida 6 | 7 | # Works for: 8 | # HP G62-B13SL 9 | 10 | # utility methods to read buffers from/to EC 11 | into method label RE1B parent_label EC remove_entry; 12 | into method label RECB parent_label EC remove_entry; 13 | into device label EC insert 14 | begin 15 | Method (RE1B, 1, NotSerialized)\n 16 | {\n 17 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 18 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 19 | Return(BYTE)\n 20 | }\n 21 | Method (RECB, 2, Serialized)\n 22 | {\n 23 | ShiftRight(Arg1, 3, Arg1)\n 24 | Name(TEMP, Buffer(Arg1) { })\n 25 | Add(Arg0, Arg1, Arg1)\n 26 | Store(0, Local0)\n 27 | While (LLess(Arg0, Arg1))\n 28 | {\n 29 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 30 | Increment(Arg0)\n 31 | Increment(Local0)\n 32 | }\n 33 | Return(TEMP)\n 34 | }\n 35 | end; 36 | 37 | # 38 | # Note: Offsets below into EC are based on the following data in the native DSDT 39 | # 40 | # OperationRegion (ECF2, EmbeddedControl, Zero, 0xFF) 41 | # Field (ECF2, ByteAcc, Lock, Preserve) 42 | # { 43 | # ADIN, 1, 44 | # ADIS, 1, 45 | #.. 46 | # WMB3, 8, 47 | # Offset (0xA0), 48 | # C1VL, 8, //a0 49 | # C1VH, 8, //a1 50 | # C2VL, 8, //a2 51 | # C2VH, 8, //a3 52 | # C3VL, 8, //a4 53 | # C3VH, 8, //a5 54 | # C4VL, 8, //a6 55 | # C4VH, 8, //a7 56 | # CTLB, 128, //a8 57 | # RCS1, 8, 58 | 59 | # deal with 128-bit CTLB 60 | # (Note: this is probably not even necessary, since this code is in WMI) 61 | into device label EC code_regex (CTLB,)\s+(128) replace_matched begin CTLX,%2,//%1%2 end; 62 | into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.CTLB, replaceall_matched begin (^^PCI0.LPCB.EC.RECB(0xa0,128), end; 63 | 64 | # make PNOT do nothing 65 | 66 | into method label PNOT replace_content begin //nothing end; -------------------------------------------------------------------------------- /battery/battery_HP-Pavilion-n012tx.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_HP-Pavilion-n012tx.txt 3 | 4 | # Created by rockvignesh25 2014-09-20 5 | 6 | # Works for: 7 | # HP Pavilion n012tx 8 | # HP Envy 15t-k100 (per bechhamba07) 9 | # HP X360 (Haswell) (per lx86) 10 | # HP Pavilion G6-2149TX (per computechnopro2) 11 | # HP Pavilion 15-b119sl (per Skorpion96) 12 | # HP Pavilion 15-n096ea (per oscarr) 13 | # HP Pavilion 17-f078nf (per xdevillived666) 14 | # HP Pavilion 15-cb050od (per github/Jahazielg) 15 | 16 | into method label B1B2 remove_entry; 17 | into definitionblock code_regex . insert 18 | begin 19 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 20 | end; 21 | 22 | into device label EC0 code_regex BADC,\s+16, replace_matched begin ADC0,8,ADC1,8, end; 23 | into device label EC0 code_regex BFCC,\s+16, replace_matched begin FCC0,8,FCC1,8, end; 24 | into device label EC0 code_regex MCUR,\s+16, replace_matched begin CUR0,8,CUR1,8, end; 25 | into device label EC0 code_regex MBRM,\s+16, replace_matched begin BRM0,8,BRM1,8, end; 26 | into device label EC0 code_regex MBCV,\s+16, replace_matched begin BCV0,8,BCV1,8, end; 27 | 28 | into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BADC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.ADC0,\^\^PCI0\.LPCB\.EC0\.ADC1), end; 29 | 30 | into method label GBIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.FCC0,\^\^PCI0\.LPCB\.EC0\.FCC1), end; 31 | into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.FCC0,\^\^PCI0\.LPCB\.EC0\.FCC1), end; 32 | 33 | into method label GBCO code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.CUR0,\^\^PCI0\.LPCB\.EC0\.CUR1), end; 34 | into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.CUR0,\^\^PCI0\.LPCB\.EC0\.CUR1), end; 35 | 36 | into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BRM0,\^\^PCI0\.LPCB\.EC0\.BRM1), end; 37 | into method label CLRI code_regex \(\^\^LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^LPCB\.EC0\.BRM0,\^\^LPCB\.EC0\.BRM1), end; 38 | 39 | into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCV, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BCV0,\^\^PCI0\.LPCB\.EC0\.BCV1), end; 40 | 41 | into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end; 42 | 43 | into method label WE1B parent_label EC0 remove_entry; 44 | into method label WECB parent_label EC0 remove_entry; 45 | into device label EC0 insert 46 | begin 47 | Method (WE1B, 2, NotSerialized)\n 48 | {\n 49 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 50 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 51 | Store(Arg1, BYTE)\n 52 | }\n 53 | Method (WECB, 3, Serialized)\n 54 | // Arg0 - offset in bytes from zero-based EC\n 55 | // Arg1 - size of buffer in bits\n 56 | // Arg2 - value to write\n 57 | {\n 58 | ShiftRight(Arg1, 3, Arg1)\n 59 | Name(TEMP, Buffer(Arg1) { })\n 60 | Store(Arg2, TEMP)\n 61 | Add(Arg0, Arg1, Arg1)\n 62 | Store(0, Local0)\n 63 | While (LLess(Arg0, Arg1))\n 64 | {\n 65 | WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n 66 | Increment(Arg0)\n 67 | Increment(Local0)\n 68 | }\n 69 | }\n 70 | end; 71 | 72 | into method label SMWR code_regex Store\s?\(Arg3,\s?\SMD0\) replaceall_matched begin WECB(0x04,256,Arg3) end; 73 | -------------------------------------------------------------------------------- /battery/battery_Lenovo-X210.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Lenovo-X210.txt 3 | 4 | # created by dooglex 2018-06-25 5 | 6 | # works for: 7 | # Lenovo x210 8 | 9 | # 16-bit registers 10 | into device label EC0 code_regex DGCP,\s+16 replace_matched begin CP00,8,CP01,8 end; 11 | into device label EC0 code_regex FLCP,\s+16 replace_matched begin FL10,8,FL11,8 end; 12 | into device label EC0 code_regex DGVO,\s+16 replace_matched begin DG00,8,DG01,8 end; 13 | into device label EC0 code_regex BDW,\s+16 replace_matched begin BD10,8,BD11,8 end; 14 | into device label EC0 code_regex BDL,\s+16 replace_matched begin DL00,8,DL01,8 end; 15 | into device label EC0 code_regex BPR,\s+16 replace_matched begin PR10,8,PR11,8 end; 16 | into device label EC0 code_regex BRC,\s+16 replace_matched begin RC00,8,RC01,8 end; 17 | into device label EC0 code_regex BPV,\s+16 replace_matched begin PV10,8,PV11,8 end; 18 | 19 | into method label B1B2 remove_entry; 20 | into definitionblock code_regex . insert 21 | begin 22 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 23 | end; 24 | 25 | into method label _BIF code_regex \(DGCP, replaceall_matched begin (B1B2(CP00,CP01), end; 26 | into method label _BIF code_regex \(FLCP, replaceall_matched begin (B1B2(FL10,FL11), end; 27 | into method label _BIF code_regex \(DGVO, replaceall_matched begin (B1B2(DG00,DG01), end; 28 | into method label _BIF code_regex \(BDW, replaceall_matched begin (B1B2(BD10,BD11), end; 29 | into method label _BIF code_regex \(BDL, replaceall_matched begin (B1B2(DL00,DL01), end; 30 | into method label _BST code_regex \(BPR, replaceall_matched begin (B1B2(PR10,PR11), end; 31 | into method label _BST code_regex \(BRC, replaceall_matched begin (B1B2(RC00,RC01), end; 32 | into method label _BST code_regex \(BPV, replaceall_matched begin (B1B2(PV10,PV11), end; 33 | 34 | #EOF 35 | -------------------------------------------------------------------------------- /battery/battery_Lenovo-Y50.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Lenovo-Y50.txt 3 | 4 | # created by RehabMan 2015-05-31 5 | 6 | # works for: 7 | # Lenovo Y50 8 | # Lenovo Y50-70 9 | # Lenovo B50-70 10 | 11 | into device label EC0 code_regex ERIB,\s+16 replace_matched begin ERI0,8,ERI1,8 end; 12 | 13 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 14 | begin 15 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 16 | end; 17 | 18 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 19 | begin 20 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 21 | end; 22 | 23 | # utility methods to read/write buffers from/to EC 24 | into method label RE1B parent_label H_EC remove_entry; 25 | into method label RECB parent_label H_EC remove_entry; 26 | into device label EC0 insert 27 | begin 28 | Method (RE1B, 1, NotSerialized)\n 29 | {\n 30 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 31 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 32 | Return(BYTE)\n 33 | }\n 34 | Method (RECB, 2, Serialized)\n 35 | // Arg0 - offset in bytes from zero-based EC\n 36 | // Arg1 - size of buffer in bits\n 37 | {\n 38 | ShiftRight(Arg1, 3, Arg1)\n 39 | Name(TEMP, Buffer(Arg1) { })\n 40 | Add(Arg0, Arg1, Arg1)\n 41 | Store(0, Local0)\n 42 | While (LLess(Arg0, Arg1))\n 43 | {\n 44 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 45 | Increment(Arg0)\n 46 | Increment(Local0)\n 47 | }\n 48 | Return(TEMP)\n 49 | }\n 50 | end; 51 | 52 | into method label WE1B parent_label H_EC remove_entry; 53 | into method label WECB parent_label H_EC remove_entry; 54 | into device label EC0 insert 55 | begin 56 | Method (WE1B, 2, NotSerialized)\n 57 | {\n 58 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 59 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 60 | Store(Arg1, BYTE)\n 61 | }\n 62 | Method (WECB, 3, Serialized)\n 63 | // Arg0 - offset in bytes from zero-based EC\n 64 | // Arg1 - size of buffer in bits\n 65 | // Arg2 - value to write\n 66 | {\n 67 | ShiftRight(Arg1, 3, Arg1)\n 68 | Name(TEMP, Buffer(Arg1) { })\n 69 | Store(Arg2, TEMP)\n 70 | Add(Arg0, Arg1, Arg1)\n 71 | Store(0, Local0)\n 72 | While (LLess(Arg0, Arg1))\n 73 | {\n 74 | WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n 75 | Increment(Arg0)\n 76 | Increment(Local0)\n 77 | }\n 78 | }\n 79 | end; 80 | 81 | # rename 256-bit 82 | into device label EC0 code_regex (SMD0,)\s+(56) replace_matched begin SMDX,%2,//%1%2 end; 83 | 84 | into method label CFUN code_regex \(SMD0, replaceall_matched begin (RECB(0x64,256), end; 85 | into method label CFUN code_regex Store\s+\(Zero,\s+SMD0\) replaceall_matched begin WECB(0x64,256,Zero) end; 86 | -------------------------------------------------------------------------------- /battery/battery_Lenovo-y510p.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Lenovo-y510p.txt 3 | 4 | # Created by intruder16, 2015-03-12 5 | 6 | # Works for: 7 | # Lenovo IdeaPad y510p 8 | 9 | # Change EC register from 16-bit to 8-bit 10 | 11 | into device label EC0 code_regex ENIB,\s+16 replace_matched begin ENI0,8,ENI1,8 end; 12 | into device label EC0 code_regex ERIB,\s+16 replace_matched begin ERI0,8,ERI1,8 end; 13 | 14 | into method label _TMP code_regex Store\s+\(0x8400,\s+\\_SB\.PCI0\.LPCB\.EC0\.ENIB\) replace_matched 15 | begin 16 | Store(Zero, \\_SB.PCI0.LPCB.EC0.ENI0) Store(0x84, \\_SB.PCI0.LPCB.EC0.ENI1) 17 | end; 18 | 19 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 20 | begin 21 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 22 | end; 23 | 24 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 25 | begin 26 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 27 | end; -------------------------------------------------------------------------------- /battery/battery_Lenovo-y570.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Lenovo-y570.txt 3 | 4 | # created by romanaOne 2014-08-10 5 | # cleaned up and added support for g770 2015-02-13 6 | 7 | # works for: 8 | # Lenovo y570 9 | # Lenovo g770 10 | # Lenovo g470 11 | # Lenovo u460 12 | # Lenovo y550 (per Maksibon) 13 | # Lenovo z560 (per HoaiNhan) 14 | # Lenovo Z460 (per nayeweiyang) 15 | # Lenovo G570 (per Kromsator) 16 | 17 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 18 | into method label B1B2 remove_entry; 19 | into definitionblock code_regex . insert 20 | begin 21 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 22 | end; 23 | 24 | # 16-bit EC 25 | into device label EC0 code_regex ENIB,\s+16 replace_matched begin ENI0,8,ENI1,8 end; 26 | into device label EC0 code_regex ERIB,\s+16 replace_matched begin ERI0,8,ERI1,8 end; 27 | into device label EC0 code_regex BRC0,\s+16 replace_matched begin RC00,8,RC01,8 end; 28 | into device label EC0 code_regex BPV0,\s+16 replace_matched begin PV00,8,PV01,8 end; 29 | 30 | into device label EC0 code_regex BDV0,\s+16 replace_matched begin DV00,8,DV01,8 end; 31 | into device label EC0 code_regex BDC0,\s+16 replace_matched begin DC00,8,DC01,8 end; 32 | 33 | into device label EC0 code_regex BFC0,\s+16 replace_matched begin FC00,8,FC01,8 end; 34 | into device label EC0 code_regex BAC0,\s+16 replace_matched begin AC00,8,AC01,8 end; 35 | 36 | # Fix methods 37 | into method label _TMP code_regex Store\s+\(0x8400,\s+\\_SB\.PCI0\.LPCB\.EC0\.ENIB\) replace_matched 38 | begin 39 | Store(Zero, \\_SB.PCI0.LPCB.EC0.ENI0) Store(0x84, \\_SB.PCI0.LPCB.EC0.ENI1) 40 | end; 41 | into method label FANG code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 42 | begin 43 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 44 | end; 45 | into method label FANW code_regex Store\s+\(Arg0,\s+ERIB\) replace_matched 46 | begin 47 | Store(Arg0, ERI0) Store(ShiftRight(Arg0, 8), ERI1) 48 | end; 49 | 50 | into method label _BST code_regex \(\^\^EC0\.BRC0, replaceall_matched begin (B1B2(^^EC0.RC00,^^EC0.RC01), end; 51 | into method label _BST code_regex \(\^\^EC0\.BPV0, replaceall_matched begin (B1B2(^^EC0.PV00,^^EC0.PV01), end; 52 | into method label _BST code_regex \(\^\^EC0\.BAC0, replaceall_matched begin (B1B2(^^EC0.AC00,^^EC0.AC01), end; 53 | into method label _BIF code_regex \(\^\^EC0\.BDC0, replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01), end; 54 | into method label _BIF code_regex \(\^\^EC0\.BDV0, replaceall_matched begin (B1B2(^^EC0.DV00,^^EC0.DV01), end; 55 | into method label _BIF code_regex \(\^\^EC0\.BFC0, replaceall_matched begin (B1B2(^^EC0.FC00,^^EC0.FC01), end; 56 | 57 | into method label _BIF code_regex \(\^\^EC0\.BDC0\) replaceall_matched begin (B1B2(^^EC0.DC00,^^EC0.DC01)) end; 58 | -------------------------------------------------------------------------------- /battery/battery_Medion-Akoya-P6630.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Medion-Akoya-P6630.txt 3 | 4 | # Created by Blu_Dread 2014-11-29 5 | 6 | # works for: 7 | # Medion Akoya P6630 8 | 9 | # convert two 8-bit registers to 16-bit 10 | into method label B1B2 remove_entry; 11 | into definitionblock code_regex . insert 12 | begin 13 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 14 | end; 15 | 16 | # has non-zero SyncLevel in Mutex objects 17 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 18 | 19 | # _PLD is supposed to return a variable length Package of Buffers 20 | into_all all code_regex (Name\s*\(_PLD,\s*)Buffer(\s\([^\)].*\)[^\)]*) replaceall_matched 21 | begin 22 | %1Package() { Buffer%2 } 23 | end; 24 | 25 | # 16-bit conversions 26 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSDC,\s+16, replace_matched begin DC00,8,DC01,8, end; 27 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSDV,\s+16, replace_matched begin DV00,8,DV01,8, end; 28 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSSN,\s+16 replace_matched begin SN00,8,SN01,8 end; 29 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSRC,\s+16, replace_matched begin RC00,8,RC01,8, end; 30 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSFC,\s+16, replace_matched begin FC00,8,FC01,8, end; 31 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSAC,\s+16, replace_matched begin AC00,8,AC01,8, end; 32 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSVO,\s+16, replace_matched begin VO00,8,VO01,8, end; 33 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSPE,\s+16, replace_matched begin PE00,8,PE01,8, end; 34 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSCU,\s+16, replace_matched begin CU00,8,CU01,8, end; 35 | into scope label _SB.PCI0.SBRG.EC0 code_regex BSTV,\s+16 replace_matched begin TV00,8,TV01,8 end; 36 | 37 | into method label GBIF code_regex \(BSDC, replaceall_matched begin (B1B2(DC00,DC01), end; 38 | into method label GBIF code_regex \(BSDV, replaceall_matched begin (B1B2(DV00,DV01), end; 39 | into method label GBIF code_regex \(BSSN, replaceall_matched begin (B1B2(SN00,SN01), end; 40 | into method label GBIF code_regex \(BSFC, replaceall_matched begin (B1B2(FC00,FC01), end; 41 | 42 | into method label GBST code_regex \(BSRC, replaceall_matched begin (B1B2(RC00,RC01), end; 43 | into method label GBST code_regex \(BSFC, replaceall_matched begin (B1B2(FC00,FC01), end; 44 | into method label GBST code_regex \(BSAC, replaceall_matched begin (B1B2(AC00,AC01), end; 45 | into method label GBST code_regex \(BSVO, replaceall_matched begin (B1B2(VO00,VO01), end; 46 | 47 | 48 | # utility methods to read/write buffers from/to EC 49 | into method label RE1B parent_label _SB.PCI0.SBRG.EC0 remove_entry; 50 | into method label RECB parent_label _SB.PCI0.SBRG.EC0 remove_entry; 51 | into scope label _SB.PCI0.SBRG.EC0 insert 52 | begin 53 | Method (RE1B, 1, NotSerialized)\n 54 | {\n 55 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 56 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 57 | Return(BYTE)\n 58 | }\n 59 | Method (RECB, 2, Serialized)\n 60 | // Arg0 - offset in bytes from zero-based EC\n 61 | // Arg1 - size of buffer in bits\n 62 | {\n 63 | ShiftRight(Arg1, 3, Arg1)\n 64 | Name(TEMP, Buffer(Arg1) { })\n 65 | Add(Arg0, Arg1, Arg1)\n 66 | Store(0, Local0)\n 67 | While (LLess(Arg0, Arg1))\n 68 | {\n 69 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 70 | Increment(Arg0)\n 71 | Increment(Local0)\n 72 | }\n 73 | Return(TEMP)\n 74 | }\n 75 | end; 76 | 77 | # 128-bit registers 78 | into scope label _SB.PCI0.SBRG.EC0 code_regex (BSCH),\s+(128) replace_matched begin BSCX,%2,//%1%2 end; 79 | into scope label _SB.PCI0.SBRG.EC0 insert begin Method (BSC0, 0, Serialized) { Return(RECB(0xE0,128)) } end; 80 | into scope label _SB.PCI0.SBRG.EC0 code_regex (BSDN),\s+(128) replace_matched begin BSDY,%2,//%1%2 end; 81 | into scope label _SB.PCI0.SBRG.EC0 insert begin Method (BSD0, 0, Serialized) { Return(RECB(0xE0,128)) } end; 82 | into scope label _SB.PCI0.SBRG.EC0 code_regex (BSMN),\s+(128) replace_matched begin BSMZ,%2,//%1%2 end; 83 | into scope label _SB.PCI0.SBRG.EC0 insert begin Method (BSM0, 0, Serialized) { Return(RECB(0xE0,128)) } end; 84 | 85 | into method label GBIF code_regex \(BSCH, replaceall_matched begin (RECB(0xE0,128), end; 86 | into method label GBIF code_regex \(BSDN, replaceall_matched begin (RECB(0xE0,128), end; 87 | into method label GBIF code_regex \(BSMN, replaceall_matched begin (RECB(0xE0,128), end; 88 | 89 | -------------------------------------------------------------------------------- /battery/battery_Microxperts-u731ga1.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Microxperts-u731ga1.txt 3 | 4 | # Created by maximmurmansk 2016-01-04 5 | 6 | # works for: 7 | # Microxperts u731ga 8 | # Tuxedo Infinitybook 13v2 (per TheFox88) 9 | # perhaps other Clevo rebrands 10 | 11 | # 16-bit registers 12 | into device label H_EC code_regex BDCA,\s+16 replace_matched begin DC00,8,DC01,8 end; 13 | into device label H_EC code_regex BPVO,\s+16 replace_matched begin PV00,8,PV01,8 end; 14 | into device label H_EC code_regex PRRL,\s+16 replace_matched begin RR00,8,RR01,8 end; 15 | into device label H_EC code_regex BRCA,\s+16 replace_matched begin RC00,8,RC01,8 end; 16 | into device label H_EC code_regex BLFC,\s+16 replace_matched begin LF00,8,LF01,8 end; 17 | into device label H_EC code_regex BSTA,\s+16 replace_matched begin ST00,8,ST01,8 end; 18 | into device label H_EC code_regex BDVO,\s+16 replace_matched begin DV00,8,DV01,8 end; 19 | into device label H_EC code_regex BACU,\s+16 replace_matched begin AC00,8,AC01,8 end; 20 | 21 | # fix 16-bit methods 22 | into method label _BIF code_regex \(BDCA, replaceall_matched begin (B1B2(DC00,DC01), end; 23 | into method label _BST code_regex \(BPVO, replaceall_matched begin (B1B2(PV00,PV01), end; 24 | into method label _BST code_regex \(BRCA, replaceall_matched begin (B1B2(RC00,RC01), end; 25 | into method label _BIF code_regex \(BLFC, replaceall_matched begin (B1B2(LF00,LF01), end; 26 | into method label _BST code_regex \(BSTA, replaceall_matched begin (B1B2(ST00,ST01), end; 27 | into method label _BIF code_regex \(BDVO, replaceall_matched begin (B1B2(DV00,DV01), end; 28 | into method label _BST code_regex \(BACU, replaceall_matched begin (B1B2(AC00,AC01), end; 29 | 30 | # method to read from 16-bit fields 31 | into method label B1B2 remove_entry; 32 | into definitionblock code_regex . insert 33 | begin 34 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 35 | end; 36 | 37 | 38 | -------------------------------------------------------------------------------- /battery/battery_Partaker_G3.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Partaker_G3.txt 3 | 4 | # created by dodvidp123 2016-10-06 5 | 6 | # works for: 7 | # Partaker G3 (Broadwell) 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | into device label H_EC code_regex DC2B,\s+16, replace_matched begin DCB0,8,DCB1,8, end; 16 | into device label H_EC code_regex FC2B,\s+16, replace_matched begin FCB0,8,FCB1,8, end; 17 | into device label H_EC code_regex DV2B,\s+16, replace_matched begin DVB0,8,DVB1,8, end; 18 | into device label H_EC code_regex CC2B,\s+16, replace_matched begin CCB0,8,CCB1,8, end; 19 | into device label H_EC code_regex RC2B,\s+16, replace_matched begin RCB0,8,RCB1,8, end; 20 | into device label H_EC code_regex CV2B,\s+16 replace_matched begin CVB0,8,CVB1,8, end; 21 | 22 | into method label _BIF code_regex \(DC2B, replaceall_matched begin (B1B2(DCB0,DCB1), end; 23 | into method label _BIF code_regex \(FC2B, replaceall_matched begin (B1B2(FCB0,FCB1), end; 24 | into method label _BIF code_regex \(DV2B, replaceall_matched begin (B1B2(DVB0,DVB1), end; 25 | into method label _BST code_regex \(CC2B, replaceall_matched begin (B1B2(CCB0,CCB1), end; 26 | into method label _BST code_regex \(RC2B, replaceall_matched begin (B1B2(RCB0,RCB1), end; 27 | into method label _BST code_regex \(CV2B, replaceall_matched begin (B1B2(CVB0,CVB1), end; 28 | 29 | into device label H_EC code_regex (SMBD,)\s+(256) replace_matched begin SMBX,%2,//%1%2 end; 30 | 31 | # disable second battery object 32 | 33 | into method label _STA parent_label BAT2 replace_content begin Return(0) end; 34 | 35 | -------------------------------------------------------------------------------- /battery/battery_Razer-Blade-2014.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Razer-Blade-2014.txt 3 | 4 | # created by sidelia 2016-01-17 5 | # changes for Razer Blade Stealth (Kaby Lake) by BlenderSleuth (minor fixes by RehabMan) 6 | 7 | # works for: 8 | # Razer Blade (2014) 9 | # Razer Blade Stealth (Kaby Lake), per BlenderSleuth 10 | # Razer Blade (14", late 2016) 11 | # Razer Blade Pro (2017) 12 | # Razer Blade 15 (2018), per JomanJi/blodtanner 13 | 14 | into method label B1B2 remove_entry; 15 | into definitionblock code_regex . insert 16 | begin 17 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 18 | end; 19 | 20 | into device label EC0 code_regex BIF1,\s+16, replace_matched begin IF10,8,IF11,8, end; 21 | into device label EC0 code_regex BIF2,\s+16, replace_matched begin IF20,8,IF21,8, end; 22 | into device label EC0 code_regex BIF3,\s+16, replace_matched begin IF30,8,IF31,8, end; 23 | into device label EC0 code_regex BIF4,\s+16, replace_matched begin IF40,8,IF41,8, end; 24 | 25 | into device label EC0 code_regex BST0,\s+16, replace_matched begin ST00,8,ST01,8, end; 26 | into device label EC0 code_regex BST1,\s+16, replace_matched begin ST10,8,ST11,8, end; 27 | into device label EC0 code_regex BST2,\s+16, replace_matched begin ST20,8,ST21,8, end; 28 | into device label EC0 code_regex BST3,\s+16, replace_matched begin ST30,8,ST31,8, end; 29 | 30 | into method label _BIF code_regex \^\^EC0\.BIF1, replaceall_matched begin B1B2(^^EC0.IF10,^^EC0.IF11), end; 31 | into method label _BIF code_regex \^\^EC0\.BIF2, replaceall_matched begin B1B2(^^EC0.IF20,^^EC0.IF21), end; 32 | into method label _BIF code_regex \^\^EC0\.BIF3, replaceall_matched begin B1B2(^^EC0.IF30,^^EC0.IF31), end; 33 | into method label _BIF code_regex \^\^EC0\.BIF4, replaceall_matched begin B1B2(^^EC0.IF40,^^EC0.IF41), end; 34 | 35 | into method label _BST code_regex \^\^EC0\.BST0, replaceall_matched begin B1B2(^^EC0.ST00,^^EC0.ST01), end; 36 | into method label _BST code_regex \^\^EC0\.BST1, replaceall_matched begin B1B2(^^EC0.ST10,^^EC0.ST11), end; 37 | into method label _BST code_regex \^\^EC0\.BST2, replaceall_matched begin B1B2(^^EC0.ST20,^^EC0.ST21), end; 38 | into method label _BST code_regex \^\^EC0\.BST3, replaceall_matched begin B1B2(^^EC0.ST30,^^EC0.ST31), end; 39 | 40 | # added for Razer Blade 15 (2018), per JomanJi 41 | into device label EC0 code_regex BIF0,\s+16, replace_matched begin IF00,8,IF01,8, end; 42 | into method label _BIF code_regex \(\^\^EC0.BIF0, replaceall_matched begin (B1B2(\^\^EC0.IF00,\^\^EC0.IF01), end; 43 | 44 | # utility methods to read/write buffers from/to EC 45 | into method label RE1B parent_label EC0 remove_entry; 46 | into method label RECB parent_label EC0 remove_entry; 47 | into device label EC0 insert 48 | begin 49 | Method (RE1B, 1, NotSerialized)\n 50 | {\n 51 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 52 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 53 | Return(BYTE)\n 54 | }\n 55 | Method (RECB, 2, Serialized)\n 56 | // Arg0 - offset in bytes from zero-based EC\n 57 | // Arg1 - size of buffer in bits\n 58 | {\n 59 | ShiftRight(Add(Arg1,7), 3, Arg1)\n 60 | Name(TEMP, Buffer(Arg1) { })\n 61 | Add(Arg0, Arg1, Arg1)\n 62 | Store(0, Local0)\n 63 | While (LLess(Arg0, Arg1))\n 64 | {\n 65 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 66 | Increment(Arg0)\n 67 | Increment(Local0)\n 68 | }\n 69 | Return(TEMP)\n 70 | }\n 71 | end; 72 | 73 | # buffer fields 74 | into device label EC0 code_regex (ECCM,)\s+(256) replace_matched begin ECCX,%2,//%1%2 end; 75 | into method label _BIF code_regex \(\^\^EC0.ECCM, replaceall_matched begin (^^EC0.RECB(0x60,256), end; 76 | 77 | -------------------------------------------------------------------------------- /battery/battery_Razer-Blade-Pro.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Razer-Blade-Pro.txt 3 | 4 | # created by bayz 2016-02-23 5 | 6 | # works for: 7 | # RazerBlade Pro 17 8 | 9 | # utility methods for 16bit and 32bit registers 10 | into method label B1B2 remove_entry; 11 | into definitionblock code_regex . insert 12 | begin 13 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 14 | end; 15 | 16 | # 16-bit Registers 17 | into device label H_EC code_regex B1DC,\s+16 replace_matched begin BDC0,8,BDC1,8 end; 18 | into device label H_EC code_regex B1FC,\s+16 replace_matched begin BFC0,8,BFC1,8 end; 19 | into device label H_EC code_regex B1RC,\s+16 replace_matched begin BRC0,8,BRC1,8 end; 20 | into device label H_EC code_regex B1FV,\s+16 replace_matched begin BFV0,8,BFV1,8 end; 21 | into device label H_EC code_regex B1DG,\s+16 replace_matched begin BDG0,8,BDG1,8 end; 22 | into device label H_EC code_regex B1CR,\s+16 replace_matched begin BCR0,8,BCR1,8 end; 23 | 24 | # fix 16-bit Methods 25 | into method label _BIF code_regex \(B1DC, replaceall_matched begin (B1B2(BDC0,BDC1), end; 26 | into method label _BIF code_regex \(B1FC replaceall_matched begin (B1B2(BFC0,BFC1) end; 27 | into method label _BST code_regex B1FC, replaceall_matched begin B1B2(BFC0,BFC1), end; 28 | into method label _BST code_regex \(B1RC, replaceall_matched begin (B1B2(BRC0,BRC1), end; 29 | into method label BATS code_regex \(B1RC, replaceall_matched begin (B1B2(BRC0,BRC1), end; 30 | into method label _BST code_regex \(B1FV, replaceall_matched begin (B1B2(BFV0,BFV1), end; 31 | into method label _BIF code_regex \(B1DG, replaceall_matched begin (B1B2(BDG0,BDG1), end; 32 | into method label _BST code_regex \(B1CR, replaceall_matched begin (B1B2(BCR0,BCR1), end; 33 | -------------------------------------------------------------------------------- /battery/battery_Samsung-NP300E5K-XF3BR.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung-NP300E5K-XF3BR.txt 3 | 4 | # created by thiagobr 2016-12-17 5 | 6 | # works for: 7 | # Samsung NP300E5K-XF3BR 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | into scope label _SB.PCI0.LPCB.H_EC code_regex BTPC,\s+16 replace_matched begin TPC0,8,TPC1,8 end; 16 | into scope label _SB.PCI0.LPCB.H_EC code_regex CYLC,\s+16 replace_matched begin YLC0,8,YLC1,8 end; 17 | 18 | into method label _BTP code_regex Store\s+\(Local0,\s+\^\^PCI0\.LPCB\.H_EC\.BTPC\) replaceall_matched 19 | begin 20 | Store (Local0, ^^PCI0.LPCB.H_EC.TPC0)\n 21 | Store (ShiftRight(Local0,8), ^^PCI0.LPCB.H_EC.TPC1)\n 22 | end; 23 | 24 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.CYLC replaceall_matched begin (B1B2(^^PCI0.LPCB.H_EC.YLC0,^^PCI0.LPCB.H_EC.YLC1) end; 25 | 26 | into method label B1B4 remove_entry; 27 | into definitionblock code_regex . insert 28 | begin 29 | Method (B1B4, 4, NotSerialized)\n 30 | {\n 31 |     Store(Arg3, Local0)\n 32 |     Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 33 |     Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 34 |     Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 35 |     Return(Local0)\n 36 | }\n 37 | end; 38 | 39 | into scope label _SB.PCI0.LPCB.H_EC code_regex B1RR,\s+32 replace_matched begin R1R0,8,R1R1,8,R1R2,8,R1R3,8 end; 40 | into scope label _SB.PCI0.LPCB.H_EC code_regex B1PV,\s+32 replace_matched begin P1V0,8,P1V1,8,P1V2,8,P1V3,8 end; 41 | into scope label _SB.PCI0.LPCB.H_EC code_regex B1AF,\s+32 replace_matched begin A1F0,8,A1F1,8,A1F2,8,A1F3,8 end; 42 | into scope label _SB.PCI0.LPCB.H_EC code_regex B1VL,\s+32 replace_matched begin V1L0,8,V1L1,8,V1L2,8,V1L3,8 end; 43 | 44 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1RR replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.R1R0,^^PCI0.LPCB.H_EC.R1R1,^^PCI0.LPCB.H_EC.R1R2,^^PCI0.LPCB.H_EC.R1R3) end; 45 | 46 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1PV replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.P1V0,^^PCI0.LPCB.H_EC.P1V1,^^PCI0.LPCB.H_EC.P1V2,^^PCI0.LPCB.H_EC.P1V3) end; 47 | 48 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1AF replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.A1F0,^^PCI0.LPCB.H_EC.A1F1,^^PCI0.LPCB.H_EC.A1F2,^^PCI0.LPCB.H_EC.A1F3) end; 49 | 50 | into method label RPTS code_regex \(\\\_SB\.PCI0\.LPCB\.H_EC\.B1AF replaceall_matched begin (B1B4(\\\_SB.PCI0.LPCB.H_EC.A1F0,\\\_SB.PCI0.LPCB.H_EC.A1F1,\\\_SB.PCI0.LPCB.H_EC.A1F2,\\\_SB.PCI0.LPCB.H_EC.A1F3) end; 51 | into method label RWAK code_regex \(\\\_SB\.PCI0\.LPCB\.H_EC\.B1AF replaceall_matched begin (B1B4(\\\_SB.PCI0.LPCB.H_EC.A1F0,\\\_SB.PCI0.LPCB.H_EC.A1F1,\\\_SB.PCI0.LPCB.H_EC.A1F2,\\\_SB.PCI0.LPCB.H_EC.A1F3) end; 52 | 53 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1VL replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.V1L0,^^PCI0.LPCB.H_EC.V1L1,^^PCI0.LPCB.H_EC.V1L2,^^PCI0.LPCB.H_EC.V1L3) end; 54 | -------------------------------------------------------------------------------- /battery/battery_Samsung-NP470R5E.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung-NP470R5E.txt 3 | 4 | # created by daniel86bm 2013-12-07 5 | 6 | # works for: 7 | # Samsung NP470R5E 8 | # Samsung NP370R5E 9 | # Samsung ATIV 700T 10 | # Samsung NP-RC530-S02RU (per artar94) 11 | 12 | into method label B1B2 remove_entry; 13 | into definitionblock code_regex . insert 14 | begin 15 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 16 | end; 17 | 18 | # 16-bit EC registers to 8-bit 19 | 20 | into device label H_EC code_regex BTPC,\s+16 replace_matched begin BPC0,8,BPC1,8 end; 21 | into device label H_EC code_regex CYLC,\s+16 replace_matched begin CYC0,8,CYC1,8 end; 22 | 23 | into method label B1B4 remove_entry; 24 | into definitionblock code_regex . insert 25 | begin 26 | Method (B1B4, 4, NotSerialized)\n 27 | {\n 28 | Store(Arg3, Local0)\n 29 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 30 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 31 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 32 | Return(Local0)\n 33 | }\n 34 | end; 35 | 36 | # 32-bit EC registers 37 | 38 | into device label H_EC code_regex B1RR,\s+32 replace_matched begin BRR0,8,BRR1,8,BRR2,8,BRR3,8 end; 39 | into device label H_EC code_regex B1PV,\s+32 replace_matched begin BPV0,8,BPV1,8,BPV2,8,BPV3,8 end; 40 | into device label H_EC code_regex B1AF,\s+32 replace_matched begin BAF0,8,BAF1,8,BAF2,8,BAF3,8 end; 41 | into device label H_EC code_regex B1VL,\s+32 replace_matched begin BVL0,8,BVL1,8,BVL2,8,BVL3,8 end; 42 | 43 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1RR, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BRR0,^^PCI0.LPCB.H_EC.BRR1,^^PCI0.LPCB.H_EC.BRR2,^^PCI0.LPCB.H_EC.BRR3), end; 44 | 45 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1PV, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BPV0,^^PCI0.LPCB.H_EC.BPV1,^^PCI0.LPCB.H_EC.BPV2,^^PCI0.LPCB.H_EC.BPV3), end; 46 | 47 | into method label _PTS code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 48 | 49 | into method label _WAK code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 50 | 51 | into method label PNOT code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 52 | 53 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BAF0,^^PCI0.LPCB.H_EC.BAF1,^^PCI0.LPCB.H_EC.BAF2,^^PCI0.LPCB.H_EC.BAF3), end; 54 | 55 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1VL, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BVL0,^^PCI0.LPCB.H_EC.BVL1,^^PCI0.LPCB.H_EC.BVL2,^^PCI0.LPCB.H_EC.BVL3), end; 56 | 57 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.CYLC, replace_matched begin (B1B2(^^PCI0.LPCB.H_EC.CYC0,^^PCI0.LPCB.H_EC.CYC1), end; 58 | 59 | into method label _BTP code_regex Store\s\((.*),\s\^\^PCI0\.LPCB\.H_EC\.BTPC\) replace_matched 60 | begin 61 | Store(%1, ^^PCI0.LPCB.H_EC.BPC0) Store(ShiftRight(%1,8), ^^PCI0.LPCB.H_EC.BPC1) 62 | end; 63 | -------------------------------------------------------------------------------- /battery/battery_Samsung-RF411.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung-RF411.txt 3 | 4 | # created by RehabMan 9/23/2013 5 | # created originally for srsr333 6 | 7 | # works for: 8 | # Samsung RF411-S03SG 9 | # Samsung R780 10 | # Samsung RC530S04PL 11 | 12 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 13 | 14 | into method label B1B4 remove_entry; 15 | into definitionblock code_regex . insert 16 | begin 17 | Method (B1B4, 4, NotSerialized)\n 18 | {\n 19 | Store(Arg3, Local0)\n 20 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 21 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 22 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 23 | Return(Local0)\n 24 | }\n 25 | end; 26 | 27 | # 32-bit EC registers 28 | 29 | into device label H_EC code_regex B1RR,\s+32 replace_matched begin BRR0,8,BRR1,8,BRR2,8,BRR3,8 end; 30 | into device label H_EC code_regex B1PV,\s+32 replace_matched begin BPV0,8,BPV1,8,BPV2,8,BPV3,8 end; 31 | into device label H_EC code_regex B1AF,\s+32 replace_matched begin BAF0,8,BAF1,8,BAF2,8,BAF3,8 end; 32 | into device label H_EC code_regex B1VL,\s+32 replace_matched begin BVL0,8,BVL1,8,BVL2,8,BVL3,8 end; 33 | 34 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1AF, replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.BAF0,^^PCI0.LPCB.H_EC.BAF1,^^PCI0.LPCB.H_EC.BAF2,^^PCI0.LPCB.H_EC.BAF3), end; 35 | into method label _BIF code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1VL, replaceall_matched begin (B1B4(^^PCI0.LPCB.H_EC.BVL0,^^PCI0.LPCB.H_EC.BVL1,^^PCI0.LPCB.H_EC.BVL2,^^PCI0.LPCB.H_EC.BVL3), end; 36 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1RR, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BRR0,^^PCI0.LPCB.H_EC.BRR1,^^PCI0.LPCB.H_EC.BRR2,^^PCI0.LPCB.H_EC.BRR3), end; 37 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1PV, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BPV0,^^PCI0.LPCB.H_EC.BPV1,^^PCI0.LPCB.H_EC.BPV2,^^PCI0.LPCB.H_EC.BPV3), end; 38 | 39 | into method label _PTS code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 40 | into method label _WAK code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 41 | into method label PNOT code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 42 | 43 | -------------------------------------------------------------------------------- /battery/battery_Samsung-Series3-NP300.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung-Series3-NP300.txt 3 | 4 | # created by RehabMan 8/20/2013 5 | # created originally for jack7676 6 | 7 | # works for: 8 | # Samsung Series 3 NP300E5E 9 | # Samsung NP700Z5C-S02UB 10 | # Samsung Q430 11 | # Samsung R480 (NP-R480-JS04AR) 12 | # Samsung Series 5 NP530U3B 13 | # Samsung Series 3 NP300E5C-A09US 14 | # Samsung NP270E5E (per vocalico) 15 | # Samsung NP900X3E (per bjornsnoen) 16 | 17 | into method label B1B2 remove_entry; 18 | into definitionblock code_regex . insert 19 | begin 20 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 21 | end; 22 | 23 | # 16-bit EC registers to 8-bit 24 | 25 | into device label H_EC code_regex B1RP,\s+16 replace_matched begin BRP0,8,BRP1,8 end; 26 | into device label H_EC code_regex B1RA,\s+16 replace_matched begin BRA0,8,BRA1,8 end; 27 | into device label H_EC code_regex B1PR,\s+16 replace_matched begin BPR0,8,BPR1,8 end; 28 | into device label H_EC code_regex B1VO,\s+16 replace_matched begin BVO0,8,BVO1,8 end; 29 | into device label H_EC code_regex B1DA,\s+16 replace_matched begin BDA0,8,BDA1,8 end; 30 | into device label H_EC code_regex B1DF,\s+16 replace_matched begin BDF0,8,BDF1,8 end; 31 | into device label H_EC code_regex B1DV,\s+16 replace_matched begin BDV0,8,BDV1,8 end; 32 | into device label H_EC code_regex B1DL,\s+16 replace_matched begin BDL0,8,BDL1,8 end; 33 | into device label H_EC code_regex B1SE,\s+16 replace_matched begin BSE0,8,BSE1,8 end; 34 | into device label H_EC code_regex B1CR,\s+16 replace_matched begin BCR0,8,BCR1,8 end; 35 | into device label H_EC code_regex B1TM,\s+16 replace_matched begin BTM0,8,BTM1,8 end; 36 | into device label H_EC code_regex BTPC,\s+16 replace_matched begin BPC0,8,BPC1,8 end; 37 | into device label H_EC code_regex CYLC,\s+16 replace_matched begin CYC0,8,CYC1,8 end; 38 | 39 | 40 | into method label _BIF code_regex \(B1DA, replaceall_matched begin (B1B2(BDA0,BDA1), end; 41 | into method label _BIF code_regex \(B1DF, replaceall_matched begin (B1B2(BDF0,BDF1), end; 42 | into method label _BIF code_regex \(B1DV, replaceall_matched begin (B1B2(BDV0,BDV1), end; 43 | into method label _BIF code_regex \(B1DL, replaceall_matched begin (B1B2(BDL0,BDL1), end; 44 | 45 | into method label _BIX code_regex \(B1DA, replaceall_matched begin (B1B2(BDA0,BDA1), end; 46 | into method label _BIX code_regex \(B1DF, replaceall_matched begin (B1B2(BDF0,BDF1), end; 47 | into method label _BIX code_regex \(B1DV, replaceall_matched begin (B1B2(BDV0,BDV1), end; 48 | into method label _BIX code_regex \(B1DL, replaceall_matched begin (B1B2(BDL0,BDL1), end; 49 | into method label _BIX code_regex \(CYLC, replaceall_matched begin (B1B2(CYC0,CYC1), end; 50 | 51 | into method label _BST code_regex \(B1PR, replaceall_matched begin (B1B2(BPR0,BPR1), end; 52 | into method label _BST code_regex \(B1RA, replaceall_matched begin (B1B2(BRA0,BRA1), end; 53 | into method label _BST code_regex \(B1VO, replaceall_matched begin (B1B2(BVO0,BVO1), end; 54 | 55 | into method label _PTS code_regex \(\\_SB\.PCI0\.LPCB\.H_EC\.B1DF, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.H_EC.BDF0,\\_SB.PCI0.LPCB.H_EC.BDF1), end; 56 | into method label _WAK code_regex \(\\_SB\.PCI0\.LPCB\.H_EC\.B1DF, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.H_EC.BDF0,\\_SB.PCI0.LPCB.H_EC.BDF1), end; 57 | 58 | into method label _BTP code_regex Store\s+\(Local0,\s+BTPC\) replaceall_matched 59 | begin 60 | Store(Local0, BPC0)\n 61 | Store(ShiftRight(Local0, 8),BPC1)\n 62 | end; 63 | 64 | -------------------------------------------------------------------------------- /battery/battery_Samsung-r528.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung-r528.txt 3 | 4 | # created by _e2_ 2013-12-07 5 | # minor corrections by RehabMan 6 | 7 | # works for: 8 | # Samsung r528 DT02EE 9 | # Samsung r540 (r530/r730 assumed, per Moorre) 10 | # Samsung r520/r522/r620 (per Mooore) 11 | 12 | into method label B1B2 remove_entry; 13 | into definitionblock code_regex . insert 14 | begin 15 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 16 | end; 17 | 18 | # 16-bit registers 19 | 20 | # because my data fields are named with B1, it means that I need to change 1 to something else 21 | # so B1RA we will change to IRA0 and IRA1 and so on... 22 | 23 | into device label H_EC code_regex B1RA,\s+16, replace_matched begin IRA0,8,IRA1,8, end; 24 | into device label H_EC code_regex B1PR,\s+16, replace_matched begin IPR0,8,IPR1,8, end; 25 | into device label H_EC code_regex B1VO,\s+16, replace_matched begin IVO0,8,IVO1,8, end; 26 | into device label H_EC code_regex B1DA,\s+16, replace_matched begin IDA0,8,IDA1,8, end; 27 | into device label H_EC code_regex B1DF,\s+16, replace_matched begin IDF0,8,IDF1,8, end; 28 | into device label H_EC code_regex B1DV,\s+16, replace_matched begin IDV0,8,IDV1,8, end; 29 | into device label H_EC code_regex B1DL,\s+16, replace_matched begin IDL0,8,IDL1,8, end; 30 | 31 | # fix 16-bit methods 32 | into method label _BIF code_regex \(B1DA, replaceall_matched begin (B1B2(IDA0,IDA1), end; 33 | into method label _BIF code_regex \(B1DF, replaceall_matched begin (B1B2(IDF0,IDF1), end; 34 | into method label _BIF code_regex \(B1DV, replaceall_matched begin (B1B2(IDV0,IDV1), end; 35 | into method label _BIF code_regex \(B1DL, replaceall_matched begin (B1B2(IDL0,IDL1), end; 36 | into method label _BST code_regex \(B1PR, replaceall_matched begin (B1B2(IPR0,IPR1), end; 37 | into method label _BST code_regex \(B1RA, replaceall_matched begin (B1B2(IRA0,IRA1), end; 38 | into method label _BST code_regex \(B1VO, replaceall_matched begin (B1B2(IVO0,IVO1), end; 39 | 40 | 41 | # this "\_SB.PCI0.LPCB.H_EC.B1DF," we will change to this "B1B2(\_SB.PCI0.LPCB.H_EC.IDF0,\_SB.PCI0.LPCB.H_EC.IDF1)," 42 | into method label _PTS code_regex \\_SB\.PCI0\.LPCB\.H_EC\.B1DF, replaceall_matched begin B1B2(\\_SB.PCI0.LPCB.H_EC.IDF0,\\_SB.PCI0.LPCB.H_EC.IDF1), end; 43 | into method label _WAK code_regex \\_SB\.PCI0\.LPCB\.H_EC\.B1DF, replaceall_matched begin B1B2(\\_SB.PCI0.LPCB.H_EC.IDF0,\\_SB.PCI0.LPCB.H_EC.IDF1), end; 44 | -------------------------------------------------------------------------------- /battery/battery_Samsung_NP730U3E_X04IT.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Samsung_NP730U3E_X04IT.txt 3 | 4 | # created by trik - 2014-08-05 5 | 6 | # Works for: 7 | # Samsung Ativ Book 7 8 | # Samsung ATIV Book 8 (per Vairn) 9 | # Samsung Ativ Book 6 NP670Z5E-XD2BR 10 | 11 | into method label B1B2 remove_entry; 12 | into definitionblock code_regex . insert 13 | begin 14 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 15 | end; 16 | 17 | # 16-bit EC registers to 8-bit 18 | 19 | into device label H_EC code_regex BTPC,\s+16 replace_matched begin BPC0,8,BPC1,8 end; 20 | into device label H_EC code_regex CYLC,\s+16 replace_matched begin CYC0,8,CYC1,8 end; 21 | 22 | # End 16-bit EC registers to 8-bit 23 | 24 | into method label B1B4 remove_entry; 25 | into definitionblock code_regex . insert 26 | begin 27 | Method (B1B4, 4, NotSerialized)\n 28 | {\n 29 | Store(Arg3, Local0)\n 30 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 31 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 32 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 33 | Return(Local0)\n 34 | }\n 35 | end; 36 | 37 | # 32-bit EC registers to 8-bit 38 | 39 | into device label H_EC code_regex B1RR,\s+32 replace_matched begin BRR0,8,BRR1,8,BRR2,8,BRR3,8 end; 40 | into device label H_EC code_regex B1PV,\s+32 replace_matched begin BPV0,8,BPV1,8,BPV2,8,BPV3,8 end; 41 | into device label H_EC code_regex B1AF,\s+32 replace_matched begin BAF0,8,BAF1,8,BAF2,8,BAF3,8 end; 42 | into device label H_EC code_regex B1VL,\s+32 replace_matched begin BVL0,8,BVL1,8,BVL2,8,BVL3,8 end; 43 | into device label H_EC code_regex B2RR,\s+32 replace_matched begin CRR0,8,CRR1,8,CRR2,8,CRR3,8 end; 44 | into device label H_EC code_regex B2PV,\s+32 replace_matched begin CPV0,8,CPV1,8,CPV2,8,CPV3,8 end; 45 | into device label H_EC code_regex B2AF,\s+32 replace_matched begin CAF0,8,CAF1,8,CAF2,8,CAF3,8 end; 46 | into device label H_EC code_regex B2VL,\s+32 replace_matched begin CVL0,8,CVL1,8,CVL2,8,CVL3,8 end; 47 | 48 | # End 32-bit EC registers to 8-bit 49 | 50 | 51 | # 256-bit EC registers 52 | 53 | into device label H_EC code_regex (SBFR,)\s+(256) replace_matched begin SBFX,%2,//%1%2 end; 54 | 55 | # End 256-bit EC registers 56 | 57 | into method label _BTP code_regex Store\s\((.*),\s\^\^PCI0\.LPCB\.H_EC\.BTPC\) replace_matched 58 | begin 59 | Store(%1, ^^PCI0.LPCB.H_EC.BPC0) Store(ShiftRight(%1,8), ^^PCI0.LPCB.H_EC.BPC1) 60 | end; 61 | 62 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.CYLC, replace_matched begin (B1B2(^^PCI0.LPCB.H_EC.CYC0,^^PCI0.LPCB.H_EC.CYC1), end; 63 | 64 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1RR, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BRR0,^^PCI0.LPCB.H_EC.BRR1,^^PCI0.LPCB.H_EC.BRR2,^^PCI0.LPCB.H_EC.BRR3), end; 65 | 66 | into method label _BST code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1PV, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BPV0,^^PCI0.LPCB.H_EC.BPV1,^^PCI0.LPCB.H_EC.BPV2,^^PCI0.LPCB.H_EC.BPV3), end; 67 | 68 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BAF0,^^PCI0.LPCB.H_EC.BAF1,^^PCI0.LPCB.H_EC.BAF2,^^PCI0.LPCB.H_EC.BAF3), end; 69 | into method label _PTS code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 70 | into method label _WAK code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 71 | into method label PNOT code_regex \(\\_SB.PCI0\.LPCB\.H_EC\.B1AF, replace_matched begin (B1B4(\\_SB.PCI0.LPCB.H_EC.BAF0,\\_SB.PCI0.LPCB.H_EC.BAF1,\\_SB.PCI0.LPCB.H_EC.BAF2,\\_SB.PCI0.LPCB.H_EC.BAF3), end; 72 | 73 | into method label SBIX code_regex \(\^\^PCI0\.LPCB\.H_EC\.B1VL, replace_matched begin (B1B4(^^PCI0.LPCB.H_EC.BVL0,^^PCI0.LPCB.H_EC.BVL1,^^PCI0.LPCB.H_EC.BVL2,^^PCI0.LPCB.H_EC.BVL3), end; 74 | 75 | -------------------------------------------------------------------------------- /battery/battery_Sony-VAIO-SZ1XP.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Sony-VAIO-SZ1XP.txt 3 | 4 | # created by northwinds 2016-03-09 5 | 6 | # works for: 7 | # Sony VAIO SZ1XP 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n 13 | end; 14 | 15 | into device label EC0 code_regex B1AB,\s+16, replace_matched begin BAB0,8, BAB1,8, end; 16 | into device label EC0 code_regex B1AC,\s+16, replace_matched begin BAC0,8, BAC1,8, end; 17 | into device label EC0 code_regex B1VO,\s+16, replace_matched begin BVO0,8, BVO1,8, end; 18 | into device label EC0 code_regex B1DC,\s+16, replace_matched begin BDC0,8, BDC1,8, end; 19 | into device label EC0 code_regex B1LF,\s+16, replace_matched begin BLF0,8, BLF1,8, end; 20 | into device label EC0 code_regex B1DV,\s+16, replace_matched begin BDV0,8, BDV1,8, end; 21 | into device label EC0 code_regex A1TP,\s+16, replace_matched begin ATP0,8, ATP1,8, end; 22 | into device label EC0 code_regex A1PT,\s+16, replace_matched begin APT0,8, APT1,8, end; 23 | into device label EC0 code_regex A1CT,\s+16, replace_matched begin ACT0,8, ACT1,8, end; 24 | 25 | 26 | into method label _BIF code_regex \(B1DC, replaceall_matched begin (B1B2(BDC0,BDC1), end; 27 | into method label _BIF code_regex \(B1LF, replaceall_matched begin (B1B2(BLF0,BLF1), end; 28 | into method label _BIF code_regex \(B1DV, replaceall_matched begin (B1B2(BDV0,BDV1), end; 29 | into method label _BST code_regex \(B1VO, replaceall_matched begin (B1B2(BVO0,BVO1), end; 30 | into method label _BST code_regex \(B1AC, replaceall_matched begin (B1B2(BAC0,BAC1), end; 31 | into method label _BST code_regex \(B1AB, replaceall_matched begin (B1B2(BAB0,BAB1), end; 32 | 33 | into method label _TMP code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.A1TP, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.ATP0,\\_SB.PCI0.LPCB.EC0.ATP1), end; 34 | 35 | into method label _PSV code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.A1PT, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.APT0,\\_SB.PCI0.LPCB.EC0.APT1), end; 36 | 37 | into method label _CRT code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.A1CT, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.ACT0,\\_SB.PCI0.LPCB.EC0.ACT1), end; 38 | -------------------------------------------------------------------------------- /battery/battery_Surface-Pro-v1.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Surface-Pro-v1.txt 3 | 4 | # created by RehabMan 2014-01-09 5 | 6 | # works for: 7 | # Microsoft Surface Pro v1 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | # 16-bit registers 16 | 17 | # not battery related (not accessed from DSDT, but likely related to fan speeds) 18 | into device label EC0 code_regex F0RM,\s+16, replace_matched begin RM00,8,RM01,8, end; 19 | into device label EC0 code_regex F1RM,\s+16, replace_matched begin RM10,8,RM11,8, end; 20 | 21 | # battery related 22 | into device label EC0 code_regex B0VL,\s+16, replace_matched begin VL00,8,VL01,8, end; 23 | into device label EC0 code_regex B0CR,\s+16, replace_matched begin CR00,8,CR01,8, end; 24 | into device label EC0 code_regex B0RC,\s+16, replace_matched begin RC00,8,RC01,8, end; 25 | into device label EC0 code_regex B0FC,\s+16, replace_matched begin FC00,8,FC01,8, end; 26 | into device label EC0 code_regex B0CC,\s+16, replace_matched begin CC00,8,CC01,8, end; 27 | into device label EC0 code_regex B0DC,\s+16, replace_matched begin DC00,8,DC01,8, end; 28 | into device label EC0 code_regex B0DV,\s+16, replace_matched begin DV00,8,DV01,8, end; 29 | into device label EC0 code_regex B0MD,\s+16, replace_matched begin MD00,8,MD01,8, end; 30 | 31 | into device label EC0 code_regex B1VL,\s+16, replace_matched begin VL10,8,VL11,8, end; 32 | into device label EC0 code_regex B1CR,\s+16, replace_matched begin CR10,8,CR11,8, end; 33 | into device label EC0 code_regex B1RC,\s+16, replace_matched begin RC10,8,RC11,8, end; 34 | into device label EC0 code_regex B1FC,\s+16, replace_matched begin FC10,8,FC11,8, end; 35 | into device label EC0 code_regex B1CC,\s+16, replace_matched begin CC10,8,CC11,8, end; 36 | into device label EC0 code_regex B1DC,\s+16, replace_matched begin DC10,8,DC11,8, end; 37 | into device label EC0 code_regex B1DV,\s+16, replace_matched begin DV10,8,DV11,8, end; 38 | into device label EC0 code_regex B1MD,\s+16, replace_matched begin MD10,8,MD11,8, end; 39 | 40 | # 16-bit methods 41 | 42 | into_all method parent_label EC0 code_regex \(B0MD, replace_matched begin (B1B2(MD00,MD01), end; 43 | into_all method parent_label EC0 code_regex \(B1MD, replace_matched begin (B1B2(MD10,MD11), end; 44 | into_all method parent_label EC0 code_regex \(B0DC, replace_matched begin (B1B2(DC00,DC01), end; 45 | into_all method parent_label EC0 code_regex \(B1DC, replace_matched begin (B1B2(DC10,DC11), end; 46 | into_all method parent_label EC0 code_regex \(B0FC, replace_matched begin (B1B2(FC00,FC01), end; 47 | into_all method parent_label EC0 code_regex \(B1FC, replace_matched begin (B1B2(FC10,FC11), end; 48 | into_all method parent_label EC0 code_regex \(B0DV, replace_matched begin (B1B2(DV00,DV01), end; 49 | into_all method parent_label EC0 code_regex \(B1DV, replace_matched begin (B1B2(DV10,DV11), end; 50 | into_all method parent_label EC0 code_regex \(B0CR, replace_matched begin (B1B2(CR00,CR01), end; 51 | into_all method parent_label EC0 code_regex \(B1CR, replace_matched begin (B1B2(CR10,CR11), end; 52 | into_all method parent_label EC0 code_regex \(B0RC, replace_matched begin (B1B2(RC00,RC01), end; 53 | into_all method parent_label EC0 code_regex \(B1RC, replace_matched begin (B1B2(RC10,RC11), end; 54 | into_all method parent_label EC0 code_regex \(B0VL, replace_matched begin (B1B2(VL00,VL01), end; 55 | into_all method parent_label EC0 code_regex \(B1VL, replace_matched begin (B1B2(VL10,VL11), end; 56 | 57 | into_all method parent_label BAT0 code_regex \^\^LPCB.EC0.B0FC, replace_matched begin B1B2(^^LPCB.EC0.FC00,^^LPCB.EC0.FC01), end; 58 | into_all method parent_label BAT0 code_regex \(\^\^LPCB.EC0.B0CC, replace_matched begin (B1B2(^^LPCB.EC0.CC00,^^LPCB.EC0.CC01), end; 59 | into_all method parent_label BAT0 code_regex \(\^\^LPCB.EC0.B0RC, replace_matched begin (B1B2(^^LPCB.EC0.RC00,^^LPCB.EC0.RC01), end; 60 | -------------------------------------------------------------------------------- /battery/battery_Surface-Pro-v4.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Surface-Pro-v4.txt 3 | 4 | # created by jhax01 2016-01-07 5 | 6 | # works for: 7 | # Microsoft Surface Pro 4 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | into device label EC0 code_regex B1PV,\s+16, replace_matched begin BPV0,8,BPV1,8, end; 16 | into device label EC0 code_regex B1CR,\s+16, replace_matched begin BCR0,8,BCR1,8, end; 17 | into device label EC0 code_regex B1RC,\s+16, replace_matched begin BRC0,8,BRC1,8, end; 18 | into device label EC0 code_regex B1FC,\s+16, replace_matched begin BFC0,8,BFC1,8, end; 19 | into device label EC0 code_regex B1CY,\s+16, replace_matched begin BCY0,8,BCY1,8, end; 20 | into device label EC0 code_regex B1DC,\s+16, replace_matched begin BDC0,8,BDC1,8, end; 21 | into device label EC0 code_regex B1DV,\s+16, replace_matched begin BDV0,8,BDV1,8, end; 22 | into device label EC0 code_regex B1SN,\s+16, replace_matched begin BSN0,8,BSN1,8, end; 23 | into device label EC0 code_regex B1TP,\s+16, replace_matched begin BTP0,8,BTP1,8, end; 24 | 25 | into_all method label _BST code_regex B1PV replaceall_matched begin B1B2(BPV0,BPV1) end; 26 | into_all method label _BTP code_regex B1PV replaceall_matched begin B1B2(BPV0,BPV1) end; 27 | into_all method label _BST code_regex B1CR replaceall_matched begin B1B2(BCR0,BCR1) end; 28 | into_all method label _BST code_regex B1RC replace_matched begin B1B2(BRC0,BRC1) end; 29 | into_all method label _BIX code_regex B1FC replaceall_matched begin B1B2(BFC0,BFC1) end; 30 | into_all method label _BTP code_regex B1FC replaceall_matched begin B1B2(BFC0,BFC1) end; 31 | into_all method label _BIX code_regex B1CY replace_matched begin B1B2(BCY0,BCY1) end; 32 | into_all method label _BIX code_regex B1DC replaceall_matched begin B1B2(BDC0,BDC1) end; 33 | into_all method label _BIX code_regex B1DV replaceall_matched begin B1B2(BDV0,BDV1) end; 34 | into_all method label _BST code_regex B1DV replaceall_matched begin B1B2(BDV0,BDV1) end; 35 | into_all method label _BTP code_regex B1DV replaceall_matched begin B1B2(BDV0,BDV1) end; 36 | into_all method label _BIX code_regex B1SN replace_matched begin B1B2(BSN0,BSN1) end; 37 | into_all method label _BTP code_regex Store\s+\(Local0,\s+B1TP\) replace_matched begin Store(Local0,BTP0) Store(ShiftRight(Local0,8),BTP1) end; 38 | 39 | into_all method label PNOT code_regex \\_SB.PCI0.LPCB.EC0.B1RC replaceall_matched begin B1B2(\\_SB.PCI0.LPCB.EC0.BRC0,\\_SB.PCI0.LPCB.EC0.BRC1) end; 40 | 41 | # utility methods to read/write buffers from/to EC 42 | into method label RE1B parent_label EC0 remove_entry; 43 | into method label RECB parent_label EC0 remove_entry; 44 | into device label EC0 insert 45 | begin 46 | Method (RE1B, 1, NotSerialized)\n 47 | {\n 48 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 49 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 50 | Return(BYTE)\n 51 | }\n 52 | Method (RECB, 2, Serialized)\n 53 | // Arg0 - offset in bytes from zero-based EC\n 54 | // Arg1 - size of buffer in bits\n 55 | {\n 56 | ShiftRight(Arg1, 3, Arg1)\n 57 | Name(TEMP, Buffer(Arg1) { })\n 58 | Add(Arg0, Arg1, Arg1)\n 59 | Store(0, Local0)\n 60 | While (LLess(Arg0, Arg1))\n 61 | {\n 62 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 63 | Increment(Arg0)\n 64 | Increment(Local0)\n 65 | }\n 66 | Return(TEMP)\n 67 | }\n 68 | end; 69 | 70 | into device label EC0 code_regex (B1MN,)\s+(96) replace_matched begin B1MX,%2,//%1%2 end; 71 | into device label EC0 code_regex (B1DN,)\s+(64) replace_matched begin B1DX,%2,//%1%2 end; 72 | into device label EC0 code_regex (B1CH,)\s+(48) replace_matched begin B1CX,%2,//%1%2 end; 73 | 74 | into_all method label _BIX code_regex B1MN replaceall_matched begin RECB(0x75,96) end; 75 | into_all method label _BIX code_regex B1DN replaceall_matched begin RECB(0x81,64) end; 76 | into_all method label _BIX code_regex B1CH replaceall_matched begin RECB(0x89,48) end; 77 | -------------------------------------------------------------------------------- /battery/battery_TabletKiosk-i575.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Surface-Pro-v1.txt 3 | 4 | # created by booblej 2014-01-12 5 | 6 | # works for: 7 | # TabletKiosk i575 8 | 9 | into method label B1B2 remove_entry; 10 | into definitionblock code_regex . insert 11 | begin 12 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 13 | end; 14 | 15 | into device label EC0 code_regex B1FC,\s+16 replace_matched begin IFC0,8,IFC1,8 end; 16 | into device label EC0 code_regex B1RM,\s+16 replace_matched begin IRM0,8,IRM1,8 end; 17 | into device label EC0 code_regex B1VT,\s+16 replace_matched begin IVT0,8,IVT1,8 end; 18 | into device label EC0 code_regex B1CR,\s+16 replace_matched begin ICR0,8,ICR1,8 end; 19 | into device label EC0 code_regex B2FC,\s+16 replace_matched begin ZFC0,8,ZFC1,8 end; 20 | into device label EC0 code_regex B2RM,\s+16 replace_matched begin ZRM0,8,ZRM1,8 end; 21 | into device label EC0 code_regex B2VT,\s+16 replace_matched begin ZVT0,8,ZVT1,8 end; 22 | into device label EC0 code_regex B2CR,\s+16 replace_matched begin ZCR0,8,ZCR1,8 end; 23 | into device label EC0 code_regex SDAT,\s+16 replace_matched begin DAT0,8,DAT1,8 end; 24 | into device label EC0 code_regex B3ST,\s+16 replace_matched begin EST0,8,EST1,8 end; 25 | into device label EC0 code_regex B3FC,\s+16 replace_matched begin EFC0,8,EFC1,8 end; 26 | into device label EC0 code_regex B3RM,\s+16 replace_matched begin ERM0,8,ERM1,8 end; 27 | into method label RD02 code_regex ECR1,\s+16 replace_matched begin CR10,8,CR11,8 end; 28 | 29 | into method label BIF1 code_regex \(\^\^LPCB.EC0\.B1FC, replaceall_matched begin (B1B2(^^LPCB.EC0.IFC0,^^LPCB.EC0.IFC1), end; 30 | into method label _STA code_regex \(\^\^LPCB.EC0\.B1FC, replaceall_matched begin (B1B2(^^LPCB.EC0.IFC0,^^LPCB.EC0.IFC1), end; 31 | into method label BST2 code_regex \(\^\^LPCB.EC0\.B1RM, replaceall_matched begin (B1B2(^^LPCB.EC0.IRM0,^^LPCB.EC0.IRM1), end; 32 | into method label BST3 code_regex \(\^\^LPCB.EC0\.B1VT, replaceall_matched begin (B1B2(^^LPCB.EC0.IVT0,^^LPCB.EC0.IVT1), end; 33 | into method label BST1 code_regex \(\^\^LPCB.EC0\.B1CR, replaceall_matched begin (B1B2(^^LPCB.EC0.ICR0,^^LPCB.EC0.ICR1), end; 34 | into method label BIF1 code_regex \(\^\^LPCB.EC0\.B2FC, replaceall_matched begin (B1B2(^^LPCB.EC0.ZFC0,^^LPCB.EC0.ZFC1), end; 35 | into method label _STA code_regex \(\^\^LPCB.EC0\.B2FC, replaceall_matched begin (B1B2(^^LPCB.EC0.ZFC0,^^LPCB.EC0.ZFC1), end; 36 | into method label BST2 code_regex \(\^\^LPCB.EC0\.B2RM, replaceall_matched begin (B1B2(^^LPCB.EC0.ZRM0,^^LPCB.EC0.ZRM1), end; 37 | into method label BST3 code_regex \(\^\^LPCB.EC0\.B2VT, replaceall_matched begin (B1B2(^^LPCB.EC0.ZVT0,^^LPCB.EC0.ZVT1), end; 38 | into method label BST1 code_regex \(\^\^LPCB.EC0\.B2CR, replaceall_matched begin (B1B2(^^LPCB.EC0.ZCR0,^^LPCB.EC0.ZCR1), end; 39 | into method label SMDW code_regex \(\^\^LPCB.EC0\.SDAT, replaceall_matched begin (B1B2(^^LPCB.EC0.DAT0,^^LPCB.EC0.DAT1), end; 40 | into method label _BIF code_regex \(\^\^LPCB.EC0\.SDAT, replaceall_matched begin (B1B2(^^LPCB.EC0.DAT0,^^LPCB.EC0.DAT1), end; 41 | into method label _BST code_regex \(\^\^LPCB.EC0\.B3ST, replaceall_matched begin (B1B2(^^LPCB.EC0.EST0,^^LPCB.EC0.EST1), end; 42 | into method label _BIF code_regex \(\^\^LPCB.EC0\.B3FC, replaceall_matched begin (B1B2(^^LPCB.EC0.EFC0,^^LPCB.EC0.EFC1), end; 43 | into method label _BST code_regex \(\^\^LPCB.EC0\.B3RM, replaceall_matched begin (B1B2(^^LPCB.EC0.ERM0,^^LPCB.EC0.ERM1), end; 44 | into method label SMDW code_regex \(\^\^LPCB.EC0\.SDAT, replaceall_matched begin (B1B2(^^LPCB.EC0.DAT0,^^LPCB.EC0.DAT1), end; 45 | into method label SMDW code_regex \(\^\^LPCB.EC0\.SDAT, replaceall_matched begin (B1B2(^^LPCB.EC0.DAT0,^^LPCB.EC0.DAT1), end; 46 | into_all method label RD02 code_regex \(ECR1\) replaceall_matched begin (B1B2 (CR10, CR11)) end; 47 | -------------------------------------------------------------------------------- /battery/battery_Thunderobot-911.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Thunderobot-911.txt 3 | 4 | # created by nayeweiyang 2017-01-23 5 | 6 | # works for: 7 | # Thunderobot 911 8 | # Thunderobot 911m-s2b (per kitkim) 9 | 10 | # 16-bit registers 11 | into device label EC0 code_regex DSCP,\s+16, replace_matched begin SCP0,8,SCP1,8, end; 12 | into device label EC0 code_regex LACP,\s+16, replace_matched begin ACP0,8,ACP1,8, end; 13 | into device label EC0 code_regex DSVG,\s+16, replace_matched begin SVG0,8,SVG1,8, end; 14 | into device label EC0 code_regex MCUR,\s+16, replace_matched begin CUR0,8,CUR1,8, end; 15 | into device label EC0 code_regex MBRM,\s+16, replace_matched begin BRM0,8,BRM1,8, end; 16 | into device label EC0 code_regex MBCV,\s+16, replace_matched begin BCV0,8,BCV1,8, end; 17 | # 32-bit registers 18 | into device label EC0 code_regex VERN,\s+32 replace_matched begin VER0,8,VER1,8,VER2,8,VER3,8 end; 19 | 20 | # fix 16-bit methods 21 | into method label UPBI code_regex \^\^PCI0.LPCB.EC0.DSCP replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.SCP0,^^PCI0.LPCB.EC0.SCP1) end; 22 | into method label UPBI code_regex \^\^PCI0.LPCB.EC0.LACP, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.ACP0,^^PCI0.LPCB.EC0.ACP1), end; 23 | into method label UPBI code_regex \^\^PCI0.LPCB.EC0.DSVG, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.SVG0,^^PCI0.LPCB.EC0.SVG1), end; 24 | into method label UPBS code_regex \^\^PCI0.LPCB.EC0.DSCP replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.SCP0,^^PCI0.LPCB.EC0.SCP1) end; 25 | into method label UPBS code_regex \^\^PCI0.LPCB.EC0.MCUR, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.CUR0,^^PCI0.LPCB.EC0.CUR1), end; 26 | into method label UPBS code_regex \^\^PCI0.LPCB.EC0.MBRM, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.BRM0,^^PCI0.LPCB.EC0.BRM1), end; 27 | into method label UPBS code_regex \^\^PCI0.LPCB.EC0.MBCV, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.BCV0,^^PCI0.LPCB.EC0.BCV1), end; 28 | 29 | into device label EC0 code_regex BANA,\s+(64), replace_matched begin BANX,64, end; 30 | into method label IVBI code_regex Store\s\(Zero,\s\^\^PCI0.LPCB.EC0.BANA\) replaceall_matched begin ^^PCI0.LPCB.EC0.WECB(0x77,64,Zero) end; 31 | 32 | into method label B1B2 remove_entry; 33 | into definitionblock code_regex . insert 34 | begin 35 | Method (B1B2, 2, NotSerialized)\n 36 | {\n 37 | Return(Or(Arg0, ShiftLeft(Arg1, 8)))\n 38 | }\n 39 | end; 40 | 41 | into method label WE1B label EC0 remove_entry; 42 | into method label WECB label EC0 remove_entry; 43 | into device label EC0 insert 44 | begin 45 | Method (WE1B, 2, NotSerialized)\n 46 | {\n 47 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 48 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 49 | Store(Arg1, BYTE)\n 50 | }\n 51 | Method (WECB, 3, Serialized)\n 52 | // Arg0 - offset in bytes from zero-based EC\n 53 | // Arg1 - size of buffer in bits\n 54 | // Arg2 - value to write\n 55 | {\n 56 | ShiftRight(Arg1, 3, Arg1)\n 57 | Name(TEMP, Buffer(Arg1) { })\n 58 | Store(Arg2, TEMP)\n 59 | Add(Arg0, Arg1, Arg1)\n 60 | Store(0, Local0)\n 61 | While (LLess(Arg0, Arg1))\n 62 | {\n 63 | WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n 64 | Increment(Arg0)\n 65 | Increment(Local0)\n 66 | }\n 67 | }\n 68 | end; 69 | -------------------------------------------------------------------------------- /battery/battery_Toshiba-A660-16Z.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Toshiba-A660-16Z.txt 3 | 4 | # created by stez 2014-02-23, cleanup by RehabMan 5 | 6 | # works for: 7 | # Toshiba Satellite A660-16Z 8 | # Toshiba Satellite P755-1004XT 9 | 10 | # B1B2 utility method 11 | into method label B1B2 remove_entry; 12 | into definitionblock code_regex . insert 13 | begin 14 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 15 | end; 16 | 17 | # B1B4 utility method 18 | into method label B1B4 remove_entry; 19 | into definitionblock code_regex . insert 20 | begin 21 | Method (B1B4, 4, NotSerialized)\n 22 | {\n 23 | Store(Arg3, Local0)\n 24 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 25 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 26 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 27 | Return(Local0)\n 28 | }\n 29 | end; 30 | 31 | # 16-bit fields 32 | into device label EC0 code_regex CECE,\s+16, replace_matched begin ECE0,8,ECE1,8, end; 33 | into device label EC0 code_regex TOHK,\s+16, replace_matched begin OHK0,8,OHK1,8, end; 34 | into device label EC0 code_regex BRC0,\s+16, replace_matched begin RC00,8,RC01,8, end; 35 | into device label EC0 code_regex BPV0,\s+16, replace_matched begin PV00,8,PV01,8, end; 36 | into device label EC0 code_regex BDV0,\s+16, replace_matched begin DV00,8,DV01,8, end; 37 | into device label EC0 code_regex BDC0,\s+16, replace_matched begin DC00,8,DC01,8, end; 38 | into device label EC0 code_regex BFC0,\s+16, replace_matched begin FC00,8,FC01,8, end; 39 | into device label EC0 code_regex BAC0,\s+16, replace_matched begin AC00,8,AC01,8, end; 40 | 41 | # 32-bit fields 42 | into device label EC0 code_regex PAE1,\s+32, replace_matched begin AE10,8,AE11,8,AE12,8,AE13,8, end; 43 | into device label EC0 code_regex PAE2,\s+32, replace_matched begin AE20,8,AE21,8,AE22,8,AE23,8, end; 44 | into device label EC0 code_regex PAE3,\s+32, replace_matched begin AE30,8,AE31,8,AE32,8,AE33,8, end; 45 | into device label EC0 code_regex PAE4,\s+32, replace_matched begin AE40,8,AE41,8,AE42,8,AE43,8, end; 46 | 47 | # fan related 48 | into device label EC0 code_regex ERIB,\s+16, replace_matched begin RIB0,8,RIB1,8, end; 49 | 50 | into method label _Q50 code_regex \(CECE, replaceall_matched begin (B1B2(ECE0,ECE1), end; 51 | into method label _Q50 code_regex \(Zero,\sCECE\) replaceall_matched begin \(Zero,ECE1) Store(Zero,ECE0) end; 52 | into method label INFO code_regex \(\^\^PCI0\.LPCB\.EC0\.TOHK, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.OHK0,^^PCI0.LPCB.EC0.OHK1), end; 53 | into method label INFO code_regex \(Zero,\s\^\^PCI0.LPCB.EC0.TOHK\) replaceall_matched 54 | begin 55 | \(Zero, ^^PCI0.LPCB.EC0.OHK1) 56 | Store (Zero, ^^PCI0.LPCB.EC0.OHK0) 57 | end; 58 | 59 | into method label _BIF code_regex \^\^EC0.BFC0, replaceall_matched begin B1B2(^^EC0.FC00,^^EC0.FC01), end; 60 | into method label _BIF code_regex \^\^EC0.BDC0, replaceall_matched begin B1B2(^^EC0.DC00,^^EC0.DC01), end; 61 | into method label _BIF code_regex \^\^EC0.BDV0, replaceall_matched begin B1B2(^^EC0.DV00,^^EC0.DV01), end; 62 | into method label _BST code_regex \^\^EC0.BAC0, replaceall_matched begin B1B2(^^EC0.AC00,^^EC0.AC01), end; 63 | into method label _BST code_regex \^\^EC0.BRC0, replaceall_matched begin B1B2(^^EC0.RC00,^^EC0.RC01), end; 64 | into method label _BST code_regex \^\^EC0.BPV0, replaceall_matched begin B1B2(^^EC0.PV00,^^EC0.PV01), end; 65 | 66 | into method label FANG code_regex \(Arg0,\sERIB\) replaceall_matched begin \(Arg0, RIB0) Store(ShiftRight(Arg0,8), RIB1) end; 67 | into method label FANW code_regex \(Arg0,\sERIB\) replaceall_matched begin \(Arg0, RIB0) Store(ShiftRight(Arg0,8), RIB1) end; 68 | 69 | into method label _Q50 code_regex \(P(AE[1234]), replaceall_matched begin (B1B4(%1\0,%1\1,%1\2,%1\3), end; 70 | 71 | into method label SPFC code_regex Store\s+\((.*),\s+(\^\^PCI0\.LPCB\.EC0\.)P(AE[1234])\) replaceall_matched 72 | begin 73 | Store(%1,%2%3\0) 74 | Store(ShiftRight(%1,8),%2%3\1) 75 | Store(ShiftRight(%1,16),%2%3\2) 76 | Store(ShiftRight(%1,24),%2%3\3) 77 | end; 78 | -------------------------------------------------------------------------------- /battery/battery_WBIN-AirBook.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_WBIN-AirBook.txt 3 | 4 | # submitted by Anonymous 2018-06-11 5 | # modifications for completeness by RehabMan 2018-06-11 6 | 7 | # works for: 8 | # WBIN AirBook (gen6 and gen7) 9 | # Compaq Presario 21n121ar (per ndeni)) 10 | 11 | # Note: Apply to appropriate SSDT (where battery methods live) 12 | 13 | into method label B1B2 remove_entry; 14 | into definitionblock code_regex . insert 15 | begin 16 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 17 | end; 18 | 19 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA1T,\s+16, replace_matched begin B1T0,8, B1T1,8, end; 20 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA2T,\s+16, replace_matched begin B2T0,8, B2T1,8, end; 21 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA3T,\s+16, replace_matched begin B3T0,8, B3T1,8, end; 22 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA4T,\s+16, replace_matched begin B4T0,8, B4T1,8, end; 23 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA5T,\s+16, replace_matched begin B5T0,8, B5T1,8, end; 24 | into scope label \_SB.PCI0.LPCB.H_EC code_regex BA6T,\s+16, replace_matched begin B6T0,8, B6T1,8, end; 25 | 26 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end; 27 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA2T\)\), replaceall_matched begin B1B2(B2T0,B2T1), end; 28 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA3T\)\), replaceall_matched begin B1B2(B3T0,B3T1), end; 29 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA4T\)\), replaceall_matched begin B1B2(B4T0,B4T1), end; 30 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA5T\)\), replaceall_matched begin B1B2(B5T0,B5T1), end; 31 | into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA6T\)\), replaceall_matched begin B1B2(B6T0,B6T1), end; 32 | 33 | into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end; 34 | into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA2T\)\), replaceall_matched begin B1B2(B2T0,B2T1), end; 35 | into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA3T\)\), replaceall_matched begin B1B2(B3T0,B3T1), end; 36 | into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA5T\)\), replaceall_matched begin B1B2(B5T0,B5T1), end; 37 | 38 | # utility methods to read/write buffers from/to EC by RehabMan 39 | into method label RE1B parent_label \_SB.PCI0.LPCB.H_EC remove_entry; 40 | into method label RECB parent_label \_SB.PCI0.LPCB.H_EC remove_entry; 41 | into scope label \_SB.PCI0.LPCB.H_EC insert 42 | begin 43 | Method (RE1B, 1, NotSerialized)\n 44 | {\n 45 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 46 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 47 | Return(BYTE)\n 48 | }\n 49 | Method (RECB, 2, Serialized)\n 50 | {\n 51 | ShiftRight(Arg1, 3, Arg1)\n 52 | Name(TEMP, Buffer(Arg1) { })\n 53 | Add(Arg0, Arg1, Arg1)\n 54 | Store(0, Local0)\n 55 | While (LLess(Arg0, Arg1))\n 56 | {\n 57 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 58 | Increment(Arg0)\n 59 | Increment(Local0)\n 60 | }\n 61 | Return(TEMP)\n 62 | }\n 63 | end; 64 | 65 | # patch 256 bit SMBD register (fixes by RehabMan) 66 | into scope label \_SB.PCI0.LPCB.H_EC code_regex (SMBD,)\s+(256) replace_matched begin SMBX,%2,//%1%2 end; 67 | into method label SMBR code_regex \(SMBD, replaceall_matched begin (RECB(0x44,256), end; 68 | 69 | #EOF 70 | -------------------------------------------------------------------------------- /graphics/graphics_EDID.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_EDID.txt 3 | 4 | # 5 | # Use this patch generic patch with EDID capability 6 | # if your display seems to exhibit EDID problems. 7 | # 8 | 9 | # Inject HDMI info and dual-link into GFX0/IGPU 10 | into method label _DSM parent_adr 0x00020000 remove_entry; 11 | into device name_adr 0x00020000 insert 12 | begin 13 | Method (_DSM, 4, NotSerialized)\n 14 | {\n 15 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 16 | Return (Package()\n 17 | {\n 18 | //IMPORTANT: edit for actual snb-platform-id\n 19 | "AAPL,snb-platform-id", Buffer() { 0x00, 0x00, 0x01, 0x00 },\n 20 | 21 | //IMPORTANT: edit for actual ig-platform-id\n 22 | "AAPL,ig-platform-id", Buffer() { 0x04, 0x00, 0x66, 0x01 },\n 23 | 24 | //IMPORTANT: remove this line if not dual-link\n 25 | "AAPL00,DualLink", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n 26 | 27 | //for HDMI-audio\n 28 | "hda-gfx", Buffer() { "onboard-1" },\n 29 | 30 | //EDID section: Fill in with your actual 128 bytes of EDID data\n 31 | //Note: Clover uses override-no-connect, but I've also seen\n 32 | // override-no-edid. Not sure what the difference is.\n 33 | //"AAPL00,override-no-connect", Buffer (0x80)\n 34 | "AAPL00,override-no-edid", Buffer (0x80)\n 35 | {\n 36 | 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x06, 0xaf, 0xec, 0x23,\n 37 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x15, 0x01, 0x04, 0x90, 0x22, 0x13, 0x78,\n 38 | 0x02, 0xc8, 0x95, 0x9e, 0x57, 0x54, 0x92, 0x26, 0x0f, 0x50, 0x54, 0x00,\n 39 | 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,\n 40 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xce, 0x1d, 0x56, 0xe2, 0x50, 0x00,\n 41 | 0x1e, 0x30, 0x26, 0x16, 0x36, 0x00, 0x58, 0xc1, 0x10, 0x00, 0x00, 0x18,\n 42 | 0xdf, 0x13, 0x56, 0xe2, 0x50, 0x00, 0x1e, 0x30, 0x26, 0x16, 0x36, 0x00,\n 43 | 0x58, 0xc1, 0x10, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 45 | 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x3f, 0xff, 0x0a, 0x3c, 0x64, 0x11,\n 46 | 0x19, 0x2f, 0x6e, 0x20, 0x20, 0x20, 0x00, 0xad\n 47 | },\n 48 | })\n 49 | }\n 50 | end; 51 | 52 | -------------------------------------------------------------------------------- /graphics/graphics_HD3K_high.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_HD3K_high.txt 3 | 4 | # 5 | # Use this patch if your laptop has 1600x900 or higher 6 | # resolution screen. 7 | # 8 | # For example, 47x0s (17") or 45x0s with 1080p user 9 | # upgraded screen. 10 | # 11 | 12 | # Inject HDMI info and dual-link into GFX0/IGPU 13 | into method label _DSM parent_adr 0x00020000 remove_entry; 14 | into device name_adr 0x00020000 insert 15 | begin 16 | Method (_DSM, 4, NotSerialized)\n 17 | {\n 18 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 19 | Return (Package()\n 20 | {\n 21 | "AAPL,snb-platform-id", Buffer() { 0x00, 0x00, 0x01, 0x00 },\n 22 | "hda-gfx", Buffer() { "onboard-1" },\n 23 | "AAPL00,DualLink", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n 24 | })\n 25 | }\n 26 | end; 27 | 28 | -------------------------------------------------------------------------------- /graphics/graphics_HD3K_low.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_HD3K_low.txt 3 | 4 | # 5 | # Use this patch if your laptop has the standard 1366x768 screen 6 | # 7 | # Use dual-link if you have 1600x900 or have upgraded 8 | # to 1080p screen. 9 | # 10 | 11 | # Inject HDMI info into GFX0/IGPU 12 | into method label _DSM parent_adr 0x00020000 remove_entry; 13 | into device name_adr 0x00020000 insert 14 | begin 15 | Method (_DSM, 4, NotSerialized)\n 16 | {\n 17 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 18 | Return (Package()\n 19 | {\n 20 | "AAPL,snb-platform-id", Buffer() { 0x00, 0x00, 0x01, 0x00 },\n 21 | "hda-gfx", Buffer() { "onboard-1" },\n 22 | })\n 23 | }\n 24 | end; 25 | 26 | -------------------------------------------------------------------------------- /graphics/graphics_HD4600_yosemite.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_HD4600_yosemite.txt 3 | 4 | # 5 | # Use this patch if your laptop has Haswell graphics 6 | # 7 | 8 | into method label _DSM parent_adr 0x00020000 remove_entry; 9 | into device name_adr 0x00020000 insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "device-id", Buffer() { 0x12, 0x04, 0x00, 0x00 },\n 17 | "AAPL,ig-platform-id", Buffer() { 0x06, 0x00, 0x26, 0x0a },\n 18 | "hda-gfx", Buffer() { "onboard-1" },\n 19 | "model", Buffer() { "Intel HD 4600" },\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | 25 | -------------------------------------------------------------------------------- /graphics/graphics_HD4K_high.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_HD4K_high.txt 3 | 4 | # 5 | # Use this patch if your laptop has 1600x900 or higher 6 | # resolution screen. 7 | # 8 | # For example, 47x0s (17") or 45x0s with 1080p user 9 | # upgraded screen. 10 | # 11 | 12 | # Inject HDMI info and dual-link into GFX0/IGPU 13 | into method label _DSM parent_adr 0x00020000 remove_entry; 14 | into device name_adr 0x00020000 insert 15 | begin 16 | Method (_DSM, 4, NotSerialized)\n 17 | {\n 18 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 19 | Return (Package()\n 20 | {\n 21 | "AAPL,ig-platform-id", Buffer() { 0x04, 0x00, 0x66, 0x01 },\n 22 | "hda-gfx", Buffer() { "onboard-1" },\n 23 | })\n 24 | }\n 25 | end; 26 | 27 | -------------------------------------------------------------------------------- /graphics/graphics_HD4K_low.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_HD4K_low.txt 3 | 4 | # 5 | # Use this patch if your laptop has the standard 1366x768 screen 6 | # 7 | # Use dual-link if you have 1600x900 or have upgraded 8 | # to 1080p screen. 9 | # 10 | 11 | # Inject HDMI info into GFX0/IGPU 12 | into method label _DSM parent_adr 0x00020000 remove_entry; 13 | into device name_adr 0x00020000 insert 14 | begin 15 | Method (_DSM, 4, NotSerialized)\n 16 | {\n 17 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 18 | Return (Package()\n 19 | {\n 20 | "AAPL,ig-platform-id", Buffer() { 0x03, 0x00, 0x66, 0x01 },\n 21 | "hda-gfx", Buffer() { "onboard-1" },\n 22 | })\n 23 | }\n 24 | end; 25 | 26 | -------------------------------------------------------------------------------- /graphics/graphics_Haswell_0a260006.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Haswell_0a260006.txt 3 | 4 | # 5 | # Use this patch if your laptop has Haswell graphics 6 | # 7 | 8 | into method label _DSM parent_adr 0x00020000 remove_entry; 9 | into device name_adr 0x00020000 insert 10 | begin 11 | Method (_DSM, 4, NotSerialized)\n 12 | {\n 13 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 14 | Return (Package()\n 15 | {\n 16 | "AAPL,ig-platform-id", Buffer() { 0x06, 0x00, 0x26, 0x0a },\n 17 | "hda-gfx", Buffer() { "onboard-1" },\n 18 | })\n 19 | }\n 20 | end; 21 | 22 | -------------------------------------------------------------------------------- /graphics/graphics_INI-disable.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_INI-disable.txt 3 | 4 | # The purpose of this patch is to add code to _INI to 5 | # disable nvidia/Radeon. The patch is intended to be applied to 6 | # the SSDT that contains the _INI method for the discrete card. 7 | # 8 | # Usually the path is \_SB.PCI0.PEG0.PEGP and the method name 9 | # is _OFF, but some systems use different names. 10 | # 11 | # The path of _OFF may have to be customized to match your SSDTs 12 | # In addition the label of EC0 may need to be changed (H_EC, EC, etc) 13 | # 14 | # Note: Uncomment the External line if your _OFF method is in 15 | # a separate SSDT. 16 | # 17 | 18 | into method label _INI parent_label \_SB.PCI0.PEG0.PEGP insert 19 | begin 20 | //added to turn nvidia/radeon off\n 21 | //External(\_SB.PCI0.PEG0.PEGP._OFF, MethodObj)\n 22 | _OFF()\n 23 | end; 24 | 25 | -------------------------------------------------------------------------------- /graphics/graphics_MEI_ivy.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_MEI_ivy.txt 3 | 4 | # For Ivy Bridge CPU on 6-series board 5 | 6 | into device label IMEI parent_label PCI0 remove_entry; 7 | into device label PCI0 insert 8 | begin 9 | Device (IMEI)\n 10 | {\n 11 | Name (_ADR, 0x00160000)\n 12 | Method (_DSM, 4, NotSerialized)\n 13 | {\n 14 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 15 | Return (Package()\n 16 | {\n 17 | "device-id", Buffer() { 0x3A, 0x1E, 0x00, 0x00 },\n 18 | "name", "pci8086,1e3a",\n 19 | })\n 20 | }\n 21 | }\n 22 | end; 23 | -------------------------------------------------------------------------------- /graphics/graphics_MEI_sandy.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_MEI_sandy.txt 3 | 4 | # For Sandy Bridge CPU on 7-series board 5 | 6 | into device label IMEI parent_label PCI0 remove_entry; 7 | into device label PCI0 insert 8 | begin 9 | Device (IMEI)\n 10 | {\n 11 | Name (_ADR, 0x00160000)\n 12 | Method (_DSM, 4, NotSerialized)\n 13 | {\n 14 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 15 | Return (Package()\n 16 | {\n 17 | "device-id", Buffer() { 0x3A, 0x1C, 0x00, 0x00 },\n 18 | "name", "pci8086,1c3a",\n 19 | })\n 20 | }\n 21 | }\n 22 | end; 23 | -------------------------------------------------------------------------------- /graphics/graphics_PNLF-ACPI100.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_PNLF-ACPI100.txt 3 | 4 | # This patch enables the brightness slider in SysPrefs->Displays 5 | # and will also enable activation of sleep mode by closing 6 | # the laptop lid. 7 | # 8 | # This patch works well for laptops that have working 9 | # ACPI methods with 64-or more levels (100 is common) 10 | # for good support for Windows 2012 (Windows 8) 11 | # 12 | # Based on information from the normal laptop DSDT methods, 13 | # optimized for use with ACPIBacklight.kext 14 | # 15 | # Note: This patch should be applied to the DSDT or SSDT that defines 16 | # your integrated graphics device (always at _ADR 0x00020000) 17 | # applied to one of the SSDTs, not DSDT. 18 | # 19 | # Note: Intended to be used with Windows 2012, so this should be done... 20 | # if you previously patched for Windows 2006, undo that patch! 21 | 22 | # sometimes in Scope (_SB.PCI0) 23 | into method label _INI parent_label _SB.PCI0 code_regex If\s+\(_OSI\s+\(\"Windows\s2012\"\)\) replace_matched 24 | begin If(LOr(_OSI("Darwin"),_OSI("Windows 2012"))) end; 25 | 26 | # sometimes in Scope (_SB) 27 | into method label _INI parent_label _SB code_regex If\s+\(_OSI\s+\(\"Windows\s2012\"\)\) replace_matched 28 | begin If(LOr(_OSI("Darwin"),_OSI("Windows 2012"))) end; 29 | 30 | 31 | into_all device label PNLF remove_entry; 32 | into device name_adr 0x00020000 insert 33 | begin 34 | Device (PNLF)\n 35 | {\n 36 | // normal PNLF declares (note some of this probably not necessary)\n 37 | Name (_ADR, Zero)\n 38 | Name (_HID, EisaId ("APP0002"))\n 39 | Name (_CID, "backlight")\n 40 | Name (_UID, 10)\n 41 | Name (_STA, 0x0B)\n 42 | // _BCM/_BQC: set/get for brightness level\n 43 | Method (_BCM, 1, NotSerialized)\n 44 | {\n 45 | // Update backlight via existing DSDT methods\n 46 | ^^DD02._BCM(Arg0)\n 47 | }\n 48 | Method (_BQC, 0, NotSerialized)\n 49 | {\n 50 | Return(^^DD02._BQC())\n 51 | }\n 52 | Method (_BCL, 0, NotSerialized)\n 53 | {\n 54 | Return(^^DD02._BCL())\n 55 | }\n 56 | Method (_DOS, 1, NotSerialized)\n 57 | {\n 58 | ^^_DOS(Arg0)\n 59 | }\n 60 | // extended _BCM/_BQC for setting "in between" levels\n 61 | Method (XBCM, 1, NotSerialized)\n 62 | {\n 63 | // Update backlight via existing DSDT methods\n 64 | ^^DD02._BCM(Arg0)\n 65 | }\n 66 | Method (XBQC, 0, NotSerialized)\n 67 | {\n 68 | Return(^^DD02._BQC())\n 69 | }\n 70 | // Use XOPT=1 to disable smooth transitions\n 71 | Name (XOPT, Zero)\n 72 | // XRGL/XRGH: defines the valid range\n 73 | Method (XRGL, 0, NotSerialized)\n 74 | {\n 75 | Store(_BCL(), Local0)\n 76 | Store(DerefOf(Index(Local0, 2)), Local0)\n 77 | Return(Local0)\n 78 | }\n 79 | Method (XRGH, 0, NotSerialized)\n 80 | {\n 81 | Store(_BCL(), Local0)\n 82 | Store(DerefOf(Index(Local0, Subtract(SizeOf(Local0), 1))), Local0)\n 83 | Return(Local0)\n 84 | }\n 85 | }\n 86 | end; 87 | 88 | -------------------------------------------------------------------------------- /graphics/graphics_PNLF-Lenovo-Ux10a.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_PNLF-Lenovo-Ux10.txt 3 | 4 | # This patch enables the brightness slider in SysPrefs->Displays 5 | # and will also enable activation of sleep mode by closing 6 | # the laptop lid. 7 | # 8 | # This patch is specifically for the Lenovo Ux10 series 9 | # laptops. 10 | # 11 | # Based on information from the normal laptop DSDT methods, 12 | # optimized for use with ACPIBacklight.kext 13 | # 14 | # Note: This patch should be applied to the DSDT or SSDT that defines 15 | # your integrated graphics device (always at _ADR 0x00020000) 16 | # 17 | 18 | into_all device label PNLF remove_entry; 19 | into_all device name_adr 0x00020000 code_regex (OperationRegion\s\(RMPC,\sPCI_Config[^\}]*\}) remove_matched; 20 | 21 | into device name_adr 0x00020000 insert 22 | begin 23 | OperationRegion (RMPC, PCI_Config, 0x10, 4)\n 24 | Field (RMPC, AnyAcc, NoLock, Preserve)\n 25 | {\n 26 | BAR1,32,\n 27 | }\n 28 | Device (PNLF)\n 29 | {\n 30 | // normal PNLF declares (note some of this probably not necessary)\n 31 | Name (_ADR, Zero)\n 32 | Name (_HID, EisaId ("APP0002"))\n 33 | Name (_CID, "backlight")\n 34 | Name (_UID, 10)\n 35 | Name (_STA, 0x0B)\n 36 | //define hardware register access for brightness\n 37 | // lower nibble of BAR1 is status bits and not part of the address\n 38 | OperationRegion (BRIT, SystemMemory, And(^BAR1, Not(0xF)), 0xc8254)\n 39 | Field (BRIT, AnyAcc, Lock, Preserve)\n 40 | {\n 41 | Offset(0x4824c),\n 42 | LEV2, 32,\n 43 | LEVL, 32,\n 44 | Offset(0x7003C),\n 45 | P0BL, 32,\n 46 | Offset(0xc824c),\n 47 | LEVW, 32,\n 48 | LEVX, 32,\n 49 | }\n 50 | // DEB1 special for setting KLVX at runtime...\n 51 | //Method (DEB1, 1, NotSerialized)\n 52 | //{\n 53 | // Store(Arg0, KLVX)\n 54 | //}\n 55 | // _INI deals with differences between native setting and desired\n 56 | Name (BRTL, 15)\n 57 | Method (_INI, 0, NotSerialized)\n 58 | {\n 59 | /*\n 60 | Store(ShiftRight(KLVX,16), Local0)\n 61 | Store(ShiftRight(LEVX,16), Local1)\n 62 | if (LNotEqual(Local0, Local1))\n 63 | {\n 64 | Divide(Multiply(LEVL, Local0), Local1,, Local0)\n 65 | //Store(P0BL, Local1)\n 66 | //While(LEqual (P0BL, Local1)) {}\n 67 | Store(Local0, LEVL)\n 68 | Store(KLVX, LEVX)\n 69 | }\n 70 | */\n 71 | // Note: Not sure if ECLV is read/write (may be write only)\n 72 | // comment this line out if reading is unreliable\n 73 | Store(\_SB.PCI0.LPCB.EC0.ECLV, BRTL)\n 74 | }\n 75 | // _BCM/_BQC: set/get for brightness level\n 76 | Method (_BCM, 1, NotSerialized)\n 77 | {\n 78 | /*\n 79 | // initialize for consistent backlight level before/after sleep\n 80 | If (LNotEqual(LEVW, 0x80000000)) { Store (0x80000000, LEVW) }\n 81 | If (LNotEqual(LEVX, KLVX)) { Store (KLVX, LEVX) }\n 82 | */\n 83 | // Update backlight via EC\n 84 | Store(Match(_BCL, MGE, Arg0, MTR, 0, 2), Local0)\n 85 | If (LEqual(Local0, Ones)) { Subtract(SizeOf(_BCL), 1, Local0) }\n 86 | Store(Local0, \_SB.PCI0.LPCB.EC0.ECLV)\n 87 | UCMS(0x14)\n 88 | Store(Local0, BRTL)\n 89 | }\n 90 | Method (_BQC, 0, NotSerialized)\n 91 | {\n 92 | /*\n 93 | Store(Match(_BCL, MGE, \_SB.PCI0.LPCB.EC0.ECLV, MTR, 0, 2), Local0)\n 94 | If (LEqual(Local0, Ones)) { Subtract(SizeOf(_BCL), 1, Local0) }\n 95 | Return(DerefOf(Index(_BCL, Local0)))\n 96 | */\n 97 | Return(BRTL)\n 98 | }\n 99 | Method (_DOS, 1, NotSerialized)\n 100 | {\n 101 | ^^_DOS(Arg0)\n 102 | }\n 103 | // Use XOPT=1 to disable smooth transitions\n 104 | Name (XOPT, 1)\n 105 | // XRGL/XRGH: defines the valid range\n 106 | Name (XRGL, 1)\n 107 | Name (XRGH, 15)\n 108 | // KLVX is initialization value for LEVX\n 109 | Name (KLVX, 0x7100000)\n 110 | // _BCL: returns list of valid brightness levels\n 111 | // first two entries describe ac/battery power levels\n 112 | Name (_BCL, Package()\n 113 | {\n 114 | 15,\n 115 | 4,\n 116 | 0,\n 117 | 1,2,3,4,5,6,7,8,9,10,11,12,13,14,14,15\n 118 | })\n 119 | }\n 120 | end; 121 | 122 | -------------------------------------------------------------------------------- /graphics/graphics_PNLF-Lenovo-Ux10b.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_PNLF-Lenovo-Ux10.txt 3 | 4 | # This patch enables the brightness slider in SysPrefs->Displays 5 | # and will also enable activation of sleep mode by closing 6 | # the laptop lid. 7 | # 8 | # This patch is specifically for the Lenovo Ux10 series 9 | # laptops. 10 | # 11 | # Based on information from the normal laptop DSDT methods, 12 | # optimized for use with ACPIBacklight.kext 13 | # 14 | # Note: This patch should be applied to the DSDT or SSDT that defines 15 | # your integrated graphics device (always at _ADR 0x00020000) 16 | # 17 | 18 | into_all device label PNLF remove_entry; 19 | into_all device name_adr 0x00020000 code_regex (OperationRegion\s\(RMPC,\sPCI_Config[^\}]*\}) remove_matched; 20 | 21 | into device name_adr 0x00020000 insert 22 | begin 23 | OperationRegion (RMPC, PCI_Config, 0x10, 4)\n 24 | Field (RMPC, AnyAcc, NoLock, Preserve)\n 25 | {\n 26 | BAR1,32,\n 27 | }\n 28 | Device (PNLF)\n 29 | {\n 30 | // normal PNLF declares (note some of this probably not necessary)\n 31 | Name (_ADR, Zero)\n 32 | Name (_HID, EisaId ("APP0002"))\n 33 | Name (_CID, "backlight")\n 34 | Name (_UID, 10)\n 35 | Name (_STA, 0x0B)\n 36 | //define hardware register access for brightness\n 37 | // lower nibble of BAR1 is status bits and not part of the address\n 38 | OperationRegion (BRIT, SystemMemory, And(^BAR1, Not(0xF)), 0xc8254)\n 39 | Field (BRIT, AnyAcc, Lock, Preserve)\n 40 | {\n 41 | Offset(0x4824c),\n 42 | LEV2, 32,\n 43 | LEVL, 32,\n 44 | Offset(0x7003C),\n 45 | P0BL, 32,\n 46 | Offset(0xc824c),\n 47 | LEVW, 32,\n 48 | LEVX, 32,\n 49 | }\n 50 | // DEB1 special for setting KLVX at runtime...\n 51 | //Method (DEB1, 1, NotSerialized)\n 52 | //{\n 53 | // Store(Arg0, KLVX)\n 54 | //}\n 55 | // _INI deals with differences between native setting and desired\n 56 | Method (_INI, 0, NotSerialized)\n 57 | {\n 58 | /*\n 59 | Store(ShiftRight(KLVX,16), Local0)\n 60 | Store(ShiftRight(LEVX,16), Local1)\n 61 | if (LNotEqual(Local0, Local1))\n 62 | {\n 63 | Divide(Multiply(LEVL, Local0), Local1,, Local0)\n 64 | //Store(P0BL, Local1)\n 65 | //While(LEqual (P0BL, Local1)) {}\n 66 | Store(Local0, LEVL)\n 67 | Store(KLVX, LEVX)\n 68 | }\n 69 | */\n 70 | }\n 71 | // _BCM/_BQC: set/get for brightness level\n 72 | Method (_BCM, 1, NotSerialized)\n 73 | {\n 74 | /*\n 75 | // initialize for consistent backlight level before/after sleep\n 76 | If (LNotEqual(LEVW, 0x80000000)) { Store (0x80000000, LEVW) }\n 77 | If (LNotEqual(LEVX, KLVX)) { Store (KLVX, LEVX) }\n 78 | */\n 79 | // Update backlight via existing DSDT methods\n 80 | ^^DD02._BCM(Arg0)\n 81 | }\n 82 | Method (_BQC, 0, NotSerialized)\n 83 | {\n 84 | Return(^^DD02._BQC())\n 85 | }\n 86 | Method (_DOS, 1, NotSerialized)\n 87 | {\n 88 | ^^_DOS(Arg0)\n 89 | }\n 90 | // Use XOPT=1 to disable smooth transitions\n 91 | Name (XOPT, 1)\n 92 | // XRGL/XRGH: defines the valid range\n 93 | Name (XRGL, 1)\n 94 | Name (XRGH, 0x64)\n 95 | // KLVX is initialization value for LEVX\n 96 | Name (KLVX, 0x7100000)\n 97 | // _BCL: returns list of valid brightness levels\n 98 | // first two entries describe ac/battery power levels\n 99 | Name (_BCL, Package()\n 100 | {\n 101 | //Note: data from IBCL + zero + duplicated max\n 102 | 0x64,\n 103 | 0x23,\n 104 | 0x14,// equivalent to 0\n 105 | 0x19,\n 106 | 0x1E,\n 107 | 0x23,\n 108 | 0x28,\n 109 | 0x2D,\n 110 | 0x32,\n 111 | 0x37,\n 112 | 0x3C,\n 113 | 0x41,\n 114 | 0x46,\n 115 | 0x4B,\n 116 | 0x50,\n 117 | 0x55,\n 118 | 0x5A,\n 119 | 0x5A,\n 120 | 0x64,\n 121 | })\n 122 | }\n 123 | end; 124 | 125 | -------------------------------------------------------------------------------- /graphics/graphics_PNLF.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_PNLF.txt 3 | 4 | # This patch enables the brightness slider in SysPrefs->Displays 5 | # and will also enable activation of sleep mode by closing 6 | # the laptop lid. 7 | 8 | # This patch is a "basic" PNLF patch and doesn't attempt 9 | # to fix various common problems with the backlight control. 10 | # 11 | # For advanced patches, see: 12 | # graphics_PNLF_ivy_sandy.txt 13 | # graphics_PNLF_haswell.txt 14 | # 15 | 16 | into_all device label PNLF remove_entry; 17 | into definitionblock code_regex . insert 18 | begin 19 | Scope (_SB)\n 20 | {\n 21 | Device (PNLF)\n 22 | {\n 23 | Name (_ADR, Zero)\n 24 | Name (_HID, EisaId ("APP0002"))\n 25 | Name (_CID, "backlight")\n 26 | Name (_UID, 10)\n 27 | Name (_STA, 0x0B)\n 28 | }\n 29 | }\n 30 | end; 31 | 32 | # to avoid conflict with root scope PNLF 33 | into_all method code_regex Store\s+\(PNLF,\s+(.*)\) replaceall_matched begin Store(\\PNLF, %1) end; 34 | -------------------------------------------------------------------------------- /graphics/graphics_PTS_WAK-disable.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_PTS_WAK-disable.txt 3 | 4 | # 5 | # The purpose of this patch is to add code to to _WAK 6 | # that disables Radeon/nvidia on wake and add code 7 | # to _PTS that enables it on _PTS. 8 | # 9 | # The path of _OFF may have to be customized to match your SSDTs 10 | # The patch attempts to identify the correct _REG by using 11 | # the ACPI PNP identifier for the EC. 12 | # 13 | # Use this patch if you experience trouble shutting down 14 | # or restarting your laptop when disabling nvida/radeon. 15 | # 16 | 17 | into method label _PTS code_regex ([\s\S]*) replace_matched 18 | begin 19 | External(\\_SB.PCI0.PEG0.PEGP._ON, MethodObj)\n 20 | If (CondRefOf(\\_SB.PCI0.PEG0.PEGP._ON)) { \\_SB.PCI0.PEG0.PEGP._ON() }\n 21 | %1 22 | end; 23 | 24 | into method label _WAK code_regex (Return\s+\(.*) replace_matched 25 | begin 26 | External(\\_SB.PCI0.PEG0.PEGP._OFF, MethodObj)\n 27 | If (CondRefOf(\\_SB.PCI0.PEG0.PEGP._OFF)) { \\_SB.PCI0.PEG0.PEGP._OFF() }\n 28 | %1 29 | end; 30 | -------------------------------------------------------------------------------- /graphics/graphics_REG-disable.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_REG-disable.txt 3 | 4 | # The purpose of this patch is to add code to _REG in EC 5 | # to disable nvidia/Radeon 6 | # 7 | # The path of _OFF may have to be customized to match your SSDTs 8 | # The patch attempts to identify the correct _REG by using 9 | # the ACPI PNP identifier for the EC. 10 | 11 | into method label _REG parent_hid PNP0C09 insert 12 | begin 13 | //added to turn nvidia/radeon off\n 14 | If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))\n 15 | {\n 16 | External(\_SB.PCI0.PEG0.PEGP._OFF, MethodObj)\n 17 | \_SB.PCI0.PEG0.PEGP._OFF()\n 18 | }\n 19 | end; 20 | 21 | -------------------------------------------------------------------------------- /graphics/graphics_Rename-B0D3.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Rename-B0D3.txt 3 | 4 | # for DSDT 5 | 6 | into method label _WAK code_regex B0D3 replaceall_matched begin HDAU end; 7 | into definitionblock code_regex B0D3 replaceall_matched begin HDAU end; 8 | 9 | # for GFX0 SSDT 10 | 11 | # Note: Change your layout ID if you need something different 12 | 13 | # inject "hda-gfx"="onboard-1" into IGPU (GFX0 originally) 14 | into method label _DSM parent_adr 0x00020000 remove_entry; 15 | into device name_adr 0x00020000 insert 16 | begin 17 | Method (_DSM, 4, NotSerialized)\n 18 | {\n 19 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 20 | Return (Package()\n 21 | {\n 22 | "hda-gfx", Buffer() { "onboard-1" },\n 23 | })\n 24 | }\n 25 | end; 26 | 27 | # inject "hda-gfx"="onboard-1" into HDAU (B0D3 originally) 28 | into method label _DSM parent_adr 0x00030000 remove_entry; 29 | into device name_adr 0x00030000 insert 30 | begin 31 | Method (_DSM, 4, NotSerialized)\n 32 | {\n 33 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 34 | Return (Package()\n 35 | {\n 36 | "layout-id", Buffer() { 14, 0x00, 0x00, 0x00 },\n 37 | "hda-gfx", Buffer() { "onboard-1" },\n 38 | })\n 39 | }\n 40 | end; 41 | 42 | into device label B0D3 set_label begin HDAU end; 43 | into method label SBCB code_regex B0D3 replaceall_matched begin HDAU end; 44 | -------------------------------------------------------------------------------- /graphics/graphics_Rename-GFX0.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Rename-GFX0.txt 3 | 4 | # Note: Most DSDT/SSDTs use GFX0 for the integrated graphics device, 5 | # but there are few renegades that use VID or AGP1. 6 | # If your DSDT uses VID or AGP1 instead of GFX0, see the 7 | # alternate patch "Rename VID/AGP1 to IGPU" 8 | 9 | # sometimes there is already IGPU used for other things 10 | into_all all code_regex IGPU, replaceall_matched begin IGFX, end; 11 | 12 | # rename GFX0 -> IGPU for better power management 13 | into_all all code_regex GFX0\. replaceall_matched begin IGPU. end; 14 | into_all all code_regex \.GFX0 replaceall_matched begin .IGPU end; 15 | into_all all code_regex \sGFX0, replaceall_matched begin IGPU, end; 16 | into_all all code_regex \(GFX0 replaceall_matched begin (IGPU end; 17 | into_all all label GFX0 set_label begin IGPU end; 18 | into_all all label _SB.PCI0.GFX0 set_label begin _SB.PCI0.IGPU end; 19 | into_all all label \_SB.PCI0.GFX0 set_label begin \_SB.PCI0.IGPU end; 20 | into_all all label _SB.PCI0.GFX0.DD02 set_label begin _SB.PCI0.IGPU.DD02 end; 21 | into_all all label \_SB.PCI0.GFX0.DD02 set_label begin \_SB.PCI0.IGPU.DD02 end; 22 | into_all all label ^^^GFX0 set_label begin ^^^IGPU end; 23 | into_all all label ^^GFX0 set_label begin ^^IGPU end; 24 | into_all all label ^GFX0 set_label begin ^IGPU end; 25 | -------------------------------------------------------------------------------- /graphics/graphics_Rename-PCI0_GFX0.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Rename-PCI0_GFX0.txt 3 | 4 | # Note: Most DSDT/SSDTs use GFX0 for only the integrated graphics 5 | # device. But some use it for both the integrated device 6 | # at PCI0.GFX0 and the discrete device at PCI0.PEGP.GFX0. 7 | # This patch is for the latter scenario. 8 | 9 | # Note: This patch is a minimalistic rename that only 10 | # touches PCI0.GFX0. Useful for some machines 11 | # that have both a PCI0.GFX0 and PCI0.PEG.GFX0. 12 | 13 | into device label GFX0 parent_label PCI0 set_label begin IGPU end; 14 | into_all all code_regex PCI0\.GFX0 replaceall_matched begin PCI0.IGPU end; 15 | into_all scope label \_SB.PCI0.GFX0.LCD0 set_label begin \_SB.PCI0.IGPU.LCD0 end; 16 | into_all scope label \_SB.PCI0.GFX0 set_label begin \_SB.PCI0.IGPU end; -------------------------------------------------------------------------------- /graphics/graphics_Rename-PCI0_VID.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Rename-PCI0_VID.txt 3 | 4 | # Note: Most DSDT/SSDTs use GFX0 for the integrated graphics 5 | # device. If that is the case with your DSDT, do not use this 6 | # patch and instead use "Rename GFX0 to IGPU" 7 | 8 | # Note: This patch is a minimalistic rename that only 9 | # touches PCI0.VID. Useful for some Lenovo machines 10 | # that have both a PCI0.VID and PCI0.PEG.VID. 11 | 12 | into device label VID parent_label PCI0 set_label begin IGPU end; 13 | into_all all code_regex PCI0\.VID_ replaceall_matched begin PCI0.IGPU end; 14 | into_all all code_regex PCI0\.VID replaceall_matched begin PCI0.IGPU end; 15 | into_all scope label \_SB.PCI0.VID.LCD0 set_label begin \_SB.PCI0.IGPU.LCD0 end; 16 | into_all scope label \_SB.PCI0.VID set_label begin \_SB.PCI0.IGPU end; -------------------------------------------------------------------------------- /graphics/graphics_Rename-VID_AGP1.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_Rename-VID_AGP1.txt 3 | 4 | # Note: Most DSDT/SSDTs use GFX0 for the integrated graphics 5 | # device. If that is the case with your DSDT, do not use this 6 | # patch and instead use "Rename GFX0 to IGPU" 7 | 8 | # Note: Applying all of the patches contained herein can cause 9 | # problems. Most of the time, you need only one of the main 10 | # groups. Use the MaciASL preview window to determine which 11 | # patches you actually need, and remove the ones you don't need 12 | # or are incorrect for your DSDT before applying the patch. 13 | 14 | # sometimes there is already IGPU used for other things 15 | into_all all code_regex IGPU, replaceall_matched begin IGFX, end; 16 | 17 | # and its aliases: VID_/VID 18 | # do VID_ rename first 19 | into_all all code_regex VID_\. replaceall_matched begin IGPU. end; 20 | into_all all code_regex \.VID_ replaceall_matched begin .IGPU end; 21 | into_all all code_regex \sVID_, replaceall_matched begin IGPU, end; 22 | into_all all code_regex \(VID_ replaceall_matched begin (IGPU end; 23 | into_all all label VID_ set_label begin IGPU end; 24 | into_all all label _SB.PCI0.VID_ set_label begin _SB.PCI0.IGPU end; 25 | into_all all label \_SB.PCI0.VID_ set_label begin \_SB.PCI0.IGPU end; 26 | into_all all label _SB.PCI0.VID_.DD02 set_label begin _SB.PCI0.IGPU.DD02 end; 27 | into_all all label \_SB.PCI0.VID_.DD02 set_label begin \_SB.PCI0.IGPU.DD02 end; 28 | into_all all label ^^VID_ set_label begin ^^IGPU end; 29 | into_all all label ^VID_ set_label begin ^IGPU end; 30 | into_all all label PCI0.PEG.VID_ set_label begin PCI0.PEG.IGPU end; 31 | # then VID rename... 32 | into_all all code_regex VID\. replaceall_matched begin IGPU. end; 33 | into_all all code_regex \.VID\s replaceall_matched begin .IGPU end; 34 | into_all all code_regex \sVID, replaceall_matched begin IGPU, end; 35 | into_all all code_regex \(VID replaceall_matched begin (IGPU end; 36 | into_all all code_regex _SB.PCI0.VID replaceall_matched begin _SB.PCI0.IGPU end; 37 | into_all all label VID set_label begin IGPU end; 38 | into_all all label _SB.PCI0.VID set_label begin _SB.PCI0.IGPU end; 39 | into_all all label \_SB.PCI0.VID set_label begin \_SB.PCI0.IGPU end; 40 | into_all all label _SB.PCI0.VID.DD02 set_label begin _SB.PCI0.IGPU.DD02 end; 41 | into_all all label \_SB.PCI0.VID.DD02 set_label begin \_SB.PCI0.IGPU.DD02 end; 42 | into_all all label ^^VID set_label begin ^^IGPU end; 43 | into_all all label ^VID set_label begin ^IGPU end; 44 | into_all all label PCI0.PEG.VID set_label begin PCI0.PEG.IGPU end; 45 | 46 | # and another: AGP1 47 | into_all all code_regex AGP1\. replaceall_matched begin IGPU. end; 48 | into_all all code_regex \.AGP1 replaceall_matched begin .IGPU end; 49 | into_all all code_regex \sAGP1, replaceall_matched begin IGPU, end; 50 | into_all all code_regex \(AGP1 replaceall_matched begin (IGPU end; 51 | into_all all label AGP1 set_label begin IGPU end; 52 | into_all all label _SB.PCI0.AGP1 set_label begin _SB.PCI0.IGPU end; 53 | into_all all label \_SB.PCI0.AGP1 set_label begin \_SB.PCI0.IGPU end; 54 | into_all all label _SB.PCI0.AGP1.DD02 set_label begin _SB.PCI0.IGPU.DD02 end; 55 | into_all all label \_SB.PCI0.AGP1.DD02 set_label begin \_SB.PCI0.IGPU.DD02 end; 56 | into_all all label ^^AGP1 set_label begin ^^IGPU end; 57 | into_all all label ^AGP1 set_label begin ^IGPU end; 58 | -------------------------------------------------------------------------------- /graphics/graphics_SSDT-disable-cleanup.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_SSDT-disable-cleanup.txt 3 | 4 | # These patches can be used to clean common errors in SSDTs 5 | # commonly used by laptops with switched dual-GPU setups. 6 | 7 | into device label WMI1 remove_entry; 8 | into_all all code_regex .*WMI1.* removeall_matched; 9 | 10 | into_all method label MXMX remove_entry; 11 | into_all method label _DSM remove_entry; 12 | into_all method label HDSM remove_entry; 13 | into_all method label HGAS remove_entry; 14 | into_all method label HNOT remove_entry; 15 | into_all method label HDOS remove_entry; 16 | 17 | into all code_regex Name\s+\(_IRC,\s+([^\)].*)\) replace_matched 18 | begin 19 | Method(_IRC, 0, NotSerialized) { Return(%1) } 20 | end; 21 | 22 | # if using refs.txt (recommended), this patch not needed 23 | into method label _BCM code_regex (\s*)(Arg0)$ replace_matched begin %1//%2 end; 24 | -------------------------------------------------------------------------------- /graphics/graphics_nvidia_laptop.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #graphics_nvidia_laptop.txt 3 | 4 | # 5 | # This is a capture from a DSDT for a laptop with nvidia 6 | # 7 | # These injects may or may not be of use, but use it as 8 | # ideas for what you might have to do. 9 | # 10 | 11 | into method label _DSM parent_label PEGP remove_entry; 12 | into device name_adr 0 label PEGP insert 13 | begin 14 | Method(_DSM, 4, NotSerialized)\n 15 | {\n 16 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 17 | Return (Package()\n 18 | {\n 19 | "AAPL,slot-name", "PCI x16", 20 | "@0,compatible", Buffer() { "NVDA,NVMac" }, 21 | "@0,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 }, 22 | "@0,device_type", Buffer() { "display" }, 23 | "@0,name", Buffer() { "NVDA,Display-A" }, 24 | "@1,compatible", Buffer() { "NVDA,NVMac" }, 25 | "@1,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 }, 26 | "@1,device_type", Buffer() { "display" }, 27 | "@1,name", Buffer() { "NVDA,Display-B" }, 28 | "NVCAP", Buffer(0x18) 29 | { 30 | 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 31 | 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 32 | 0x00, 0x00, 0x00, 0x00 33 | }, 34 | "VRAM,totalsize", Buffer() { 0x00, 0x00, 0x00, 0xC0 }, 35 | "device_type", Buffer() { "NVDA,Parent" }, 36 | "model", Buffer() { "GeForce GTX 560M" }, 37 | "rom-revision", Buffer() { "nVidia GTX 560M OpenGL Engine" }, 38 | "hda-gfx", Buffer() { "onboard-1" } 39 | })\n 40 | }\n 41 | end; 42 | 43 | -------------------------------------------------------------------------------- /graphics/graphics_nvidia_laptop2.txt: -------------------------------------------------------------------------------- 1 | into device label VGA parent_label PEGP set_label begin GFX0 end; 2 | into_all method code_regex PEGP\.VGA replaceall_matched begin PEGP.GFX0 end; 3 | 4 | into method label _DSM parent_label GFX0 remove_entry; 5 | into device name_adr Zero label GFX0 insert 6 | begin 7 | Method(_DSM, 4, NotSerialized)\n 8 | {\n 9 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 10 | Return (Package()\n 11 | {\n 12 | "@0,compatible", Buffer() { "NVDA,NVMac" }, 13 | "@0,device_type", Buffer () { "display" }, 14 | "@0,name", Buffer() { "NVDA,Display-A" }, 15 | "@1,compatible", Buffer() { "NVDA,NVMac" }, 16 | "@1,device_type", Buffer() { "display" }, 17 | "@1,name", Buffer() { "NVDA,Display-B" }, 18 | "NVCAP", Buffer() 19 | { 20 | /* 0000 */ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 21 | /* 0008 */ 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 22 | /* 0010 */ 0x00, 0x00, 0x00, 0x00 23 | }, 24 | "VRAM,totalsize", Buffer() { 0x00, 0x00, 0x00, 0x20 }, 25 | "device_type", Buffer() { "NVDA,GeForce" }, 26 | "model", Buffer() { "Nvidia GeForce 9600M GT" }, 27 | "rom-revision", Buffer() { "DSDT ROM v.1a #irc.osx86.es (c)" }, 28 | "reg", Buffer() 29 | { 30 | /* 0000 */ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x02, 33 | /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 35 | /* 0028 */ 0x14, 0x00, 0x01, 0x42, 0x00, 0x00, 0x00, 0x00, 36 | /* 0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | /* 0038 */ 0x00, 0x00, 0x00, 0x10, 0x1C, 0x00, 0x01, 0x02, 38 | /* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | /* 0048 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 40 | /* 0050 */ 0x24, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 41 | /* 0058 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | /* 0060 */ 0x80, 0x00, 0x00, 0x00, 0x30, 0x00, 0x01, 0x02, 43 | /* 0068 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | /* 0070 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00 45 | } 46 | })\n 47 | }\n 48 | end; 49 | 50 | -------------------------------------------------------------------------------- /misc/misc_Haswell-LPC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #misc_Haswell-LPC.txt 3 | 4 | # inject "compatible" with recognized series-8 LPC device-id 5 | into method label _DSM parent_adr 0x001F0000 remove_entry; 6 | into device name_adr 0x001F0000 insert 7 | begin 8 | Method (_DSM, 4, NotSerialized)\n 9 | {\n 10 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 11 | Return (Package()\n 12 | {\n 13 | "compatible", "pci8086,9c43",\n 14 | })\n 15 | }\n 16 | end; 17 | -------------------------------------------------------------------------------- /misc/misc_LidPoll.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #misc_LidPoll.txt 3 | 4 | # 5 | # Work around for non-working LID notification. 6 | # 7 | # EXPERIMENTAL 8 | # 9 | # In order for this to work, you must install ACPIPoller.kext 10 | # 11 | 12 | into device label LIDP remove_entry; 13 | into definitionblock code_regex . insert 14 | begin 15 | Device (LIDP)\n 16 | {\n 17 | Name (_HID, "FAN00000")\n 18 | Name (PLID, 0xFFFF)\n 19 | // Poll for _LID status changes, notify if different\n 20 | Method (FCPU, 0, Serialized)\n 21 | {\n 22 | Store(\_SB.LID0._LID(), Local0)\n 23 | if (LNotEqual(Local0, PLID))\n 24 | {\n 25 | Store(Local0, PLID)\n 26 | Notify(\_SB.LID0, 0x80)\n 27 | }\n 28 | }\n 29 | }\n 30 | end; 31 | -------------------------------------------------------------------------------- /misc/misc_Lid_PRW.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #misc_Lid_PRW.txt 3 | 4 | # 5 | # Note: Some people report that adding just this patch fixes 6 | # their lid problems. Try this patch without "Poll for Lid changes" 7 | # or use both together. 8 | # 9 | # Also note with this patch, wakeup via lid will be disabled. 10 | # 11 | 12 | # remove either _PRW Method or _PRW Name from PNP0C0D (ACPI LID) 13 | into method label _PRW parent_hid PNP0C0D remove_entry; 14 | into device name_hid PNP0C0D code_regex Name\s+\(_PRW,[\s\S]*\}\) remove_matched; 15 | -------------------------------------------------------------------------------- /misc/misc_Skylake-LPC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #misc_Skylake-LPC.txt 3 | 4 | # inject "compatible" with recognized series-100 LPC device-id 5 | into method label _DSM parent_adr 0x001F0000 remove_entry; 6 | into device name_adr 0x001F0000 insert 7 | begin 8 | Method (_DSM, 4, NotSerialized)\n 9 | {\n 10 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 11 | Return (Package()\n 12 | {\n 13 | "compatible", "pci8086,9cc1",\n 14 | })\n 15 | }\n 16 | end; 17 | -------------------------------------------------------------------------------- /syntax/fix_ADBG.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_ADBG.txt 3 | 4 | into method label ADBG replace_content begin Return(0) end; 5 | 6 | -------------------------------------------------------------------------------- /syntax/fix_FDE.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_FDE.txt 3 | 4 | # _FDE is supposed to return a Buffer 5 | into_all all code_regex Name\s+\(_FDE,\s+Package\s+\(([^\)].*)\) replaceall_matched 6 | begin 7 | Name (_FDE, Buffer(%1) 8 | end; 9 | 10 | -------------------------------------------------------------------------------- /syntax/fix_FPED.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_FPED.txt 3 | 4 | # Fix FPED parse error 5 | into device label GFX0 code_regex If\s\(CondRefOf\s\(FPED\)\)\s*\n\s*\{\s*\n\s*FPED\s\(\)\s*\n\s*\} remove_matched; 6 | -------------------------------------------------------------------------------- /syntax/fix_HID_pnp.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_HID_pnp.txt 3 | 4 | # To fix Name(_HID, "*pnpXXXX") and Name(_HID, "pnpXXXX") 5 | 6 | into_all all code_regex (Name\s+\(_HID,\s+\")\*pnp(.*\") replaceall_matched begin %1PNP%2 end; 7 | into_all all code_regex (Name\s+\(_HID,\s+\")pnp(.*\") replaceall_matched begin %1PNP%2 end; 8 | 9 | -------------------------------------------------------------------------------- /syntax/fix_IRC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_IRC.txt 3 | 4 | into device label VID parent_label PEG code_regex Name\s+\(_IRC,\s+([^\)].*)\) replace_matched 5 | begin 6 | Method(_IRC, 0, NotSerialized) { Return(%1) } 7 | end; 8 | 9 | into_all device code_regex Name\s+\(_IRC,\s+([^\)].*)\) replace_matched 10 | begin 11 | Method(_IRC, 0, NotSerialized) { Return(%1) } 12 | end; -------------------------------------------------------------------------------- /syntax/fix_MMTB.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_MMTB.txt 3 | 4 | # To fix PARSEOP_STORE error when MMTB is not defined anywhere 5 | 6 | #into method label _INI parent_label _SB.PCI0 code_regex (Store\s\(\\_GPE\.MMTB.*) replace_matched begin // %1 end; 7 | #into method label _WAK code_regex (Store\s\(\\_GPE\.MMTB.*) replace_matched begin // %1 end; 8 | 9 | into_all method code_regex (Store\s\(\\_GPE\.MMTB.*) replaceall_matched begin // %1 end; 10 | 11 | # Also to fix HRPR which can reference MMTB in an OperationRegion definition 12 | 13 | into method label HRPR remove_entry; 14 | 15 | -------------------------------------------------------------------------------- /syntax/fix_PARSEOP_ZERO.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_PARSEOP_ZERO.txt 3 | 4 | # credit toleda: http://www.tonymacx86.com/dsdt/89727-maciasl-patch-repository-thread.html#post574047 5 | 6 | into device label PCI0 code_regex (\s+Zero){2,} removeall_matched; 7 | 8 | # if you need something more agressive... 9 | #into_all all code_regex (\s+Zero){2,} removeall_matched; 10 | #into device label PCI0 code_regex (\s+Zero){2,} removeall_matched; -------------------------------------------------------------------------------- /syntax/fix_PARSEOP_ZERO_agressive.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_PARSEOP_ZERO.txt 3 | 4 | # credit toleda: http://www.tonymacx86.com/dsdt/89727-maciasl-patch-repository-thread.html#post574047 5 | 6 | into device label PCI0 code_regex (\s+Zero){2,} removeall_matched; 7 | 8 | # if you need something more agressive... 9 | into_all all code_regex (\s+Zero){2,} removeall_matched; 10 | into device label PCI0 code_regex (\s+Zero){2,} removeall_matched; 11 | -------------------------------------------------------------------------------- /syntax/fix_PLD.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_PLD.txt 3 | 4 | # _PLD is supposed to return a variable length Package of Buffers 5 | into_all all code_regex (Name\s*\(_PLD,\s*)Buffer(\s\([^\)].*\)[^\)]*) replaceall_matched 6 | begin 7 | %1Package() { Buffer%2 } 8 | end; 9 | 10 | # _PLD return case, courtesy stargazer418 11 | into_all all code_regex (Return\s)\(Buffer(\s\(0x10\)[^\)]*) replaceall_matched 12 | begin 13 | %1(Package() { Buffer%2} 14 | end; 15 | 16 | # 17 | 18 | # REVIEW: below is causing issues... 19 | #into_all all code_regex (Name\s*\(_PLD,\s*)Package(\s\([^\)].*\)[^\)]*) replaceall_matched 20 | #begin 21 | #%1Package() { Buffer%2 } 22 | #end; 23 | 24 | #into_all all code_regex (Return\s)\(Package(\s\(0x10\)[^\)]*) replaceall_matched 25 | #begin 26 | #%1(Package() { Buffer%2} 27 | #end; 28 | 29 | -------------------------------------------------------------------------------- /syntax/fix_PSS.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_PSS.txt 3 | 4 | # for one of the CPU SSDTs... 5 | 6 | # remove bogus: 7 | # 8 | # Package (0x06) 9 | # { 10 | # 0x80000000, 11 | # 0x80000000, 12 | # 0x80000000, 13 | # 0x80000000, 14 | # 0x80000000, 15 | # 0x80000000 16 | # } 17 | 18 | into_all all code_regex Package\s+\(0x06\)\n.*\{\n(.*0x80000000.*\n){6}.*\} removeall_matched; 19 | 20 | -------------------------------------------------------------------------------- /syntax/fix_TNOT.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #fix_TNOT.txt 3 | 4 | # TNOT fix 5 | into definitionblock code_regex External\s+\(\\TNOT\) remove_matched; 6 | into_all all code_regex CondRefOf\s+\(\\TNOT\) replaceall_matched begin CondRefOf(TNOT) end; -------------------------------------------------------------------------------- /syntax/remove_DSM.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #remove_DSM.txt 3 | 4 | # To remove all _DSM methods 5 | # If used, this should be one of the first patches you apply. 6 | 7 | into_all method label _DSM remove_entry; 8 | -------------------------------------------------------------------------------- /syntax/rename_DSM.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #rename_DSM.txt 3 | 4 | # To remove all _DSM methods by renaming to XDSM. 5 | # 6 | # Since "Remove _DSM methods" exposes a MaciASL bug with certain files, 7 | # this one can be used instead. 8 | 9 | into_all method label _DSM set_label begin XDSM end; 10 | into_all method code_regex _DSM replaceall_matched begin XDSM end; 11 | -------------------------------------------------------------------------------- /system/system_ADP1.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_ADP1.txt 3 | 4 | # Note: if AppleACPIACAdapter is already loading (look at your ioreg), then 5 | # this patch is not necessary for you. 6 | 7 | # Note: Old patch used to rename AC or ACAD to ADP1 to be more "Apple" like 8 | # Turns out, this is not needed. 9 | 10 | # Replace all instances of AC with ADP1 11 | #into_all all code_regex \.AC, replaceall_matched begin .ADP1, end; 12 | #into_all all code_regex \(AC, replaceall_matched begin (ADP1, end; 13 | #into all label AC set_label begin ADP1 end; 14 | 15 | # Replace all instances of ACAD with ADP1 16 | #into_all all code_regex \.ACAD, replaceall_matched begin .ADP1, end; 17 | #into_all all code_regex \(ACAD, replaceall_matched begin (ADP1, end; 18 | #into all label ACAD set_label begin ADP1 end; 19 | 20 | # Power fix - cause AppleACPIACAdapter to be loaded 21 | into device name_hid ACPI0003 code_regex Name\s+\(_PRW,[\s\S]*\}\) remove_matched; 22 | into device name_hid ACPI0003 insert 23 | begin 24 | Name (_PRW, Package() { 0x18, 0x03 }) 25 | end; 26 | -------------------------------------------------------------------------------- /system/system_HPET.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_HPET.txt 3 | 4 | # If you have panic "No HPETs available..." or have a abrubt restart 5 | # after waking from sleep, you may need this patch. 6 | # The patch makes sure the HPET device is always available. 7 | 8 | # HPET fix to avoid AppleIntelCPUPowerManagement panic 9 | into method label _STA parent_hid PNP0103 remove_entry; 10 | into device name_hid PNP0103 code_regex Name\s\(_STA\,\s+0x0F\) remove_matched; 11 | into device name_hid PNP0103 insert 12 | begin 13 | Name (_STA, 0x0F)\n 14 | end; 15 | 16 | into method label _CRS parent_hid PNP0103 remove_entry; 17 | into device name_hid PNP0103 insert 18 | begin 19 | Method (_CRS, 0, NotSerialized)\n 20 | {\n 21 | Return (BUF0)\n 22 | }\n 23 | end; 24 | -------------------------------------------------------------------------------- /system/system_IAOE.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_IAOE.txt 3 | 4 | # _PTS and _WAK in this DSDT tend to manipulate externals 5 | # in the IAOE device. Some manipulates are protected with 6 | # CondRefOf, and some not. Because of the unprotected 7 | # references, the IAOE SSDT must be included for sleep to 8 | # work. 9 | 10 | # This patch is an attempt to fix _PTS/_WAK such that IAOE is 11 | # not required. 12 | 13 | # _PTS fixes 14 | into method label _PTS code_regex If\s+\(And\s+\(ICNF,\s+One\)\) replace_matched 15 | begin 16 | If (LAnd(CondRefOf(\\_SB.IAOE), And(ICNF,One))) 17 | end; 18 | 19 | # _WAK fixes 20 | into method label _WAK code_regex If\s+\(And\s+\(\\_SB\.PCI0\.GFX0\.TCHE,\s+0x0100\)\) replace_matched 21 | begin 22 | If (LAnd(CondRefOf(\\_SB.IAOE), And(\\_SB.PCI0.GFX0.TCHE, 0x0100))) 23 | end; 24 | ze 25 | into method label _WAK code_regex (If\s+\(LEqual\s+\(\\_SB\.IAOE\.ITMR,\s+Zero\)\)(\n.*){9}) replace_matched 26 | begin 27 | If (CondRefOf(\\_SB.IAOE)) {\n 28 | %1\n 29 | } 30 | end; 31 | 32 | into method label _WAK code_regex If\s+\(LEqual\s+\(\\_SB\.IAOE\.ITMR,\s+(Zero|0x00)\)\)\s+\{\} remove_matched; -------------------------------------------------------------------------------- /system/system_IMEI.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_IMEI.txt 3 | 4 | # if you already have an IMEI/HECI/MEI device, you should not use this patch 5 | # but if you do, these patches will remove the existing one 6 | into device name_adr 0x00160000 remove_entry; 7 | into device label IMEI parent_label PCI0 remove_entry; 8 | 9 | # add missing IMEI device 10 | into device label PCI0 insert 11 | begin 12 | Device (IMEI)\n 13 | {\n 14 | Name (_ADR, 0x00160000)\n 15 | }\n 16 | end; 17 | 18 | -------------------------------------------------------------------------------- /system/system_IRQ.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_IRQ.txt 3 | 4 | # This can fix non-working audio and also has an affect on HPET. 5 | # 6 | # Use this if you have issues with patched AppleHDA (required on almost all laptops) 7 | # or if you have issues with HPET (restart after wake). 8 | 9 | # IRQ fix 10 | into device name_hid PNP0000 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; 11 | into device name_hid PNP0100 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; 12 | into device name_hid PNP0B00 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; 13 | into device name_hid PNP0103 code_regex IRQNoFlags\s\(\)\n\s+\{.*\} removeall_matched; 14 | into device name_hid PNP0103 code_regex Name\s\(([^,]+),\sResourceTemplate\s\(\).*\n\s+\{((?:.|\n)*)\}\) replace_matched 15 | begin 16 | Name (%1, ResourceTemplate()\n 17 | {\n 18 | IRQNoFlags() { 0, 8, 11, 15 }\n 19 | %2 20 | })\n 21 | end; 22 | -------------------------------------------------------------------------------- /system/system_MCHC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_MCHC.txt 3 | 4 | # Patch Name : Add MCHC 5 | # Credits: From PJALM's Intel7 patches 6 | 7 | # Add the missing MCHC device 8 | into device label MCHC parent_label PCI0 remove_entry; 9 | into device label PCI0 insert begin 10 | Device (MCHC)\n 11 | {\n 12 | Name (_ADR, Zero)\n 13 | } 14 | end; 15 | 16 | -------------------------------------------------------------------------------- /system/system_Mutex.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_Mutex.txt 3 | 4 | # 5 | # Some DSDTs use Mutex objects with non-zero a SyncLevel. Evidently, 6 | # OS X has some difficulty with this part of the ACPI spec, either that 7 | # or the DSDTs are, in fact, codec incorrectly and Windows is ignoring 8 | # it. 9 | 10 | # The common result of a non-zero SyncLevel is failure of methods at the 11 | # point of Acquire on the mutext in question. This can result in strange 12 | # behavior, failed battery status, or other issues. 13 | # 14 | # This patch corrects all Mutex objects declared with a non-zero 15 | # SyncLevel to use zero. 16 | # 17 | 18 | # 2x as there is some sort of MaciASL bug... 19 | # (code_regex_not seems broken) 20 | #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 21 | #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 22 | 23 | # 10x as workaround for MaciASL bug... 24 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 25 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 26 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 27 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 28 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 29 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 30 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 31 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 32 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 33 | into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; 34 | 35 | -------------------------------------------------------------------------------- /system/system_OSYS.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_OSYS.txt 3 | 4 | # Cause the DSDT to simulate "Windows 2006" when running under "Darwin" (OS X). 5 | # 6 | # This can fix various DSDT related problems for code within the DSDT 7 | # that is conditional on the operating system version. 8 | 9 | # sometimes in Scope (_SB.PCI0) 10 | into method label _INI parent_label _SB.PCI0 code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2006\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2006"))) end; 11 | 12 | # sometimes in Scope (_SB) 13 | into method label _INI parent_label _SB code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2006\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2006"))) end; 14 | 15 | # enable this one to be a bit more agressive... 16 | #into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2006\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2006"))) end; 17 | -------------------------------------------------------------------------------- /system/system_OSYS_linux.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_OSYS_linux.txt 3 | 4 | # Cause the DSDT to simulate "Linux" when running under "Darwin" (OS X). 5 | # 6 | # This can fix various DSDT related problems for code within the DSDT 7 | # that is conditional on the operating system version. 8 | 9 | into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Linux\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Linux"))) end; 10 | 11 | -------------------------------------------------------------------------------- /system/system_OSYS_win10.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_OSYS_win10.txt 3 | 4 | # Cause the DSDT to simulate "Windows 2015" when running under "Darwin" (OS X). 5 | # 6 | # This can fix various DSDT related problems for code within the DSDT 7 | # that is conditional on the operating system version. 8 | # 9 | # Sometimes "Windows 2015" is a better choice than "Windows 2006" 10 | 11 | into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2015\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2015"))) end; 12 | 13 | -------------------------------------------------------------------------------- /system/system_OSYS_win7.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_OSYS_win7.txt 3 | 4 | # Cause the DSDT to simulate "Windows 2009" when running under "Darwin" (OS X). 5 | # 6 | # This can fix various DSDT related problems for code within the DSDT 7 | # that is conditional on the operating system version. 8 | # 9 | # Sometimes "Windows 2009" is a better choice than "Windows 2006" 10 | 11 | into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2009\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2009"))) end; 12 | 13 | -------------------------------------------------------------------------------- /system/system_OSYS_win8.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_OSYS_win8.txt 3 | 4 | # Cause the DSDT to simulate "Windows 2012" when running under "Darwin" (OS X). 5 | # 6 | # This can fix various DSDT related problems for code within the DSDT 7 | # that is conditional on the operating system version. 8 | # 9 | # Sometimes "Windows 2012" is a better choice than "Windows 2006" 10 | 11 | into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2012\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2012"))) end; 12 | 13 | -------------------------------------------------------------------------------- /system/system_PNOT.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_PNOT.txt 3 | 4 | # PNOT or PPNT are commonly called from EC/AC adapter related code 5 | # and often access identifiers that are present in SSDTs generally 6 | # dropped (CPU SSDTs) 7 | # 8 | # Because of this, it is best to make these methods do nothing. 9 | 10 | # make PNOT/PPNT/PNTF a no-op 11 | into method label PNOT replace_content begin // nothing end; 12 | into method label PPNT replace_content begin // nothing end; 13 | into method label PNTF replace_content begin // nothing end; 14 | -------------------------------------------------------------------------------- /system/system_RTC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_RTC.txt 3 | 4 | # RTC fix 5 | 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; 6 | -------------------------------------------------------------------------------- /system/system_SMBUS.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_SMBUS.txt 3 | 4 | # SMBUS fix 5 | into device label BUS0 parent_adr 0x001F0003 remove_entry; 6 | into device name_adr 0x001F0003 insert 7 | begin 8 | Device (BUS0)\n 9 | {\n 10 | Name (_CID, "smbus")\n 11 | Name (_ADR, Zero)\n 12 | Device (DVL0)\n 13 | {\n 14 | Name (_ADR, 0x57)\n 15 | Name (_CID, "diagsvault")\n 16 | Method (_DSM, 4, NotSerialized)\n 17 | {\n 18 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 19 | Return (Package() { "address", 0x57 })\n 20 | }\n 21 | }\n 22 | }\n 23 | end; 24 | 25 | -------------------------------------------------------------------------------- /system/system_Shutdown.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_Shutdown.txt 3 | 4 | # Shutdown fix 5 | into method label _PTS code_regex_not If\s\(LEqual\s\(Arg0,\s0x05\)\) code_regex ^((?:.|\n)*)$ replace_matched 6 | begin 7 | If (LEqual (Arg0, 0x05)) {}\n 8 | Else\n 9 | {\n 10 | %1 11 | }\n 12 | end; 13 | -------------------------------------------------------------------------------- /system/system_Shutdown2.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_Shutdown2.txt 3 | 4 | # Shutdown fix v2 5 | into method label _PTS code_regex ([\s\S]*) replace_matched 6 | begin 7 | If (LNotEqual(Arg0,5)) {\n 8 | %1\n 9 | }\n 10 | end; -------------------------------------------------------------------------------- /system/system_Shutdown_restart.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_Shutdown_restart.txt 3 | 4 | # 5 | # This patch is to fix "restart after shutdown" caused by the xHCI controller. 6 | # by setting XHC.PMEE = 0 after _PTS processing (Arg0 == 5), we can avoid restart after shutdown. 7 | # 8 | 9 | into method label _PTS code_regex ([\s\S]*) replace_matched 10 | begin 11 | %1\n 12 | If (5 == Arg0) { \\_SB.PCI0.XHC.PMEE = 0 } 13 | end; 14 | 15 | into method label \_PTS code_regex ([\s\S]*) replace_matched 16 | begin 17 | %1\n 18 | If (5 == Arg0) { \\_SB.PCI0.XHC.PMEE = 0 } 19 | end; 20 | 21 | -------------------------------------------------------------------------------- /system/system_WAK1.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_WAK1.txt 3 | 4 | # 5 | # In 10.8.5 and perhaps later versions of OS X, DSDT method _WAK 6 | # called after resuming from S3 suspend (Sleep, or suspend to RAM), 7 | # is called with garbage in Arg0, where it should be a value 8 | # representing the sleep state being left (1-5). 9 | # 10 | # This causes problems for code in DSDT _WAK method which expects 11 | # and checks against Arg0==3 for wake from sleep to turn on various 12 | # devices or restore internal state to a working state. 13 | # 14 | # This patch adds code at the very beginning of the method to 15 | # force an an out-of-range Arg0 to 3. 16 | # 17 | # The patch depends on there being a call to xWAK (where x is any 18 | # character at the beginning of the method's code. 19 | # 20 | # See system_WAK2.txt for an alternate patch 21 | # 22 | # Note regarding Yosemite: 23 | # At least in Yosemite 10.10.2, this bug appears to be fixed. 24 | # I didn't notice/verify on other versions of Yosemite 25 | # 26 | 27 | into method label _WAK code_regex \s*(.?WAK\s+\([^)]*\)) replace_matched 28 | begin 29 | If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n 30 | %1 31 | end; 32 | 33 | into method label \_WAK code_regex \s*(.?WAK\s+\([^)]*\)) replace_matched 34 | begin 35 | If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n 36 | %1 37 | end; 38 | 39 | -------------------------------------------------------------------------------- /system/system_WAK2.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #system_WAK2.txt 3 | 4 | # 5 | # In 10.8.5 and perhaps later versions of OS X, DSDT method _WAK 6 | # called after resuming from S3 suspend (Sleep, or suspend to RAM), 7 | # is called with garbage in Arg0, where it should be a value 8 | # representing the sleep state being left (1-5). 9 | # 10 | # This causes problems for code in DSDT _WAK method which expects 11 | # and checks against Arg0==3 for wake from sleep to turn on various 12 | # devices or restore internal state to a working state. 13 | # 14 | # This patch adds code at the very beginning of the method to 15 | # force an an out-of-range Arg0 to 3. 16 | # 17 | # See system_WAK1.txt for an alternate patch 18 | # 19 | # Note regarding Yosemite: 20 | # At least in Yosemite 10.10.2, this bug appears to be fixed. 21 | # I didn't notice/verify on other versions of Yosemite 22 | # 23 | 24 | into method label _WAK code_regex ([\s\S]*) replace_matched 25 | begin 26 | If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n 27 | %1 28 | end; 29 | 30 | into method label \_WAK code_regex ([\s\S]*) replace_matched 31 | begin 32 | If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n 33 | %1 34 | end; 35 | 36 | -------------------------------------------------------------------------------- /usb/usb_6-series-id.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_USB_6-series-id.txt 3 | 4 | # USB property injection for 6-series boards (originally HM65) 5 | 6 | # EHCI fix inject Apple properties for device 0x1C26 into EHC1 7 | into method label _DSM parent_adr 0x001D0000 remove_entry; 8 | into device name_adr 0x001D0000 insert 9 | begin 10 | Method (_DSM, 4, NotSerialized)\n 11 | {\n 12 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 13 | Return (Package()\n 14 | {\n 15 | "device-id", Buffer() { 0x26, 0x1c, 0x00, 0x00 },\n 16 | "AAPL,clock-id", Buffer() { 0x01 },\n 17 | "built-in", Buffer() { 0x00 },\n 18 | "device_type", Buffer() { "EHCI" },\n 19 | "AAPL,current-available", 2100,\n 20 | "AAPL,current-extra", 2200,\n 21 | "AAPL,current-extra-in-sleep", 1600,\n 22 | "AAPL,device-internal", 0x02,\n 23 | "AAPL,max-port-current-in-sleep", 2100,\n 24 | })\n 25 | }\n 26 | end; 27 | 28 | # EHCI fix inject Apple properties for device 0x1C2D into EHC2 29 | into method label _DSM parent_adr 0x001A0000 remove_entry; 30 | into device name_adr 0x001A0000 insert 31 | begin 32 | Method (_DSM, 4, NotSerialized)\n 33 | {\n 34 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 35 | Return (Package()\n 36 | {\n 37 | "device-id", Buffer() { 0x2d, 0x1c, 0x00, 0x00 },\n 38 | "AAPL,clock-id", Buffer() { 0x01 },\n 39 | "built-in", Buffer() { 0x00 },\n 40 | "device_type", Buffer() { "EHCI" },\n 41 | "AAPL,current-available", 2100,\n 42 | "AAPL,current-extra", 2200,\n 43 | "AAPL,current-extra-in-sleep", 1600,\n 44 | "AAPL,device-internal", 0x02,\n 45 | "AAPL,max-port-current-in-sleep", 2100,\n 46 | })\n 47 | }\n 48 | end; 49 | 50 | # Insert Apple USB properties into USB 3.0 XHC 51 | into method label _DSM parent_adr 0x00140000 remove_entry; 52 | into device name_adr 0x00140000 insert 53 | begin 54 | Method (_DSM, 4, NotSerialized)\n 55 | {\n 56 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 57 | Return (Package()\n 58 | {\n 59 | "AAPL,clock-id", Buffer() { 0x01 },\n 60 | "built-in", Buffer() { 0x00 },\n 61 | "device_type", Buffer() { "XHCI" },\n 62 | "AAPL,current-available", 2100,\n 63 | "AAPL,current-extra", 2200,\n 64 | "AAPL,current-extra-in-sleep", 1600,\n 65 | "AAPL,device-internal", 0x02,\n 66 | "AAPL,max-port-current-in-sleep", 2100,\n 67 | })\n 68 | }\n 69 | end; 70 | -------------------------------------------------------------------------------- /usb/usb_6-series.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_USB_6-series.txt 3 | 4 | # USB property injection for 6-series boards (originally HM65) 5 | 6 | # EHCI fix inject Apple properties for device 0x1C26 into EHC1 7 | into method label _DSM parent_adr 0x001D0000 remove_entry; 8 | into device name_adr 0x001D0000 insert 9 | begin 10 | Method (_DSM, 4, NotSerialized)\n 11 | {\n 12 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 13 | Return (Package()\n 14 | {\n 15 | "built-in", Buffer() { 0x00 },\n 16 | "AAPL,clock-id", Buffer() { 0x01 },\n 17 | "device_type", Buffer() { "EHCI" },\n 18 | "AAPL,current-available", 2100,\n 19 | "AAPL,current-extra", 2200,\n 20 | "AAPL,current-extra-in-sleep", 1600,\n 21 | "AAPL,device-internal", 0x02,\n 22 | "AAPL,max-port-current-in-sleep", 2100,\n 23 | })\n 24 | }\n 25 | end; 26 | 27 | # EHCI fix inject Apple properties for device 0x1C2D into EHC2 28 | into method label _DSM parent_adr 0x001A0000 remove_entry; 29 | into device name_adr 0x001A0000 insert 30 | begin 31 | Method (_DSM, 4, NotSerialized)\n 32 | {\n 33 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 34 | Return (Package()\n 35 | {\n 36 | "built-in", Buffer() { 0x00 },\n 37 | "AAPL,clock-id", Buffer() { 0x01 },\n 38 | "device_type", Buffer() { "EHCI" },\n 39 | "AAPL,current-available", 2100,\n 40 | "AAPL,current-extra", 2200,\n 41 | "AAPL,current-extra-in-sleep", 1600,\n 42 | "AAPL,device-internal", 0x02,\n 43 | "AAPL,max-port-current-in-sleep", 2100,\n 44 | })\n 45 | }\n 46 | end; 47 | 48 | # Insert Apple USB properties into USB 3.0 XHC 49 | into method label _DSM parent_adr 0x00140000 remove_entry; 50 | into device name_adr 0x00140000 insert 51 | begin 52 | Method (_DSM, 4, NotSerialized)\n 53 | {\n 54 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 55 | Return (Package()\n 56 | {\n 57 | "built-in", Buffer() { 0x00 },\n 58 | "AAPL,clock-id", Buffer() { 0x02 },\n 59 | "device_type", Buffer() { "XHCI" },\n 60 | "AAPL,current-available", 2100,\n 61 | "AAPL,current-extra", 2200,\n 62 | "AAPL,current-extra-in-sleep", 1600,\n 63 | "AAPL,device-internal", 0x02,\n 64 | "AAPL,max-port-current-in-sleep", 2100,\n 65 | })\n 66 | }\n 67 | end; 68 | -------------------------------------------------------------------------------- /usb/usb_7-series-id.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_USB_7-series-id.txt 3 | 4 | # USB property injection for 7-series boards (originally HM76) 5 | 6 | # Insert Apple USB properties into EHC1 7 | into method label _DSM parent_adr 0x001D0000 remove_entry; 8 | into device name_adr 0x001D0000 insert 9 | begin 10 | Method (_DSM, 4, NotSerialized)\n 11 | {\n 12 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 13 | Return (Package()\n 14 | {\n 15 | "device-id", Buffer() { 0x26, 0x1e, 0x00, 0x00 },\n 16 | "AAPL,clock-id", Buffer() { 0x01 },\n 17 | "built-in", Buffer() { 0x00 },\n 18 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 19 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 20 | "AAPL,current-available", 2100,\n 21 | "AAPL,current-extra", 2200,\n 22 | "AAPL,current-extra-in-sleep", 1600,\n 23 | "AAPL,device-internal", 0x02,\n 24 | "AAPL,max-port-current-in-sleep", 2100,\n 25 | })\n 26 | }\n 27 | end; 28 | 29 | # Insert Apple USB properties into EHC2 30 | into method label _DSM parent_adr 0x001A0000 remove_entry; 31 | into device name_adr 0x001A0000 insert 32 | begin 33 | Method (_DSM, 4, NotSerialized)\n 34 | {\n 35 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 36 | Return (Package()\n 37 | {\n 38 | "device-id", Buffer() { 0x2d, 0x1e, 0x00, 0x00 },\n 39 | "AAPL,clock-id", Buffer() { 0x01 },\n 40 | "built-in", Buffer() { 0x00 },\n 41 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 42 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 43 | "AAPL,current-available", 2100,\n 44 | "AAPL,current-extra", 2200,\n 45 | "AAPL,current-extra-in-sleep", 1600,\n 46 | "AAPL,device-internal", 0x02,\n 47 | "AAPL,max-port-current-in-sleep", 2100,\n 48 | })\n 49 | }\n 50 | end; 51 | 52 | # Insert Apple USB properties into USB 3.0 XHC 53 | into method label _DSM parent_adr 0x00140000 remove_entry; 54 | into device name_adr 0x00140000 insert 55 | begin 56 | Method (_DSM, 4, NotSerialized)\n 57 | {\n 58 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 59 | Return (Package()\n 60 | {\n 61 | "device-id", Buffer() { 0x31, 0x1e, 0x00, 0x00 },\n 62 | "built-in", Buffer() { 0x00 },\n 63 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 64 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 65 | "AAPL,current-available", 2100,\n 66 | "AAPL,current-extra", 2200,\n 67 | "AAPL,current-extra-in-sleep", 1600,\n 68 | "AAPL,device-internal", 0x02,\n 69 | "AAPL,max-port-current-in-sleep", 2100,\n 70 | })\n 71 | }\n 72 | end; 73 | -------------------------------------------------------------------------------- /usb/usb_7-series.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_USB_7-series.txt 3 | 4 | # USB property injection for 7-series boards (originally HM76) 5 | 6 | # Insert Apple USB properties into EHC1 7 | into method label _DSM parent_adr 0x001D0000 remove_entry; 8 | into device name_adr 0x001D0000 insert 9 | begin 10 | Method (_DSM, 4, NotSerialized)\n 11 | {\n 12 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 13 | Return (Package()\n 14 | {\n 15 | "AAPL,clock-id", Buffer() { 0x01 },\n 16 | "built-in", Buffer() { 0x00 },\n 17 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 18 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 19 | "AAPL,current-available", 2100,\n 20 | "AAPL,current-extra", 2200,\n 21 | "AAPL,current-extra-in-sleep", 1600,\n 22 | "AAPL,device-internal", 0x02,\n 23 | "AAPL,max-port-current-in-sleep", 2100,\n 24 | })\n 25 | }\n 26 | end; 27 | 28 | # Insert Apple USB properties into EHC2 29 | into method label _DSM parent_adr 0x001A0000 remove_entry; 30 | into device name_adr 0x001A0000 insert 31 | begin 32 | Method (_DSM, 4, NotSerialized)\n 33 | {\n 34 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 35 | Return (Package()\n 36 | {\n 37 | "AAPL,clock-id", Buffer() { 0x01 },\n 38 | "built-in", Buffer() { 0x00 },\n 39 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 40 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 41 | "AAPL,current-available", 2100,\n 42 | "AAPL,current-extra", 2200,\n 43 | "AAPL,current-extra-in-sleep", 1600,\n 44 | "AAPL,device-internal", 0x02,\n 45 | "AAPL,max-port-current-in-sleep", 2100,\n 46 | })\n 47 | }\n 48 | end; 49 | 50 | # Insert Apple USB properties into USB 3.0 XHC 51 | into method label _DSM parent_adr 0x00140000 remove_entry; 52 | into device name_adr 0x00140000 insert 53 | begin 54 | Method (_DSM, 4, NotSerialized)\n 55 | {\n 56 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 57 | Return (Package()\n 58 | {\n 59 | "AAPL,clock-id", Buffer() { 0x02 },\n 60 | "built-in", Buffer() { 0x00 },\n 61 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 62 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 63 | "AAPL,current-available", 2100,\n 64 | "AAPL,current-extra", 2200,\n 65 | "AAPL,current-extra-in-sleep", 1600,\n 66 | "AAPL,device-internal", 0x02,\n 67 | "AAPL,max-port-current-in-sleep", 2100,\n 68 | })\n 69 | }\n 70 | end; 71 | -------------------------------------------------------------------------------- /usb/usb_prw_0x0d_xhc_skl.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_prw_0x0d_xhc_skl.txt 3 | 4 | # remove _PRW methods to prevent instant wake 5 | 6 | # delete any existing XHC1 device 7 | into device label XHC1 name_adr 0x00140000 remove_entry; 8 | 9 | # if _PRW objects are methods 10 | into method label _PRW parent_adr 0x00140000 remove_entry; 11 | into method label _PRW parent_adr 0x00140001 remove_entry; 12 | into method label _PRW parent_adr 0x001F0003 remove_entry; 13 | # some other LAN cards use 0x00190000 14 | into method label _PRW parent_adr 0x00190000 remove_entry; 15 | into method label _PRW parent_adr 0x001F0006 remove_entry; 16 | 17 | # if _PRW methods are stuffed into a separate scope 18 | into method label _PRW parent_label _SB.PCI0.EHC1 remove_entry; 19 | into method label _PRW parent_label _SB.PCI0.EHC2 remove_entry; 20 | into method label _PRW parent_label _SB.PCI0.XHC remove_entry; 21 | into method label _PRW parent_label \_SB.PCI0.EHC1 remove_entry; 22 | into method label _PRW parent_label \_SB.PCI0.EHC2 remove_entry; 23 | into method label _PRW parent_label \_SB.PCI0.XHC remove_entry; 24 | 25 | # if _PRW objects are names 26 | into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 27 | into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 28 | into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 29 | into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 30 | into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 31 | # some _PRW have three entries in the Package 32 | into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 33 | into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 34 | into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 35 | into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 36 | into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 37 | 38 | # seems to work better if _PRW is present, but returns 0 (original was 3) for sleep state 39 | # Note: These are methods because some Skylake DSDT call _PRW as a method for no reason 40 | into device name_adr 0x00140000 insert begin Method(_PRW) { Return(Package() { 0x0D, 0 }) } end; 41 | into device name_adr 0x00140001 insert begin Method(_PRW) { Return(Package() { 0x0D, 0 }) } end; 42 | into device name_adr 0x001F0003 insert begin Method(_PRW) { Return(Package() { 0x0D, 0 }) } end; 43 | into device name_adr 0x00190000 insert begin Method(_PRW) { Return(Package() { 0x0D, 0 }) } end; 44 | into device name_adr 0x001F0006 insert begin Method(_PRW) { Return(Package() { 0x0D, 0 }) } end; 45 | 46 | # Insert Apple USB properties into USB 3.0 XHC 47 | into method label _DSM parent_adr 0x00140000 remove_entry; 48 | into device name_adr 0x00140000 insert 49 | begin 50 | Method (_DSM, 4, NotSerialized)\n 51 | {\n 52 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 53 | Return (Package()\n 54 | {\n 55 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 56 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 57 | "AAPL,current-available", 2100,\n 58 | "AAPL,current-extra", 2200,\n 59 | "AAPL,current-extra-in-sleep", 1600,\n 60 | "AAPL,device-internal", 0x02,\n 61 | "AAPL,max-port-current-in-sleep", 2100,\n 62 | })\n 63 | }\n 64 | end; 65 | 66 | 67 | -------------------------------------------------------------------------------- /usb/usb_prw_0x6d_xhc_skl.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #usb_prw_0x6d_xhc_skl.txt 3 | 4 | # remove _PRW methods to prevent instant wake 5 | 6 | # delete any existing XHC1 device 7 | into device label XHC1 name_adr 0x00140000 remove_entry; 8 | 9 | # if _PRW objects are methods 10 | into method label _PRW parent_adr 0x00140000 remove_entry; 11 | into method label _PRW parent_adr 0x00140001 remove_entry; 12 | into method label _PRW parent_adr 0x001F0003 remove_entry; 13 | # some other LAN cards use 0x00190000 14 | into method label _PRW parent_adr 0x00190000 remove_entry; 15 | into method label _PRW parent_adr 0x001F0006 remove_entry; 16 | 17 | # if _PRW methods are stuffed into a separate scope 18 | into method label _PRW parent_label _SB.PCI0.EHC1 remove_entry; 19 | into method label _PRW parent_label _SB.PCI0.EHC2 remove_entry; 20 | into method label _PRW parent_label _SB.PCI0.XHC remove_entry; 21 | into method label _PRW parent_label \_SB.PCI0.EHC1 remove_entry; 22 | into method label _PRW parent_label \_SB.PCI0.EHC2 remove_entry; 23 | into method label _PRW parent_label \_SB.PCI0.XHC remove_entry; 24 | 25 | # if _PRW objects are names 26 | into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 27 | into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 28 | into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 29 | into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 30 | into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; 31 | # some _PRW have three entries in the Package 32 | into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 33 | into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 34 | into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 35 | into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 36 | into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; 37 | 38 | # seems to work better if _PRW is present, but returns 0 (original was 3) for sleep state 39 | # Note: These are methods because some Skylake DSDT call _PRW as a method for no reason 40 | into device name_adr 0x00140000 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; 41 | into device name_adr 0x00140001 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; 42 | into device name_adr 0x001F0003 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; 43 | into device name_adr 0x00190000 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; 44 | into device name_adr 0x001F0006 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; 45 | 46 | # Insert Apple USB properties into USB 3.0 XHC 47 | into method label _DSM parent_adr 0x00140000 remove_entry; 48 | into device name_adr 0x00140000 insert 49 | begin 50 | Method (_DSM, 4, NotSerialized)\n 51 | {\n 52 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 53 | Return (Package()\n 54 | {\n 55 | "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n 56 | "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n 57 | "AAPL,current-available", 2100,\n 58 | "AAPL,current-extra", 2200,\n 59 | "AAPL,current-extra-in-sleep", 1600,\n 60 | "AAPL,device-internal", 0x02,\n 61 | "AAPL,max-port-current-in-sleep", 2100,\n 62 | })\n 63 | }\n 64 | end; 65 | 66 | -------------------------------------------------------------------------------- /wifi/wifi_AR9285-RP02-PXSX.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #wifi_AR9285-RP02-PXSX.txt 3 | 4 | # Airport fix works with vanilla IO80211 kext 5 | into method label _DSM parent_label PXSX remove_entry; 6 | into device label PXSX parent_label RP02 insert 7 | begin 8 | Method (_DSM, 4, NotSerialized)\n 9 | {\n 10 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 11 | Return (Package()\n 12 | {\n 13 | "device-id", Buffer() { 0x30, 0x00, 0x00, 0x00 },\n 14 | "name", "pci168c,30",\n 15 | "AAPL,slot-name", Buffer() { "AirPort" },\n 16 | "device_type", Buffer() { "AirPort" },\n 17 | "model", Buffer() { "Atheros 9285 802.11 b/g/n Wireless Network Adapter" },\n 18 | "subsystem-id", Buffer() { 0x8F, 0x00, 0x00, 0x00 },\n 19 | "subsystem-vendor-id", Buffer() { 0x6B, 0x10, 0x00, 0x00 },\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | -------------------------------------------------------------------------------- /wifi/wifi_AR9285-RP02-WLAN.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #wifi_AR9285-RP02-WLAN.txt 3 | 4 | # Airport fix works with vanilla IO80211 kext 5 | into method label _DSM parent_label WLAN remove_entry; 6 | into device label WLAN parent_label RP02 insert 7 | begin 8 | Method (_DSM, 4, NotSerialized)\n 9 | {\n 10 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 11 | Return (Package()\n 12 | {\n 13 | "device-id", Buffer() { 0x30, 0x00, 0x00, 0x00 },\n 14 | "name", "pci168c,30",\n 15 | "AAPL,slot-name", Buffer() { "AirPort" },\n 16 | "device_type", Buffer() { "AirPort" },\n 17 | "model", Buffer() { "Atheros 9285 802.11 b/g/n Wireless Network Adapter" },\n 18 | "subsystem-id", Buffer() { 0x8F, 0x00, 0x00, 0x00 },\n 19 | "subsystem-vendor-id", Buffer() { 0x6B, 0x10, 0x00, 0x00 },\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | -------------------------------------------------------------------------------- /wifi/wifi_AR9285-RP02-WNIC.txt: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #wifi_AR9285-RP02-WNIC.txt 3 | 4 | # Airport fix works with vanilla IO80211 kext 5 | into method label _DSM parent_label WNIC remove_entry; 6 | into device label WNIC parent_label RP02 insert 7 | begin 8 | Method (_DSM, 4, NotSerialized)\n 9 | {\n 10 | If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n 11 | Return (Package()\n 12 | {\n 13 | "device-id", Buffer() { 0x30, 0x00, 0x00, 0x00 },\n 14 | "name", "pci168c,30",\n 15 | "AAPL,slot-name", Buffer() { "AirPort" },\n 16 | "device_type", Buffer() { "AirPort" },\n 17 | "model", Buffer() { "Atheros 9285 802.11 b/g/n Wireless Network Adapter" },\n 18 | "subsystem-id", Buffer() { 0x8F, 0x00, 0x00, 0x00 },\n 19 | "subsystem-vendor-id", Buffer() { 0x6B, 0x10, 0x00, 0x00 },\n 20 | })\n 21 | }\n 22 | end; 23 | 24 | 25 | 26 | --------------------------------------------------------------------------------