Contribute
Register

[Guide] How to patch DSDT for working battery status

How to patch DSDT for working battery status

Battery status is separate from any other DSDT patch you may do.



OK, that just means you don't need to install patched AppleIntelCPUPowerManagement. All other PM checklist items still apply.



That is correct behavior. Most laptop chargers do not begin charge the battery until it is under some threshold. This is to reduce the number of unnecessary cycles on the battery such that the battery lifetime is extended.

This behavior has nothing to do with battery status kext/battery patches. It is behavior built-in to the charger/embedded controller firmware in your laptop.

Ok I understand, I can cohabit with that. Thanks for your time, you're the best.

OP: I need to ask you a thing, I will send you a pm.
 
How to patch DSDT for working battery status

Hello everyone,

I have acer aspire 5935g laptop. I cannot get battery info. Can you please help me what I have to do ?

thanks a lot.
 
How to patch DSDT for working battery status

Hello everyone,

I have acer aspire 5935g laptop. I cannot get battery info. Can you please help me what I have to do ?

thanks a lot.

Read post #1.
 
How to patch DSDT for working battery status

I have a Thinkpad W510 and even after all the DSDT fixes I cannot get battery status working.

8-bit only fields in the EC? Check.
Zero out mutexes? Check.

But still no luck — overall read timeout errors, and that's it.

Also, I plan to actually use a second battery, so prying out the second battery handling from the DSDT is not really an option. Moreover, your kext is working perfectly well with a Thinkpad X220 with two batteries.

I'm using the latest code from git master.

My current DSDT with the fixes planted into it are at https://www.dropbox.com/s/1syft50q2w10qjy/DSDT02.dsl
Thanks for any bit of help with this!
 
How to patch DSDT for working battery status

I have a Thinkpad W510 and even after all the DSDT fixes I cannot get battery status working.

8-bit only fields in the EC? Check.
Zero out mutexes? Check.

But still no luck — overall read timeout errors, and that's it.

Also, I plan to actually use a second battery, so prying out the second battery handling from the DSDT is not really an option. Moreover, your kext is working perfectly well with a Thinkpad X220 with two batteries.

I'm using the latest code from git master.

My current DSDT with the fixes planted into it are at https://www.dropbox.com/s/1syft50q2w10qjy/DSDT02.dsl
Thanks for any bit of help with this!

DSDT is not correctly patched... Read post #1.

From your DSDT:
Code:
                    OperationRegion (ECOR, EmbeddedControl, Zero, 0x0100)
...
                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                        SBRC,   16, 
                        SBFC,   16, 
                        SBAE,   16, 
                        SBRS,   16, 
                        SBAC,   16, 
                        SBVO,   16, 
                        SBAF,   16, 
                        SBBS,   16
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                            ,   15, 
                        SBCM,   1, 
                        SBMD,   16, 
                        SBCC,   16
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                        SBDC,   16, 
                        SBDV,   16, 
                        SBOM,   16, 
                        SBSI,   16, 
                        SBDT,   16, 
                        SBSN,   16
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                        SBCH,   32
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                        SBMN,   128
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                                Offset (0xA0), 
                        SBDN,   128
                    }
 
How to patch DSDT for working battery status

Oh my gosh, I thought I whacked all the moles and kinda haven't noticed an elephant. Thanks! Will post back as soon as those are resolved.
 
How to patch DSDT for working battery status

The timing on two batteries is calculated roughly ok —*almost the same figures Linux gives me on the same machine.

One thing that may be treated as a bug, though: when I'm on battery power, the slice battery is (properly) shown as discharging, and the time to live is displayed for it. The main battery sits as if "plugged in" with the "charged" icon. It's a minor nuisance, maybe I don't know something vital, but I think that it should show instead as unplugged and on 100% (or whatever charge level).

The timing is calculated separately for each battery. So, first I see the countdown for the slice.

I haven't tried to exhaust the slice battery, though, to see how the transition to the internal one would happen.

I will post ioreg for the X220 over weekend, when I make it bootable again.
 
How to patch DSDT for working battery status

The timing on two batteries is calculated roughly ok —*almost the same figures Linux gives me on the same machine.

One thing that may be treated as a bug, though: when I'm on battery power, the slice battery is (properly) shown as discharging, and the time to live is displayed for it. The main battery sits as if "plugged in" with the "charged" icon. It's a minor nuisance, maybe I don't know something vital, but I think that it should show instead as unplugged and on 100% (or whatever charge level).

Are you running the latest version?

The timing is calculated separately for each battery. So, first I see the countdown for the slice.

I haven't tried to exhaust the slice battery, though, to see how the transition to the internal one would happen.

I will post ioreg for the X220 over weekend, when I make it bootable again.

I would like to see ioreg dumps for various scenarios and screenshots that match.

See these posts where we've been working on the same/similar issue on a Sony with a sheet battery (two batteries), starting at post #503: http://www.tonymacx86.com/mountain-...fix-boot-without-batteries-51.html#post746272

It sounds like your dual-battery scenario is working much better than JayMonkey's so, it would be nice to figure out what the difference is...
 
How to patch DSDT for working battery status

Be my guest when I make that machine boot again.

Meanwhile, in the land of W510.
I have applied fixes more generously, but now I get some ridiculous information. See, for example, this System Profiler excerpt:

Battery Information:

Model Information:
Serial Number: Unknown-Unknown
Charge Information:
The battery's charge is below the critical level.: No
The battery's charge is below the warning level.: No
Charge Remaining (mAh): 55640 // WAT?
Fully Charged: Yes
Charging: No
Health Information:
Cycle Count: 0 // I know there's 14
Condition: Normal
Battery Installed: Yes
Amperage (mA): 0
Voltage (mV): 12456

The percentage is 0%.

But at least the system knows there is a battery, and can tell being on battery from being on AC!

I suspect something about all those fields you pointed out being at the same offset, but I don't know ACPI guts much. Maybe there's some mode-switching on the controller which repurposes that chunk of memory (but I suspect not).

The DSDT: https://www.dropbox.com/s/f2jrovvxe1w1cnq/DSDT03.dsl
 
Back
Top