Skip to content

Instantly share code, notes, and snippets.

@vangog
Created January 3, 2018 12:56
Show Gist options
  • Select an option

  • Save vangog/6a90b2a363462cf1320ca5989e68a161 to your computer and use it in GitHub Desktop.

Select an option

Save vangog/6a90b2a363462cf1320ca5989e68a161 to your computer and use it in GitHub Desktop.
#Maintained by: RehabMan for: Laptop Patches
#battery_Samsung_NP300E5A-S01ARU.txt
# created by socolovivan - 2018-01-03
# Works for:
# Samsung NP300E5A-S01ARU
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n
end;
# 16-bit EC registers to 8-bit
into device label H_EC code_regex B1RP,\s+16 replace_matched begin BRP0,8,BRP1,8 end;
into device label H_EC code_regex B1RA,\s+16 replace_matched begin BRA0,8,BRA1,8 end;
into device label H_EC code_regex B1PR,\s+16 replace_matched begin BPR0,8,BPR1,8 end;
into device label H_EC code_regex B1VO,\s+16 replace_matched begin BVO0,8,BVO1,8 end;
into device label H_EC code_regex B1DA,\s+16 replace_matched begin BDA0,8,BDA1,8 end;
into device label H_EC code_regex B1DF,\s+16 replace_matched begin BDF0,8,BDF1,8 end;
into device label H_EC code_regex B1DV,\s+16 replace_matched begin BDV0,8,BDV1,8 end;
into device label H_EC code_regex B1DL,\s+16 replace_matched begin BDL0,8,BDL1,8 end;
into device label H_EC code_regex B1TI,\s+16 replace_matched begin BTI0,8,BTI1,8 end;
into device label H_EC code_regex B1SE,\s+16 replace_matched begin BSE0,8,BSE1,8 end;
into device label H_EC code_regex B1CR,\s+16 replace_matched begin BCR0,8,BCR1,8 end;
into device label H_EC code_regex B1TM,\s+16 replace_matched begin BTM0,8,BTM1,8 end;
# End 16-bit EC registers to 8-bit
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;
# 256-bit EC registers
into device label H_EC code_regex SBFR,\s+256 replace_matched
begin
//SBFR, 256,\n
FR00,8,FR01,8,FR02,8,FR03,8,\n
FR04,8,FR05,8,FR06,8,FR07,8,\n
FR08,8,FR09,8,FR0A,8,FR0B,8,\n
FR0C,8,FR0D,8,FR0E,8,FR0F,8,\n
FR10,8,FR11,8,FR12,8,FR13,8,\n
FR14,8,FR15,8,FR16,8,FR17,8,\n
FR18,8,FR19,8,FR1A,8,FR1B,8,\n
FR1C,8,FR1D,8,FR1E,8,FR1F,8\n
end;
# End 256-bit EC registers
into method label _BIF code_regex Store\s\(B1DA,\s(.*)\) replace_matched
begin
Store(B1B2(BDA0, BDA1), %1)
end;
into method label _BIF code_regex Store\s\(B1DF,\s(.*)\) replace_matched
begin
Store(B1B2(BDF0, BDF1), %1)
end;
into method label _BIF code_regex Store\s\(B1DV,\s(.*)\) replace_matched
begin
Store(B1B2(BDV0, BDV1), %1)
end;
into method label _BIF code_regex Store\s\(B1DL,\s(.*)\) replace_matched
begin
Store(B1B2(BDL0, BDL1), %1)
end;
into method label _BST code_regex Store\s\(B1RA,\s(.*)\) replace_matched
begin
Store(B1B2(BRA0, BRA1), %1)
end;
into method label _BST code_regex Store\s\(B1PR,\s(.*)\) replace_matched
begin
Store(B1B2(BPR0, BPR1), %1)
end;
into method label _BST code_regex Store\s\(B1VO,\s(.*)\) replace_matched
begin
Store(B1B2(BVO0, BVO1), %1)
end;
into method label _PTS code_regex Store\s\(\\\_SB\.PCI0\.LPCB\.H_EC\.B1DF,\s(.*)\) replace_matched
begin
Store(B1B2(\\_SB.PCI0.LPCB.H_EC.BVO0, \\_SB.PCI0.LPCB.H_EC.BVO1), %1)
end;
into method label _WAK code_regex LNotEqual\s\(\\\_SB\.PCI0\.LPCB\.H_EC\.B1DF,\s(.*)\) replace_matched
begin
LNotEqual(B1B2(\\_SB.PCI0.LPCB.H_EC.BVO0, \\_SB.PCI0.LPCB.H_EC.BVO1), %1)
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment