Contribute
Register

[Guide] How to patch DSDT for working battery status

How to patch DSDT for working battery status

Hey RehabMan Here is a copy of my dsdt untouched Thanks again for this amazing guide

The only problem I found was in this line in _BTP:
Code:
                                Store (Local0, ^^PCI0.LPCB.H_EC.BTPC)

Needs this patch:
Code:
into method label _BTP code_regex Store\s\((.*),\s\^\^PCI0\.LPCB\.H_EC\.BTPC\) replace_matched
begin 
Store(ShiftRight(%1,8), ^^PCI0.LPCB.H_EC.BPC1) Store(%1, ^^PCI0.LPCB.H_EC.BPC1)
end;

The other patch related to _BTP is not effective and so I removed it.
 
How to patch DSDT for working battery status

The only problem I found was in this line in _BTP:
Code:
                                Store (Local0, ^^PCI0.LPCB.H_EC.BTPC)

Needs this patch:
Code:
into method label _BTP code_regex Store\s\((.*),\s\^\^PCI0\.LPCB\.H_EC\.BTPC\) replace_matched
begin 
Store(ShiftRight(%1,8), ^^PCI0.LPCB.H_EC.BPC1) Store(%1, ^^PCI0.LPCB.H_EC.BPC1)
end;

The other patch related to _BTP is not effective and so I removed it.

Thanks man you are the best, honestly since I was working at the time I was uploading the dsdt i didn't have time to tell you that for that particular patch I had to manually shift the values in the line to make it work, this is a new universe for me so you can imagine I'm trying to learn as I go Thanks again I will update what I have.
 
How to patch DSDT for working battery status

Hello RehabMan , thanks for all useful info!

I attach my patched dsdt, it's from lenovo x220 bios 1.39 and it's different from that you have on repository , it works on maverics with your battery 1.40 but with 1.50 it doesn't update Power Source from Power adapter to battery and system preferences - energy saver says Current battery charge : 0 ,
if you want take a look at it and put it with your other patches for x220 , thank you


12/17/13 13:25:49.000 kernel[0]: ACPIBatteryManager: Version 1.50 starting.
12/17/13 13:25:49.000 kernel[0]: ACPIBatteryManager: Using ACPI regular battery information method _BIF
12/17/13 13:25:55.000 kernel[0]: ACPIBatteryManager: Error: Overall Read Timeout Expired (0)

http://www3.zippyshare.com/v/81995371/file.html


*update edit : i put these fixes and now the power source updates but energy saver says Current battery charge : 0 and doesn't calculate remaining time (0:00 remaining)

#system_Mutext.txt
# Power fix - cause AppleACPIACAdapter to be loaded


*from ioreg

| +-o ADP1 <class IOACPIPlatformDevice, id 0x10000015d, registered, matche$

| | +-o rehab_ACPIACAdapter <class rehab_ACPIACAdapter, id 0x1000001ca, !r$
 
How to patch DSDT for working battery status

Hello RehabMan , thanks for all useful info!

I attach my patched dsdt, it's from lenovo x220 bios 1.39 and it's different from that you have on repository , it works on maverics with your battery 1.40 but with 1.50 it doesn't update Power Source from Power adapter to battery and system preferences - energy saver says Current battery charge : 0 ,
if you want take a look at it and put it with your other patches for x220 , thank you


12/17/13 13:25:49.000 kernel[0]: ACPIBatteryManager: Version 1.50 starting.
12/17/13 13:25:49.000 kernel[0]: ACPIBatteryManager: Using ACPI regular battery information method _BIF
12/17/13 13:25:55.000 kernel[0]: ACPIBatteryManager: Error: Overall Read Timeout Expired (0)

http://www3.zippyshare.com/v/81995371/file.html


*update edit : i put these fixes and now the power source updates but energy saver says Current battery charge : 0 and doesn't calculate remaining time (0:00 remaining)

#system_Mutext.txt
# Power fix - cause AppleACPIACAdapter to be loaded


*from ioreg

| +-o ADP1 <class IOACPIPlatformDevice, id 0x10000015d, registered, matche$

| | +-o rehab_ACPIACAdapter <class rehab_ACPIACAdapter, id 0x1000001ca, !r$

Your DSDT has Mutex objects non-zero SyncLevel. Use "Fix Mutex with non-Zero SyncLevel" DSDT patch from the laptop repo.
 
How to patch DSDT for working battery status

i did apply mutex and power : Name (_PRW, Package() { 0x18, 0x03 })

it calculates the remaining time and the change from ac/battery works but not every time and when it works the change is sometimes fast , sometimes slow , percentage works but still have this error in console :

ACPIBatteryManager: Error: Overall Read Timeout Expired (0)
and
energy saver says Current battery charge : 0

no problem with the 1.40, everything worked as it should, anyway i'll change back to 1.40 for now
 
How to patch DSDT for working battery status

i did apply mutex and power : Name (_PRW, Package() { 0x18, 0x03 })

Not in the DSDT you provided.

it calculates the remaining time and the change from ac/battery works but not every time and when it works the change is sometimes fast , sometimes slow , percentage works but still have this error in console :

ACPIBatteryManager: Error: Overall Read Timeout Expired (0)
and
energy saver says Current battery charge : 0

no problem with the 1.40, everything worked as it should, anyway i'll change back to 1.40 for now

Probably caused by multiple active battery objects, but a second one that doesn't work. You could probably disable the second battery with:
Code:
into method label _STA parent_label BAT1 replace_content begin Return(0) end;
 
How to patch DSDT for working battery status

alright! it works now with your multiple active battery objects fix
here is my new dsdt :
http://www24.zippyshare.com/v/82117974/file.html

great :)
 
How to patch DSDT for working battery status

RehabMan i have a problem with Amperage (mA) reading in System report - power
it reads
Amperage (mA): -2651 when i'm on battery and 0 when i'm on power adapter.

i've tried
"UseExtendedBatteryInformationMethod" to false
and "UseExtendedBatteryInformationMethod" to false but nothing changed.
 
How to patch DSDT for working battery status

RehabMan i have a problem with Amperage (mA) reading in System report - power
it reads
Amperage (mA): -2651 when i'm on battery and 0 when i'm on power adapter.


That is the expected behavior. When you're on the AC adapter, you're not drawing any power (amperage) from the battery.
 
How to patch DSDT for working battery status

ok understandable
 
Back
Top