#Maintained by: RehabMan for: Laptop Patches #battery_Vizio-Ultrabook-CT14.txt # created by ChrisKader with help/fixes RehabMan 2014-06-20 # works for: # Visio Ultrabook CT14 #B1B2 Utility 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 device label EC0 code_regex MBCT,\s+16, replace_matched begin MBC0,8,MBC1,8, end; into device label EC0 code_regex RCAP,\s+16, replace_matched begin RCA0,8,RCA1,8, end; into device label EC0 code_regex MBVT,\s+16, replace_matched begin MBV0,8,MBV1,8, end; into device label EC0 code_regex DBAT,\s+16, replace_matched begin DBA0,8,DBA1,8, end; into device label EC0 code_regex MBCP,\s+16, replace_matched begin MBP0,8,MBP1,8, end; into device label EC0 code_regex MDCP,\s+16, replace_matched begin MDC0,8,MDC1,8, end; into device label EC0 code_regex BASN,\s+16, replace_matched begin BAS0,8,BAS1,8, end; into device label EC0 code_regex SMW0,\s+16 replace_matched begin SMW1,8,SMW2,8, end; into device label EC0 code_regex MBDV,\s+16, replace_matched begin MDV0,8,MDV1,8, end; into device label EC0 code_regex (SMD0,)\s+(264) replace_matched begin SMDX,%2,//%1%2 end; into device label EC0 code_regex (MBDN,)\s+(120) replace_matched begin MBDX,%2,//%1%2 end; into device label EC0 code_regex (MBMN,)\s+(88) replace_matched begin MBMX,%2,//%1%2 end; into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCT, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.MBC0,^^PCI0.LPCB.EC0.MBC1), end; into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.RCAP, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.RCA0,^^PCI0.LPCB.EC0.RCA1), end; into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBVT, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.MBV0,^^PCI0.LPCB.EC0.MBV1), end; into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.DBAT, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.DBA0,^^PCI0.LPCB.EC0.DBA1), end; into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.DBAT, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.DBA0,^^PCI0.LPCB.EC0.DBA1), end; into method label _Q20 code_regex \(DBAT, replaceall_matched begin (B1B2(DBA0, DBA1), end; into method label SELE code_regex \(DBAT, replaceall_matched begin (B1B2(DBA0, DBA1), end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCP, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.MBP0,^^PCI0.LPCB.EC0.MBP1), end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.MDCP, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.MDC0,^^PCI0.LPCB.EC0.MDC1), end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BASN, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BAS0,^^PCI0.LPCB.EC0.BAS1), end; into method label SMRD code_regex \(SMW0, replaceall_matched begin (B1B2(SMW1,SMW2), end; into method label SMWR code_regex Store\s+\((.*),\s+SMW0\) replaceall_matched begin Store(%1, SMW1) Store(ShiftRight(%1,8), SMW2) end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.MBDV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.MDV0,^^PCI0.LPCB.EC0.MDV1), end; #utility methods to read/write buffers from/to EC 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 {\n OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n Return(BYTE)\n }\n Method (RECB, 2, Serialized)\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 { Store(RE1B(Arg0), Index(TEMP, Local0))\n Increment(Arg0)\n Increment(Local0)\n }\n Return(TEMP)\n }\n end; into method label WE1B parent_label EC0 remove_entry; into method label WECB parent_label EC0 remove_entry; into device label EC0 insert begin Method (WE1B, 2, NotSerialized)\n {\n OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n Store(Arg1, BYTE)\n }\n Method (WECB, 3, Serialized)\n {\n ShiftRight(Arg1, 3, Arg1)\n Name(TEMP, Buffer(Arg1) { })\n Store(Arg2, TEMP)\n Add(Arg0, Arg1, Arg1)\n Store(0, Local0)\n While (LLess(Arg0, Arg1))\n {\n WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n Increment(Arg0)\n Increment(Local0)\n }\n }\n end; into method label SMRD code_regex \(SMD0, replaceall_matched begin (RECB(0x1c,264), end; into method label SMWR code_regex Store\s+\(Arg3,\s+SMD0\) replace_matched begin WECB(0x1c,264,Arg3) end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.MBDN, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xD0,120), end; into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.MBMN, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xF1,88), end;