Contribute
Register

[Guide] How to patch DSDT for working battery status

@RehabMan
I've scoured the internet and tried several of your patches to get my Lenovo w540's laptop battery to be recognized...Unsuccessfully. You have a patch for the Lenovo T440P (Uses the same battery as the W540) in your repo, but I was never able to get the patch to compile successfully. Always 8 errors (6 syntax and 2 others). Tried other patches, but more errors.

Can you help me, please?
TIA
 

Attachments

  • Patchmtc_Extract.zip
    2.3 KB · Views: 68
  • tstc’s MBP11,2.zip
    395.1 KB · Views: 72
  • TerminalOutput1.zip
    1.2 KB · Views: 77
  • TerminalOutput2.zip
    1.2 KB · Views: 69
  • CLOVER.zip
    1.5 MB · Views: 99
@RehabMan
I've scoured the internet and tried several of your patches to get my Lenovo w540's laptop battery to be recognized...Unsuccessfully. You have a patch for the Lenovo T440P (Uses the same battery as the W540) in your repo, but I was never able to get the patch to compile successfully. Always 8 errors (6 syntax and 2 others). Tried other patches, but more errors.

Can you help me, please?
TIA

Try the "Lenovo W550s" with this additional patch:
Code:
# added for Lenovo w540

into method label _L1D code_regex \_SB.PCI0.LPC.EC.HWAC, replaceall_matched begin B1B2(\\_SB.PCI0.LPC.EC.WAC0,\\_SB.PCI0.LPC.EC.WAC1), end;

It creates a file that compiles without error and appears to patch everything required.
 
see this
 

Attachments

  • Screen Shot 2017-08-31 at 1.03.52 PM.png
    Screen Shot 2017-08-31 at 1.03.52 PM.png
    35.7 KB · Views: 83
@RehabMan ,
just went through the disassembly process carefully, no errors, exactly as explained. ...same thing. Me thinks the issue is the way that I'm trying to add the additional patch to the 550s's. Do you mind humoring me and just explain how. Sorry, this is something that I don't know a lot about. :)
 
@RehabMan ,
just went through the disassembly process carefully, no errors, exactly as explained. ...same thing. Me thinks the issue is the way that I'm trying to add the additional patch to the 550s's. Do you mind humoring me and just explain how. Sorry, this is something that I don't know a lot about. :)

You should attach the file you're trying to compile.

Keep in mind a correctly disassembled file will have no errors prior to applying any patch.
 

I opened the DSDT.aml in MaciASL.
Clicked "Compile" to check if there were any errors to begin with. It compiles with no errors.
Clicked patch, selected "Lenovo 550s" battery patch, clicked Apply.
Then pasted the additional patch provided earlier into the Patch window, clicked Apply.
Clicked Close.
Clicked Compile.
Result: it compiles without errors.
 
Back
Top