Contribute
Register

[Guide] How to patch DSDT for working battery status

I installed directly Mojave and yes, worked on DSDT only.
Before this patching, I installed ACPI Battery Manager and VoodooP2sController from RebhabMan, but nothing went successfully until I patched my DSDT.
I'd say if something doesn't work any longer from El Captian...simply forget it and make a clean install + follow the instructions here. Good luck.
 
Hi dear RehabMan, thanks for your hard working. I have successfully installed Mojave on my LG Gram 13 2017 (13z970) and used your clover config and get graphics working perfect, also replaced wifi card and almost everything is working thanks to you. just confused about battery and brightness. I have disassembled DSDT(without ref) with iasl61 and as you said in page 260 battery is in SSDT-9-XnSsdt.dsl. but I really confused about patching.
I found
OperationRegion (ECF4, EmbeddedControl, Zero, 0xFF)

in the line 3341 and
Field (ECF4, ByteAcc, Lock, Preserve)
in the line 3613
but the parameters are 8 bit.
I also read this but can't solve.
I really need your help.
Thank you very much

Plenty of 16-bit fields (perhaps others) that need patching.
Note:
Code:
                Offset (0x84), 
                BDC,    16, 
                BFC,    16, 
                BDV,    16, 
                BDWC,   16, 
                BDLC,   16, 
                Offset (0x92), 
                BSN,    16, 
                BPR,    16, 
                BRC,    16, 
                BPV,    16,
 
Hi RehabMan, thanks for the guide.

I am still having some issues with battery after patching, namely it doesn't report correct percentage. Although it correctly detects when AC adapter is plugged in or removed, it mostly says "not charging" in the menu bar, while it is in-fact charging but the percentage isn't just moving up. When discharging, it's stuck on the same percentage as well, until the battery power runs out. This same behavior happens in Windows as well (I'm multi-booting), but it was working correctly before installing mac. Draining the battery and charging while booted in Windows fixes the issue, but once I boot into macOS, it starts acting up again.

I have attached my battery patches made by following this guide, please take a look. I have only one doubt with the 256-bit field (SMD0), it appears to be declared twice in the DSDT. One in the EC0 device and another in the global scope. The one declared in the EC0 device appears to be referenced only once - an EC write (I patched the method appropriately), I didn't patch the other references as they weren't within the EC0 device, therefore they're probably referencing the one declared in the global scope. Please take a look at the DSDT and patches. Thanks.

I have made some earlier patches to the DSDT before applying my battery patches. The patches are all from your patch repo:
dir /system
- system_WAK2.txt
- system_HPET.txt
- system_SMBUS.txt
- system_IRQ.txt
- system_RTC.txt
- system_OSYS.txt
- system_Mutex.txt
- and also your brightness keys patch from here: https://www.tonymacx86.com/threads/guide-patching-dsdt-ssdt-for-laptop-backlight-control.152659/


Here are my troubleshooting files. Thanks in advance.
"Problem Reporting" files are incomplete.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 
Ciao RehabMan,

working hard in order to patch my HP laptop. Question:

I have SMW0 16 bit, ok, but the instance to patch is this: Store (Arg3, SMW0)

The B1B2 method is a function which provides a value. It looks to me inadequate for the purpose of patching such Store since SMW0 is the destination (and not the value) of the store process.

Where am I wrong ?

Thanks

Such a Store op must be converted to two separate Store ops. B1B2 not applicable.
Refer to the guide and examples in the repo.
 
UATOOOO !!!

My first patching...it works !!! And, as expected, as soon as battery patching went ok, also trackpad came out working properly. I am very proud of my first patching, and ...thanks you RehabMan for your help; thanks also to all the others.

I am sharing with you my patching process, so pls find attached the original DSDT of my HP Pavillon 14-ce0023nl and the file text with the patching process.

Let me know !

Thanks

Existing patch "HP G6 2221ss" a likely match.
Please test.
 
"Problem Reporting" files are incomplete.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.

I have edited my original post and attached problem reporting files as generated by the gen_debug.sh tool.
I have also changed my ACPIBatteryManager.kext to the debug version since the last post. Thanks
 
Hi RehabMan, thanks for the guide.

I am still having some issues with battery after patching, namely it doesn't report correct percentage. Although it correctly detects when AC adapter is plugged in or removed, it mostly says "not charging" in the menu bar, while it is in-fact charging but the percentage isn't just moving up. When discharging, it's stuck on the same percentage as well, until the battery power runs out. This same behavior happens in Windows as well (I'm multi-booting), but it was working correctly before installing mac. Draining the battery and charging while booted in Windows fixes the issue, but once I boot into macOS, it starts acting up again.

I have attached my battery patches made by following this guide, please take a look. I have only one doubt with the 256-bit field (SMD0), it appears to be declared twice in the DSDT. One in the EC0 device and another in the global scope. The one declared in the EC0 device appears to be referenced only once - an EC write (I patched the method appropriately), I didn't patch the other references as they weren't within the EC0 device, therefore they're probably referencing the one declared in the global scope. Please take a look at the DSDT and patches. Thanks.

I have made some earlier patches to the DSDT before applying my battery patches. The patches are all from your patch repo:
dir /system
- system_WAK2.txt
- system_HPET.txt
- system_SMBUS.txt
- system_IRQ.txt
- system_RTC.txt
- system_OSYS.txt
- system_Mutex.txt
- and also your brightness keys patch from here: https://www.tonymacx86.com/threads/guide-patching-dsdt-ssdt-for-laptop-backlight-control.152659/


Here are my troubleshooting files. Thanks in advance.
I have edited my original post and attached problem reporting files as generated by the gen_debug.sh tool.
I have also changed my ACPIBatteryManager.kext to the debug version since the last post. Thanks

Use "HP G6 2221ss" patch.
Also, patch with "OS Check Fix (Windows 10)" (you used "Windows Vista").
 
Existing patch "HP G6 2221ss" a likely match.
Please test.

Yes, it works. Sadness for me. Anyhow...I prefer having worked hard to get my patch, and I stay with it.
Thanks anyway
 
I have edited my original post and attached problem reporting files as generated by the gen_debug.sh tool.
I have also changed my ACPIBatteryManager.kext to the debug version since the last post. Thanks
I have the 17-an011na with gtx 1050, presuming pretty much the same as your system. The HP G6 2221ss patch works mostly until you unplug and replug the charger and it sits on not charging until you reset holding power button for 10 secs then it will charge correctly, it will drain fine too just wont charge correctly when its been unplugged. Let me know if you get anywhere with your battery.
 
Use "HP G6 2221ss" patch.
Also, patch with "OS Check Fix (Windows 10)" (you used "Windows Vista").

The "HP G6 2221ss" matched my DSDT. I have applied it, I also changed to Windows 10 for OS Check Fix. But I'm still having incorrect percentage readings for my battery. After draining the battery, and then charging, it shows correct readings. But once I unplug my power adapter or reboot, it gets stuck on the last reading and never moves again. I have the debug version of the battery kext installed. Here are my troubleshooting files. Thanks
 

Attachments

  • debug_15557.zip
    2.3 MB · Views: 84
Back
Top