Skip to content

Commit

Permalink
Lenovo E430 patch; other minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RehabMan committed Feb 26, 2015
1 parent bd0d84a commit f5161a6
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .maciasl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[syn] Fix FPED Parse Error syntax/fix_FPED.txt
[syn] Fix _IRC Error syntax/fix_IRC.txt
[syn] Fix ADBG Error syntax/fix_ADBG.txt
[syn] Fix PARSEOP_STORE/MMTB Error syntax/fix_MMTB.txt
[syn] Fix PARSEOP_STORE/MMTB/HRPR Error syntax/fix_MMTB.txt
[syn] Fix *pnp/pnp lower case Error syntax/fix_HID_pnp.txt
[syn] Fix PARSEOP_ZERO Error syntax/fix_PARSEOP_ZERO.txt
[syn] Remove _DSM methods syntax/remove_DSM.txt
Expand Down Expand Up @@ -70,6 +70,7 @@
[bat] HP ProBook 4x0s G1 battery/battery_HP-ProBook-4x0s-G1.txt
[bat] HP ProBook Generic battery/battery_HP-ProBook-Generic.txt
[bat] HP Spectre XT battery/battery_HP-Spectre-XT.txt
[bat] Lenovo E430 battery/battery_Lenovo-E430.txt
[bat] Lenovo G50-70 battery/battery_Lenovo-G50-70.txt
[bat] Lenovo IdeaPad Yoga 13 battery/battery_Lenovo-Yoga-13.txt
[bat] Lenovo T430u battery/battery_Lenovo-T430u.txt
Expand Down
6 changes: 5 additions & 1 deletion Patches.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
84F8BB9D1806D4A800BD0774 /* audio_HDEF-layout12.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "audio_HDEF-layout12.txt"; path = "audio/audio_HDEF-layout12.txt"; sourceTree = "<group>"; };
84FEF29C196D8B7D0061DF5A /* fix_PARSEOP_ZERO.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fix_PARSEOP_ZERO.txt; path = syntax/fix_PARSEOP_ZERO.txt; sourceTree = "<group>"; };
ED0EC5E41A01E9880021AD90 /* graphics_HD4600_yosemite.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = graphics_HD4600_yosemite.txt; path = graphics/graphics_HD4600_yosemite.txt; sourceTree = "<group>"; };
ED1646481A94E21C00D2D49B /* battery_Lenovo-E430.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Lenovo-E430.txt"; path = "battery/battery_Lenovo-E430.txt"; sourceTree = "<group>"; };
ED1F747B1A4C772200FFE7AE /* battery_Lenovo-z470-z370.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Lenovo-z470-z370.txt"; path = "battery/battery_Lenovo-z470-z370.txt"; sourceTree = "<group>"; };
ED1F8F471A1399D1005F6F5B /* battery_Lenovo-Yoga-13.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Lenovo-Yoga-13.txt"; path = "battery/battery_Lenovo-Yoga-13.txt"; sourceTree = "<group>"; };
ED5A9CD01A2A43710024EC94 /* battery_Medion-Akoya-P6630.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Medion-Akoya-P6630.txt"; path = "battery/battery_Medion-Akoya-P6630.txt"; sourceTree = "<group>"; };
Expand All @@ -130,6 +131,7 @@
EDCCC2CB1A70148300C7301E /* battery_Lenovo-G50-70.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Lenovo-G50-70.txt"; path = "battery/battery_Lenovo-G50-70.txt"; sourceTree = "<group>"; };
EDCD54641A2E10550009F438 /* graphics_REG-disable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_REG-disable.txt"; path = "graphics/graphics_REG-disable.txt"; sourceTree = "<group>"; };
EDCD54651A2E11EA0009F438 /* graphics_INI-disable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_INI-disable.txt"; path = "graphics/graphics_INI-disable.txt"; sourceTree = "<group>"; };
EDDD15E51A72C7C80093ACE1 /* graphics_nvidia_gt520m.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = graphics_nvidia_gt520m.txt; sourceTree = "<group>"; };
EDF0829E1A0BC52C00DD15A5 /* battery_Clevo-M860TU.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Clevo-M860TU.txt"; path = "battery/battery_Clevo-M860TU.txt"; sourceTree = "<group>"; };
EDFBE3951A3767DF00F61E48 /* graphics_SSDT-disable-cleanup.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_SSDT-disable-cleanup.txt"; path = "graphics/graphics_SSDT-disable-cleanup.txt"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -214,6 +216,7 @@
children = (
8420BAD519BDFF7C00D629B3 /* graphics_nvidia_laptop.txt */,
EDB280191A3A21BD002C47E1 /* graphics_nvidia_laptop2.txt */,
EDDD15E51A72C7C80093ACE1 /* graphics_nvidia_gt520m.txt */,
);
name = "Nvidia Graphics";
sourceTree = "<group>";
Expand Down Expand Up @@ -255,6 +258,8 @@
845AA66318871888007B305B /* battery_HP-ProBook-4x0s-G1.txt */,
84CD226F18246E1B0076EF62 /* battery_HP-ProBook-Generic.txt */,
8499201B18060CDF00F1FC19 /* battery_HP-Spectre-XT.txt */,
ED1646481A94E21C00D2D49B /* battery_Lenovo-E430.txt */,
EDCCC2CB1A70148300C7301E /* battery_Lenovo-G50-70.txt */,
84A21711195204BE004751F3 /* battery_Lenovo-T430u.txt */,
842AF6E419CB3D2F00309DAD /* battery_Lenovo-T440p.txt */,
841F8DE817FB541900C36F76 /* battery_Lenovo-Twist.txt */,
Expand All @@ -278,7 +283,6 @@
843936A218ABC24200E32386 /* battery_TabletKiosk-i575.txt */,
84ACC1B118BAD88B001B61D8 /* battery_Toshiba-A660-16Z.txt */,
84C4E6821954F237009476EB /* battery_Vizio-Ultrabook-CT14.txt */,
EDCCC2CB1A70148300C7301E /* battery_Lenovo-G50-70.txt */,
);
name = "Battery Status";
sourceTree = "<group>";
Expand Down
92 changes: 92 additions & 0 deletions battery/battery_Lenovo-E430.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#Maintained by: RehabMan for: Laptop Patches
#battery_Lenovo-E430.txt

