Contribute
Register

[Guide] How to patch DSDT for working battery status

After spending more than 6 hours, I've managed to make a working patch.
I've re-patched a vanilla DSDT using the patch I've made and it's working as it should.

I'm attaching it in txt format.

Thanks for your time!

I think existing patch "HP DV7-7xxx/DV6-7xxx" is a match.
No need for an additional/duplicate patch in the repo.
 
I think existing patch "HP DV7-7xxx/DV6-7xxx" is a match.
No need for an additional/duplicate patch in the repo.

Mine didn't work without the _STA patch you mentioned.
And there are some minor differences, maybe that makes the patch incompatible?
Anyways, I'm not experienced at all, so the decision you've chosen must be the one to follow!
Thanks for your time!
 
Mine didn't work without the _STA patch you mentioned.

Easy enough to add the _STA patch to the existing repo patch.

And there are some minor differences, maybe that makes the patch incompatible?

No idea without details.
Any such "minor differences", if necessary, should be accommodated with changes to the existing patch instead of introducing a new patch which is mostly redundant.
 
.
 
Last edited:
.
 
Last edited:
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
 

Attachments

  • Archive.zip
    237.3 KB · Views: 74
Last edited:
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.
 

Attachments

  • my_battery_patches.txt
    4.9 KB · Views: 87
  • debug_18185.zip
    2.4 MB · Views: 71
Last edited:
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
 
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

Hi pacut,
You're right. You would be writing to the EC in that case. Refer to this post:
https://www.tonymacx86.com/threads/...for-working-battery-status.116102/post-831958
 
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
 

Attachments

  • HP pavillon 14-ce0023nl.zip
    32.4 KB · Views: 73
Back
Top