Contribute
Register

[Guide] How to patch DSDT for working battery status

I updated the BIOS in my Hack and have a new entry in the DSDT that I cannot figure out how to patch. I have attached the problem reporting files, along with the patch I am using and a screenshot of the compile error. Thanks for any help.

It is 16-bit. Break into two separate 8-bit identifiers and use B1B2, as per post #1.
 
It is 16-bit. Break into two separate 8-bit identifiers and use B1B2, as per post #1.

Ok, does this look correct for the patch? I am away from my hack right now, so I can’t test it yet.

into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\_SB.PCI0.LPCB.EC0.PR00,\_SB.PCI0.LPCB.EC0.PR01), end;
 
Ok, does this look correct for the patch? I am away from my hack right now, so I can’t test it yet.

into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\_SB.PCI0.LPCB.EC0.PR00,\_SB.PCI0.LPCB.EC0.PR01), end;

Your responsibility to test.
 
Your responsibility to test.

Got it. Had to add one more \ to the replacement code, but all working again. I have attached the updated patch file. Thanks
 

Attachments

  • battery_HP-Elite-X2-v2.txt
    5.5 KB · Views: 129
Got it. Had to add one more \ to the replacement code, but all working again. I have attached the updated patch file. Thanks

This diff?
Code:
diff --git a/battery/battery_HP-Elite-X2.txt b/battery/battery_HP-Elite-X2.txt
index 01e111c..1db5f89 100644
--- a/battery/battery_HP-Elite-X2.txt
+++ b/battery/battery_HP-Elite-X2.txt
@@ -63,6 +63,10 @@ into method label BTIF code_regex BDAT replaceall_matched begin B1B2(AT00,AT01)
 into method label GBTI code_regex BDAT replaceall_matched begin B1B2(AT00,AT01) end;
 into method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2(AT00,AT01), end;

+# new code for BPR in method GCGC as of BIOS 1.24
+# original code Store (\_SB.PCI0.LPCB.EC0.BPR, LTMP)
+into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.PR00,\\_SB.PCI0.LPCB.EC0.PR01), end;
+
 into_all method label SBTC code_regex Store\s+\(Zero,\s+MAXC\) replaceall_matched begin Store(Zero, XC00) Store(Zero, XC01) end;
 into_all method label SBTC code_regex Store\s+\(0xFA,\s+MAXC\) replaceall_matched begin Store(0xFA, XC00) Store(Zero, XC01) end;
 
This diff?
Code:
diff --git a/battery/battery_HP-Elite-X2.txt b/battery/battery_HP-Elite-X2.txt
index 01e111c..1db5f89 100644
--- a/battery/battery_HP-Elite-X2.txt
+++ b/battery/battery_HP-Elite-X2.txt
@@ -63,6 +63,10 @@ into method label BTIF code_regex BDAT replaceall_matched begin B1B2(AT00,AT01)
 into method label GBTI code_regex BDAT replaceall_matched begin B1B2(AT00,AT01) end;
 into method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2(AT00,AT01), end;

+# new code for BPR in method GCGC as of BIOS 1.24
+# original code Store (\_SB.PCI0.LPCB.EC0.BPR, LTMP)
+into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.PR00,\\_SB.PCI0.LPCB.EC0.PR01), end;
+
 into_all method label SBTC code_regex Store\s+\(Zero,\s+MAXC\) replaceall_matched begin Store(Zero, XC00) Store(Zero, XC01) end;
 into_all method label SBTC code_regex Store\s+\(0xFA,\s+MAXC\) replaceall_matched begin Store(0xFA, XC00) Store(Zero, XC01) end;

Looks about right to me.
 
All kexts you need must be installed to the system volume. That includes FakeSMC.kext.
And config.plist/SystemParameters/InjectKexts=Detect.

After you fix that, attach new problem reporting files.
ok. I moved all kext from clover to /L/E.
new problem reporting files attached
 

Attachments

  • RehabMan.zip
    2.2 MB · Views: 65
I'm also having the same issue.
DSDT with the appropriate patch that my Laptop needs, ACPIBattery Kext into /L/E (Rebuilt kextcache using 10.13.X method).
But it seems like I can only see the Battery Icon whenever I disconnect my computer from EC Power and connect it again.
 
Back
Top