# created by nxho93 2015-02-18

# works for:
# Lenovo E430

# Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
Store(Arg3, Local0)\n
Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
Return(Local0)\n
}\n
end;

into method label RE1B parent_label EC0 remove_entry;
into method label RECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\n
// Arg0 - offset in bytes from zero-based EC\n
{\n
OperationRegion(ECOR, EmbeddedControl, Arg0, 1)\n
Field(ECOR, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Add(Arg0, Arg1, Arg1)\n
Store(0, Local0)\n
While (LLess(Arg0, Arg1))\n
{\n
Store(RE1B(Arg0), Index(TEMP, Local0))\n
Increment(Arg0)\n
Increment(Local0)\n
}\n
Return(TEMP)\n
}\n
end;

into device label EC0 code_regex HWAK,\s+16, replace_matched begin AK00,8,AK01,8, end;
into device label EC0 code_regex SBRC,\s+16, replace_matched begin RC00,8,RC01,8, end;
into device label EC0 code_regex SBFC,\s+16, replace_matched begin FC00,8,FC01,8, end;
into device label EC0 code_regex SBAC,\s+16, replace_matched begin AC00,8,AC01,8, end;
into device label EC0 code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end;
into device label EC0 code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label EC0 code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label EC0 code_regex SBSN,\s+16 replace_matched begin SN00,8,SN01,8 end;
into device label EC0 code_regex SBCH,\s+32 replace_matched begin CH00,8,CH01,8,CH02,8,CH03,8 end;
into device label EC0 code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end;
into device label EC0 code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end;

into method label _L23 code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.AK00,\\_SB.PCI0.LPCB.EC0.AK01), end;
into method label _WAK code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.AK00,\\_SB.PCI0.LPCB.EC0.AK01), end;

# storing into AK00,AK01 (orig HWAK) 8-bit registers
into method label _WAK code_regex Store\s\(Local0,\s\\_SB\.PCI0\.LPCB\.EC0\.HWAK\) replaceall_matched
begin
Store(Local0,\\_SB.PCI0.LPCB.EC0.AK00)\n
Store(ShiftRight(Local0,8),\\_SB.PCI0.LPCB.EC0.AK01)
end;

into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(RC00,RC01), end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(FC00,FC01), end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(AC00,AC01), end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BV00,BV01), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(DC00,DC01), end;
into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(DV00,DV01)) end;
into method label GBIF code_regex SBDV, replaceall_matched begin B1B2(DV00,DV01), end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(SN00,SN01), end;
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(CH00,CH01,CH02,CH03), end;
into method label GBIF code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIF code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;

2 changes: 1 addition & 1 deletion battery/battery_Lenovo-T440p.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BF00,BF
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BA00,BA01), end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BV00,BV01), end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BB00,BB01), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BD00,BR01), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BD00,BD01), end;
into method label GBIT code_regex \(SBDV, replaceall_matched begin (B1B2(SB00,SB01), end;
into method label GBIT code_regex \(SBSN, replaceall_matched begin (B1B2(BS00,BS01), end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BS00,BS01), end;
Expand Down
3 changes: 3 additions & 0 deletions graphics/graphics_PNLF_ivy_sandy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ Device (PNLF)\n
}\n
Method (_DOS, 1, NotSerialized)\n
{\n
// Note: Some systems have this defined in DSDT, so uncomment\n
// the next line if that is the case.\n
//External(^^_DOS, MethodObj)\n
^^_DOS(Arg0)\n
}\n
// extended _BCM/_BQC for setting "in between" levels\n
Expand Down
5 changes: 5 additions & 0 deletions syntax/fix_MMTB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
#into method label _WAK code_regex (Store\s\(\\_GPE\.MMTB.*) replace_matched begin // %1 end;

into_all method code_regex (Store\s\(\\_GPE\.MMTB.*) replaceall_matched begin // %1 end;

# Also to fix HRPR which can reference MMTB in an OperationRegion definition

into method label HRPR remove_entry;

0 comments on commit f5161a6

Please sign in to comment.