Contribute
Register

[Guide] How to patch DSDT for working battery status

Hi,

Has anyone given a try on a Thinkpad E580 (i7-5550U, Intel UHD 620) ?

I am currently not yet skilled enough to fix it myself, however I was able to fix DSDT to compile it (38 Warnings though). I tried a few existing DSDT patch such as https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Lenovo-E430.txt and https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Lenovo-T440p.txt however it seems to break the DSDT and brings many errors.

I have attached the untouched Clover dump of my DSDT files in case someone wants to look into it :)

Errors in your DSDT.aml are easy/obvious to fix... simply comment the lines with "One":
Code:
    Name (SS3, One)
    //One
    Name (SS4, One)
    //One

The "Thinkpad X230i" patch is close.

But needs these additional patches:
Code:
# HWAK in OWAK added for Thinkpad E580
into method label OWAK code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.AK00,\\_SB.PCI0.LPCB.EC.AK01), end;
# HWAK in _L43 also for Thinkpad E580
into method label _L43 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.AK00,\\_SB.PCI0.LPCB.EC.AK01), end;

Please test and report results.
 
Hi,

I think I managed to get the battery patch working for Gigabyte Aero 15 V8 (i7 8750H, HM370 chipset)

@RehabMan , maybe you would want to add this to your repo?

Here are the original DSDT disassembled and txt patch file
 

Attachments

  • battery_Gigabyte-Aero15V8.txt
    3.7 KB · Views: 60
  • DSDT.dsl
    1.8 MB · Views: 165
Errors in your DSDT.aml are easy/obvious to fix... simply comment the lines with "One":
Code:
    Name (SS3, One)
    //One
    Name (SS4, One)
    //One

The "Thinkpad X230i" patch is close.

But needs these additional patches:
Code:
# HWAK in OWAK added for Thinkpad E580
into method label OWAK code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.AK00,\\_SB.PCI0.LPCB.EC.AK01), end;
# HWAK in _L43 also for Thinkpad E580
into method label _L43 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.AK00,\\_SB.PCI0.LPCB.EC.AK01), end;

Please test and report results.

Hi,

I gave up on this laptop and installed Linux yesterday night.

However I did get the battery working and I posted the patch after the post you quoted me, but before your reply.

I sadly cannot test your patch, and indeed commenting out these 2 lines was the only fix I needed.

Here is the patch I built from scratch and that worked for my Lenovo E580 in case you want to check it and add it to your repo :) I attched there the original untouched DSDT dumped by Clover in case you want to make your own tests on it.

Nevermind !! I followed the tutorial and it went flawlessly ! I had to add some extra fixes which I commented that were not spoken in this Tutorial but it went alright ! I understand that every configuration is different, which make the tutorial coverage impossible to reach 100% cases perfectly.

@RehabMan Thank you so much !

You may want to add this to your repo

Lenovo Thinkpad E580 (i7 8550U, Intel UHD 620) High Sierra 10.13.4
View attachment 333608
Code:
# OperationRegion (ECOR, EmbeddedControl, 0x00, 0x0100)

# HWAC,   16,
# HWAK,   16,
# HDEN,   32,
# HDEP,   32,

# SBRC,   16,
# SBFC,   16,
# SBAE,   16,
# SBRS,   16,
# SBAC,   16,
# SBVO,   16,
# SBAF,   16,
# SBBS,   16

# SBBM,   16,
# SBMD,   16,
# SBCC,   16

# SBDC,   16,
# SBDV,   16,
# SBOM,   16,
# SBSI,   16,
# SBDT,   16,
# SBSN,   16

# SBCH,   32

# SBMN,   128

# SBDN,   128




# B1B2 Method
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

# B1B4 Method
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;

