#Maintained by: RehabMan for: Laptop Patches #battery_HP-DV7-7xxx-.txt # created by RehabMan 2013-10-16 # created originally for pain1993 # enhancements for 128-bit fields by SilleBille 2014-12-11 # works for: # HP dv7-7302eg # HP dv6-7040tx 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 definitionblock code_regex External\s+\(\\TNOT\) remove_matched; # I thought to remvoe the WMI section, but decided against it... #into_all scope label _SB.WMID remove_entry; #into method label _Q29 remove_entry; #into method label _Q10 remove_entry; #into method label _Q40 remove_entry; #into method label _Q41 remove_entry; #into method label HDWN remove_entry; # battery EC # 16-bit group1 into scope label _SB.PCI0.LPCB.EC0 code_regex BSRC,\s+16 replace_matched begin BRC0,8,BRC1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSFC,\s+16 replace_matched begin BFC0,8,BFC1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSPE,\s+16 replace_matched begin BPE0,8,BPE1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSAC,\s+16 replace_matched begin BAC0,8,BAC1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSVO,\s+16 replace_matched begin BVO0,8,BVO1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSCU,\s+16 replace_matched begin BCU0,8,BCU1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSTV,\s+16 replace_matched begin BTV0,8,BTV1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSDC,\s+16 replace_matched begin BDC0,8,BDC1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSDV,\s+16 replace_matched begin BDV0,8,BDV1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSMA,\s+16 replace_matched begin BMA0,8,BMA1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSBS,\s+16 replace_matched begin BBS0,8,BBS1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSCY,\s+16 replace_matched begin BCY0,8,BCY1,8 end; # 16-bit group2 into scope label _SB.PCI0.LPCB.EC0 code_regex BSCV,\s+16 replace_matched begin BCV0,8,BCV1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSMD,\s+16 replace_matched begin BMD0,8,BMD1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSCC,\s+16 replace_matched begin BCC0,8,BCC1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSME,\s+16 replace_matched begin BME0,8,BME1,8 end; # 16-bit group3 into scope label _SB.PCI0.LPCB.EC0 code_regex BSRE,\s+16 replace_matched begin BRE0,8,BRE1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSAF,\s+16 replace_matched begin BAF0,8,BAF1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSAE,\s+16 replace_matched begin BAE0,8,BAE1,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSC1,\s+16 replace_matched begin BC10,8,BC11,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSC2,\s+16 replace_matched begin BC20,8,BC21,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSC3,\s+16 replace_matched begin BC30,8,BC31,8 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSC4,\s+16 replace_matched begin BC40,8,BC41,8 end; # 128-bit into scope label _SB.PCI0.LPCB.EC0 code_regex BSMN,\s+128 replace_matched begin BMN_,128 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSDN,\s+128 replace_matched begin BDN_,128 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSCH,\s+128 replace_matched begin BCH_,128 end; into scope label _SB.PCI0.LPCB.EC0 code_regex BSCN,\s+128 replace_matched begin BCN_,128 end; # GBIF 16-bit into method label GBIF code_regex \(BSFC, replaceall_matched begin (B1B2(BFC0,BFC1), end; into method label GBIF code_regex \(BSDV, replaceall_matched begin (B1B2(BDV0,BDV1), end; into method label GBIF code_regex \(BSSN, replaceall_matched begin (B1B2(BSN0,BSN1), end; # GBIF 128-bit (just remove) into method label GBIF code_regex Store\s+\(BSDN.* remove_matched; into method label GBIF code_regex Store\s+\(BSCH.* remove_matched; into method label GBIF code_regex Store\s+\(BSMN.* remove_matched; # GBST 16-bit into method label GBST code_regex \(BSAC, replaceall_matched begin (B1B2(BAC0,BAC1), end; into method label GBST code_regex \(BSRC, replaceall_matched begin (B1B2(BRC0,BRC1), end; into method label GBST code_regex \(BSFC, replaceall_matched begin (B1B2(BFC0,BFC1), end; into method label GBST code_regex \(BSVO, replaceall_matched begin (B1B2(BVO0,BVO1), end; # GBAT (probably not called by OS X, but…) 16-bit into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BDC0,^^PCI0.LPCB.EC0.BDC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCY, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BCY0,^^PCI0.LPCB.EC0.BCY1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BDV0,^^PCI0.LPCB.EC0.BDV1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSBS, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BBS0,^^PCI0.LPCB.EC0.BBS1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BDC0,^^PCI0.LPCB.EC0.BDC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSSN, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BSN0,^^PCI0.LPCB.EC0.BSN1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSMA, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BMA0,^^PCI0.LPCB.EC0.BMA1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BDC0,^^PCI0.LPCB.EC0.BDC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSFC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BFC0,^^PCI0.LPCB.EC0.BFC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSRC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BRC0,^^PCI0.LPCB.EC0.BRC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSTV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BTV0,^^PCI0.LPCB.EC0.BTV1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSVO, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BVO0,^^PCI0.LPCB.EC0.BVO1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BDC0,^^PCI0.LPCB.EC0.BDC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCU, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BCU0,^^PCI0.LPCB.EC0.BCU1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSAC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BAC0,^^PCI0.LPCB.EC0.BAC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSME, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BME0,^^PCI0.LPCB.EC0.BME1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSMD, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BMD0,^^PCI0.LPCB.EC0.BMD1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BCC0,^^PCI0.LPCB.EC0.BCC1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BCV0,^^PCI0.LPCB.EC0.BCV1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSRE, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BRE0,^^PCI0.LPCB.EC0.BRE1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSAF, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BAF0,^^PCI0.LPCB.EC0.BAF1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSAE, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BAE0,^^PCI0.LPCB.EC0.BAE1), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSC1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BC10,^^PCI0.LPCB.EC0.BC11), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSC2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BC20,^^PCI0.LPCB.EC0.BC21), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSC3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BC30,^^PCI0.LPCB.EC0.BC31), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSC4, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.BC40,^^PCI0.LPCB.EC0.BC41), end; #For 128-Bit fields into scope label _SB.PCI0.LPCB.EC0 code_regex (BSMN,)\s+(128) replace_matched begin SMNX,%2,//%1%2 end; into scope label _SB.PCI0.LPCB.EC0 code_regex (BSDN,)\s+(128) replace_matched begin SDNX,%2,//%1%2 end; into scope label _SB.PCI0.LPCB.EC0 code_regex (BSCH,)\s+(128) replace_matched begin SCHX,%2,//%1%2 end; into scope label _SB.PCI0.LPCB.EC0 code_regex (BSCN,)\s+(128) replace_matched begin SCNX,%2,//%1%2 end; # utility methods to read/write buffers from/to EC into method label RE1B parent_label _SB.PCI0.LPCB.EC0 remove_entry; into method label RECB parent_label _SB.PCI0.LPCB.EC0 remove_entry; into scope label _SB.PCI0.LPCB.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 // 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; #Replacing used 128-bits into method label GBIF code_regex \(BSMN, replaceall_matched begin (RECB(0xE0,128), end; into method label GBIF code_regex \(BSDN, replaceall_matched begin (RECB(0xE0,128), end; into method label GBIF code_regex \(BSCH, replaceall_matched begin (RECB(0xE0,128), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSMN, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE0,128), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSDN, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE0,128), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCH, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE0,128), end; into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC0\.BSCN, replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE0,128), end;