Contribute
Register

[Guide] How to patch DSDT for working battery status

Hello,

I'm having a problem where patching my system DSDT with Rehabman's laptop DSDT battery patch: battery_lenovo_E440.txt.

The patch is said to support Lenovo E531 laptops. However, patching and compiling my DSDT using this battery patch results in 8 of the same errors:

"Object does not exist (\_SB.PCI0.LPCB.EC0.HWAK)".

I'm stuck and I can't figure out why this is happening. (Unfortunately, I'm not a programmer). I would really appreciate some help with getting my battery to work. I've uploaded a copy of my system DSDT and Rehabman's battery patch is found here:


Thank you in advance!
 
Last edited:
Hello,

I'm having a problem where patching my system DSDT with Rehabman's laptop DSDT battery patch: battery_lenovo_E440.txt.

The patch is said to support Lenovo E531 laptops. However, patching and compiling my DSDT using this battery patch results in 8 of the same errors:

"Object does not exist (\_SB.PCI0.LPCB.EC0.HWAK)".

I'm stuck and I can't figure out why this is happening. (Unfortunately, I'm not a programmer). I would really appreciate some help with getting my battery to work. I've uploaded a copy of my system DSDT and Rehabman's battery patch is found here:


Thank you in advance!
Fixed myself. Patching with Rehabman's version MaciASL does the job. Weirdly Opencore suggest against this.
 
Finally got my Lenovo-P53 installed so just doing some post install stuff. Having a time with finding info on patching my batter indicator. Not sure what battery_txtfile would even come close to being compatible. Any ideas?

Joe W
 
I'm running into a problem with the B1B2 method patch.

When I do this patch:
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
The method goes into Scope (\_SB.PCI0.LPCB). This means that when I try to go forward with patching 16-bit HWAC, I cant use B1B2 where HWAC is referenced outside of this scope (the problem areas are in scope _GPE and method OWAK).

I tried to add B1B2 to these places too with
into scope label code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
and
into method label OWAK code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
but it produced a compile error Illegal Forward Reference for the method OWAK patch (is there maybe a way to prepend patches?).

I figured out a workaround by manually editing the file and just pasting the B1B2 method at the end of the file (I saw this is where it was on successfully patched DSDTs). But would appreciate any insight into why the patching isn't working for me as expected.

Thanks!
 

Attachments

  • DSDT.aml
    124.7 KB · Views: 81
  • DSDTpatching.aml
    124.7 KB · Views: 73
Last edited:
Say when I have something like:

Code:
Scope (_SB.PCI0.LPCB)
{
    Device (EC0)
    {
        Field (SMBX, ByteAcc, NoLock, Preserve)
        {
            Offset (0x04), 
            DAT0,   8, 
            DAT1,   8
         }
    }
}

Scope (_SB.PCI0.LPCB.EC0)
{
   	Method (ECSB, 7, NotSerialized)
    {
		Local1 [One] = DAT0 /* \_SB_.PCI0.LPCB.EC0_.DAT0 */
        Local1 [0x02] = DAT1 /* \_SB_.PCI0.LPCB.EC0_.DAT1 */
	}
}

then how to I access that friggin DAT0 or DAT1 field?

Is it

Code:
External (_SB.PCI0.LPCB.EC0.DAT0)

or

External (_SB.PCI0.LPCB.EC0.SMBX.DAT0)

That cant be right? Where is the SMBX?
 
Finally got my Lenovo-P53 installed so just doing some post install stuff. Having a time with finding info on patching my batter indicator. Not sure what battery_txtfile would even come close to being compatible. Any ideas?

Joe W
Did you ever find a good one to use for it? I'm just got my hackintosh setup on my P53 and most things are working except the battery now, I tried using the Lenovo X230i one as it mentions support for the P50 and P51 at the top of the file, but I had no luck as this sort of patching seems out of my skill range.
 
Hello all, need some help with my hackintosh battery. I have pretty much everything working on Big Sur except the battery which I am getting the notification for but it is not accurate nor do I get a symbol for charging either. I have put all my files on github including my DSDT dump. Any help would be great because I cannot use the laptop much without the power cable.

 
Hey Guys,

I have an HP EliteBook x360 1030 G2.

I've managed to get Catalina 10.15 installed with pretty much everything working (GFX, Audio, Mic, Webcam, Intel WiFi, USB ports).

All I am missing is the DSDT for Battery and RTC Bios error (which I will tackle last; given it looks fairly simple).

What I need some help on is the DSDT Patching for the Battery.

I used the HP x360 patch and also tried the Folio 13 patch but both of them keep showing the same sets of errors when compiling:


21359, 6126, syntax error, unexpected PARSEOP_IF, expecting PARSEOP_CLOSE_PAREN or ','
21362, 6126, syntax error, unexpected ','
21362, 6126, syntax error, unexpected PARSEOP_CLOSE_PAREN
21453, 6126, syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File


It seems like its just syntax errors but when trying to fix them, it just ends up creating a mess.

I have attached my DSDT.dsl for reference if someone feels like they want to help a brother out :)

Thanks in advanced!
 

Attachments

  • DSDT.dsl
    993.9 KB · Views: 78
Last edited:
stEEEzy did you ever get help or figured out the battery indicator issue on your laptop?

I have a HP EliteBook x360 1030 G3 and I have the same issue and I don’t think there is a DSDT patch for our models. At least the HP x360 patch I tried on my DSDT.dsl which I think I patched correctly did not fix the issue
 
Back
Top