# utility methods to read/write buffers from/to EC
into method label RE1B parent_label H_EC remove_entry;
into method label RECB parent_label H_EC remove_entry;
into device label EC 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(Add(Arg1,7), 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;

into device label EC code_regex HWAC,\s+16, replace_matched begin WAC0,8,WAC1,8, end;
into device label EC code_regex HWAK,\s+16, replace_matched begin WAK0,8,WAK1,8, end;
into device label EC code_regex HDEN,\s+32 replace_matched begin EN00,8,DEN1,8,DEN2,8,DEN3,8 end;
into device label EC code_regex HDEP,\s+32 replace_matched begin DEP0,8,DEP1,8,DEP2,8,DEP3,8 end;

into device label EC code_regex SBRC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BFC0,8,BFC1,8, end;
into device label EC code_regex SBAE,\s+16, replace_matched begin BAE0,8,BAE1,8, end;
into device label EC code_regex SBRS,\s+16, replace_matched begin BRS0,8,BRS1,8, end;
into device label EC code_regex SBAC,\s+16, replace_matched begin BAC0,8,BAC1,8, end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BVO0,8,BVO1,8, end;
into device label EC code_regex SBAF,\s+16, replace_matched begin BAF0,8,BAF1,8, end;
into device label EC code_regex SBBS,\s+16 replace_matched begin BBS0,8,BBS1,8 end;

into device label EC code_regex SBBM,\s+16, replace_matched begin BBM0,8,BBM1,8, end;
into device label EC code_regex SBMD,\s+16, replace_matched begin BMD0,8,BMD1,8, end;
into device label EC code_regex SBCC,\s+16 replace_matched begin BCC0,8,BCC1,8 end;

into device label EC code_regex SBDC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;
into device label EC code_regex SBDV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;
into device label EC code_regex SBOM,\s+16, replace_matched begin BOM0,8,BOM1,8, end;
into device label EC code_regex SBSI,\s+16, replace_matched begin BSI0,8,BSI1,8, end;
into device label EC code_regex SBDT,\s+16, replace_matched begin BDT0,8,BDT1,8, end;
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;

into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;

into device label EC code_regex (SBMN,)\s+(128) replace_matched begin SBMX,%2,//%1%2 end;

into device label EC code_regex (SBDN,)\s+(128) replace_matched begin SBDX,%2,//%1%2 end;


# fix 16-bit methods
# into method label GBTI code_regex \(HWAC, replaceall_matched begin (B1B2(WAC0,WAC1), end; # Unused in DSDT
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIX code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
# into method label GBTI code_regex \(SBAE, replaceall_matched begin (B1B2(BAE0,BAE1), end; # Unused in DSDT
# into method label GBTI code_regex \(SBRS, replaceall_matched begin (B1B2(BRS0,BRS1), end; # Unused in DSDT
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
# into method label GBTI code_regex \(SBAF, replaceall_matched begin (B1B2(BAF0,BAF1), end; # Unused in DSDT
# into method label GBTI code_regex \(SBBS, replaceall_matched begin (B1B2(BBS0,BBS1), end; # Unused in DSDT
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into method label GBIX code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
# into method label GBTI code_regex \(SBMD, replaceall_matched begin (B1B2(BMD0,BMD1), end; # Unused in DSDT
into method label GBIX code_regex \(SBCC, replaceall_matched begin (B1B2(BCC0,BCC1), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIX code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIX code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end; # Extra fix for compilation
into method label GBIX code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end; # Extra fix for compilation
into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end; # Extra fix for compilation
into method label GBIX code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end; # Extra fix for compilation
# into method label GBTI code_regex \(SBOM, replaceall_matched begin (B1B2(BOM0,BOM1), end; # Unused in DSDT
# into method label GBTI code_regex \(SBSI, replaceall_matched begin (B1B2(BSI0,BSI1), end; # Unused in DSDT
# into method label GBTI code_regex \(SBDT, replaceall_matched begin (B1B2(BDT0,BDT1), end; # Unused in DSDT
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
into method label GBIX code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;


# fix 32-bit methods
# into method label GBTI code_regex \(HDEN, replaceall_matched begin (B1B4(DEN0,DEN1,DEN2,DEN3), end;
# into method label GBTI code_regex \(HDEP, replaceall_matched begin (B1B4(DEP0,DEP1,DEP2,DEP3), end;
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;
into method label GBIX code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;

# fix 128-bit methods
into method label GBIF code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIF code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;

# Fix compilation for renamed HWAK (HWAK reading)
into method label OWAK code_regex \(\\\_SB.PCI0.LPCB.EC.HWAK replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAK0,\\_SB.PCI0.LPCB.EC.WAK1) end;
into method label _L43 code_regex \(\\\_SB.PCI0.LPCB.EC.HWAK replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAK0,\\_SB.PCI0.LPCB.EC.WAK1) end;

I joined my original untouched ACPI files extracted from Clover in case you want to double check my code yourself. It definitely works !

Edit : WOHOO! PrefPane -> Trackpad now accessible :D
 
Here is the patch I built from scratch and that worked for my Lenovo E580 in case you want to check it and add it to your repo :) I attched there the original untouched DSDT dumped by Clover in case you want to make your own tests on it.

I will check in the changes to the existing patch instead of adopting an entirely new patch.
(avoiding adding redundant content...)
 
Hi,

I think I managed to get the battery patch working for Gigabyte Aero 15 V8 (i7 8750H, HM370 chipset)

@RehabMan , maybe you would want to add this to your repo?

Here are the original DSDT disassembled and txt patch file

Thanks (an actual new/unique patch)...
Added to the github project.
 
Hey, @RehabMan

I made the appropriate alterations to @jamesst20 patch for it to correctly compile with the X1 Carbon 6th Gen.
Code:
# B1B2 Method
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

# B1B4 Method
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;

# utility methods to read/write buffers from/to EC
into method label RE1B parent_label H_EC remove_entry;
into method label RECB parent_label H_EC remove_entry;
into device label EC 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(Add(Arg1,7), 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;

#16 bit
into device label EC code_regex HWAC,\s+16 replace_matched begin WAC0,8,WAC1,8 end;
into device label EC code_regex SBRC,\s+16 replace_matched begin BRC0,8,BRC1,8 end;
into device label EC code_regex SBFC,\s+16 replace_matched begin BFC0,8,BFC1,8 end;
into device label EC code_regex SBAC,\s+16 replace_matched begin BAC0,8,BAC1,8 end;
into device label EC code_regex SBVO,\s+16 replace_matched begin BVO0,8,BVO1,8 end;
into device label EC code_regex SBBM,\s+16 replace_matched begin BBM0,8,BBM1,8 end;
into device label EC code_regex SBCC,\s+16 replace_matched begin BCC0,8,BCC1,8 end;
into device label EC code_regex SBDC,\s+16 replace_matched begin BDC0,8,BDC1,8 end;
into device label EC code_regex SBDV,\s+16 replace_matched begin BDV0,8,BDV1,8 end;
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
#32 bit
into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;
#128 bit
into device label EC code_regex (SBMN,)\s+(128) replace_matched begin SBMX,%2,//%1%2 end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin SBDX,%2,//%1%2 end;

#fix 16-bit methods
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label AJTP code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIX code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into method label GBIX code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into method label GBIX code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIX code_regex \(SBCC, replaceall_matched begin (B1B2(BCC0,BCC1), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIX code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIX code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end;
into method label GBIX code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end;
into method label GBIX code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
into method label GBIX code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;

#fix 32-bit methods
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;
into method label GBIX code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;

#fix 128-bit methods
into method label GBIF code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIF code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;

#fix compilation for rename
into method label OWAK code_regex \(\\_SB.PCI0.LPCB.EC.HWAC replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAC0,\\_SB.PCI0.LPCB.EC.WAC1) end;
into method label _L17 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAC0,\\_SB.PCI0.LPCB.EC.WAC1), end;

Please see the attached non patched DSDT to verify
 

Attachments

  • dsdt.dsl
    1 MB · Views: 130
Hey, @RehabMan

I made the appropriate alterations to @jamesst20 patch for it to correctly compile with the X1 Carbon 6th Gen.
Code:
# B1B2 Method
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

# B1B4 Method
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;

# utility methods to read/write buffers from/to EC
into method label RE1B parent_label H_EC remove_entry;
into method label RECB parent_label H_EC remove_entry;
into device label EC 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(Add(Arg1,7), 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;

#16 bit
into device label EC code_regex HWAC,\s+16 replace_matched begin WAC0,8,WAC1,8 end;
into device label EC code_regex SBRC,\s+16 replace_matched begin BRC0,8,BRC1,8 end;
into device label EC code_regex SBFC,\s+16 replace_matched begin BFC0,8,BFC1,8 end;
into device label EC code_regex SBAC,\s+16 replace_matched begin BAC0,8,BAC1,8 end;
into device label EC code_regex SBVO,\s+16 replace_matched begin BVO0,8,BVO1,8 end;
into device label EC code_regex SBBM,\s+16 replace_matched begin BBM0,8,BBM1,8 end;
into device label EC code_regex SBCC,\s+16 replace_matched begin BCC0,8,BCC1,8 end;
into device label EC code_regex SBDC,\s+16 replace_matched begin BDC0,8,BDC1,8 end;
into device label EC code_regex SBDV,\s+16 replace_matched begin BDV0,8,BDV1,8 end;
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
#32 bit
into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;
#128 bit
into device label EC code_regex (SBMN,)\s+(128) replace_matched begin SBMX,%2,//%1%2 end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin SBDX,%2,//%1%2 end;

#fix 16-bit methods
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label AJTP code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIX code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into method label GBIX code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into method label GBIX code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIX code_regex \(SBCC, replaceall_matched begin (B1B2(BCC0,BCC1), end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIX code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIX code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end;
into method label GBIX code_regex \SBDV, replaceall_matched begin B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end;
into method label GBIX code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
into method label GBIX code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;

#fix 32-bit methods
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;
into method label GBIX code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;

#fix 128-bit methods
into method label GBIF code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIF code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;
into method label GBIX code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end;

#fix compilation for rename
into method label OWAK code_regex \(\\_SB.PCI0.LPCB.EC.HWAC replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAC0,\\_SB.PCI0.LPCB.EC.WAC1) end;
into method label _L17 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC.WAC0,\\_SB.PCI0.LPCB.EC.WAC1), end;

Please see the attached non patched DSDT to verify

The way I see it, only a single additional patch needed...
eg.
Code:
NUC6i7KYK:laptop.git rehabman$ git diff
diff --git a/battery/battery_Lenovo-X230i.txt b/battery/battery_Lenovo-X230i.txt
index b2832a9..d4b2e11 100644
--- a/battery/battery_Lenovo-X230i.txt
+++ b/battery/battery_Lenovo-X230i.txt
@@ -12,6 +12,7 @@
 #   Lenovo ThinkPad P50 (6th gen)
 #   Lenovo Thinkpad P51 (KabyLake) (per szclsya)
 #   Lenovo E580 (per jamesst20)
+#   Lenovo Thinkpad X1 Carbon (6th gen) (per jhonizzle)

 # Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

@@ -95,6 +96,8 @@ into method label _L43 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matc
 into method label _WAK code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
 into method label \_WAK code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
 into method label _L17 code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
+# added for X1 Cabon 6th gen
+into method label AJTP code_regex \(SBRC, replaceall_matched begin (B1B2(RC00,RC01), end;

 #put 8-bit variable together
 into method label _L1D code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AK00,\\_SB.PCI0.LPC.EC.AK01), end;
 
The way I see it, only a single additional patch needed...
eg.
Code:
NUC6i7KYK:laptop.git rehabman$ git diff
diff --git a/battery/battery_Lenovo-X230i.txt b/battery/battery_Lenovo-X230i.txt
index b2832a9..d4b2e11 100644
--- a/battery/battery_Lenovo-X230i.txt
+++ b/battery/battery_Lenovo-X230i.txt
@@ -12,6 +12,7 @@
 #   Lenovo ThinkPad P50 (6th gen)
 #   Lenovo Thinkpad P51 (KabyLake) (per szclsya)
 #   Lenovo E580 (per jamesst20)
+#   Lenovo Thinkpad X1 Carbon (6th gen) (per jhonizzle)

 # Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

@@ -95,6 +96,8 @@ into method label _L43 code_regex \(\\_SB\.PCI0\.LPCB\.EC\.HWAK, replaceall_matc
 into method label _WAK code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
 into method label \_WAK code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
 into method label _L17 code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAC, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AC10,\\_SB.PCI0.LPC.EC.AC11), end;
+# added for X1 Cabon 6th gen
+into method label AJTP code_regex \(SBRC, replaceall_matched begin (B1B2(RC00,RC01), end;

 #put 8-bit variable together
 into method label _L1D code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AK00,\\_SB.PCI0.LPC.EC.AK01), end;
Looks good to me, Thanks @RehabMan
 
Back
Top