Contribute
Register

Battery Manager with Fix for Boot without Batteries

Status
Not open for further replies.
@RehabMan

I'm trying to get your kext working on my sony laptop (VPCSA), but I'm really not sure whats going on in my laptops DSDT with battery. I've got 16bit battery registers, so I know they need to change to 8bit, but then I cant see where/how the registers are updated, so I don't know if its OK for me to just do that. I'd really appreciate it if you could take a look and give me some tips.

Thanks

Your Sony looks the same as another Sony I recently created a patch for:

Code:
# Convert battery EC info from 16-bit to 8-bit fields...

# Need this utility method B1B2(lowbyte, hibyte)... returns ((hibyte << 8) | lowbyte)
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized)\n
{\n
	ShiftLeft (Arg1, 8, Local0)\n
	Or (Arg0, Local0, Local0)\n
	Return (Local0)\n
}\n
end;


# BAT1: Change EC register declarations from 16-bit to 8-bit
into device label H_EC code_regex B1DC,\s+16 replace_matched begin XDC0, 8, XDC1, 8 end;
into device label H_EC code_regex B1FC,\s+16 replace_matched begin XFC0, 8, XFC1, 8 end;
into device label H_EC code_regex B1DV,\s+16 replace_matched begin XDV0, 8, XDV1, 8 end;
into device label H_EC code_regex B1AI,\s+16 replace_matched begin XAI0, 8, XAI1, 8 end;
into device label H_EC code_regex B1FV,\s+16 replace_matched begin XFV0, 8, XFV1, 8 end;
into device label H_EC code_regex B1RC,\s+16 replace_matched begin XRC0, 8, XRC1, 8 end;

# BAT1: Change access (reads) to those registers from 16-bit to 8-bit
into_all method label _BIF code_regex \(B1DC, replaceall_matched begin (B1B2 (XDC0, XDC1), end;
into_all method label _BIF code_regex \(B1FC replaceall_matched begin (B1B2 (XFC0, XFC1) end;
into_all method label _BIF code_regex \(B1DV, replaceall_matched begin (B1B2 (XDV0, XDV1), end;
into_all method label _BST code_regex \(B1AI, replaceall_matched begin (B1B2 (XAI0, XAI1), end;
into_all method label _BST code_regex \(B1FV, replaceall_matched begin (B1B2 (XFV0, XFV1), end;
into_all method label _BST code_regex B1FV\), replaceall_matched begin B1B2 (XFV0, XFV1)\), end;
into_all method label _BST code_regex \(B1RC, replaceall_matched begin (B1B2 (XRC0, XRC1), end;


# BAT2: Change EC register declarations from 16-bit to 8-bit
into device label H_EC code_regex B2DC,\s+16 replace_matched begin YDC0, 8, YDC1, 8 end;
into device label H_EC code_regex B2FC,\s+16 replace_matched begin YFC0, 8, YFC1, 8 end;
into device label H_EC code_regex B2DV,\s+16 replace_matched begin YDV0, 8, YDV1, 8 end;
into device label H_EC code_regex B2AI,\s+16 replace_matched begin YAI0, 8, YAI1, 8 end;
into device label H_EC code_regex B2FV,\s+16 replace_matched begin YFV0, 8, YFV1, 8 end;
into device label H_EC code_regex B2RC,\s+16 replace_matched begin YRC0, 8, YRC1, 8 end;

# BAT2: Change access (reads) to those registers from 16-bit to 8-bit
into_all method label _BIF code_regex \(B2DC, replaceall_matched begin (B1B2 (YDC0, YDC1), end;
into_all method label _BIF code_regex \(B2FC replaceall_matched begin (B1B2 (YFC0, YFC1) end;
into_all method label _BIF code_regex \(B2DV, replaceall_matched begin (B1B2 (YDV0, YDV1), end;
into_all method label _BST code_regex \(B2AI, replaceall_matched begin (B1B2 (YAI0, YAI1), end;
into_all method label _BST code_regex \(B2FV, replaceall_matched begin (B1B2 (YFV0, YFV1), end;
into_all method label _BST code_regex B2FV\), replaceall_matched begin B1B2 (YFV0, YFV1)\), end;
into_all method label _BST code_regex \(B2RC, replaceall_matched begin (B1B2 (YRC0, YRC1), end;

# Activate BAT1 device
into method label _STA parent_label BAT1 replace_content begin Return (0x1F) end;

# Disable BAT2 device
into method label _STA parent_label BAT2 replace_content begin Return (Zero) end;

# Activate H_EC device
into method label _STA parent_label H_EC replace_content begin Return (0x0F) end;
 
Your Sony looks the same as another Sony I recently created a patch for:

Works great! Thanks a bunch.

On an unrelated issue, do you have any idea why (with that DSDT) the laptop does some reaaallly weird things:
On boot, (before login screen, after apple logo + spinner) chance of black screen, nothing happening. Also at the same point chance of "sleep loop" where laptop goes to sleep immediately, and if woken up screen doesn't turn on and goes immediately back to sleep.
After wake, chance of screen not turning back on. Also chance of doing the same "sleep loop".

Its an intel 3000 GPU, EDID+dual link injected in DSDT. I've rolled AppleACPIPlatform.kext back to 10.8.1 (might not need that anymore actually) and I'm using the multibeast patched AppleIntelCPUPowerManagement.kext + a SSDT generated for my cpu with ssdtPRGen. CPU P-states seem to work fine.
Any suggestions? I'm re-hackintoshing after a while away from this stuff, and I'm pretty sure it didn't used to be this unreliable on 10.7 and early 10.8 versions.
 
Works great! Thanks a bunch.

On an unrelated issue, do you have any idea why (with that DSDT) the laptop does some reaaallly weird things:
On boot, (before login screen, after apple logo + spinner) chance of black screen, nothing happening. Also at the same point chance of "sleep loop" where laptop goes to sleep immediately, and if woken up screen doesn't turn on and goes immediately back to sleep.
After wake, chance of screen not turning back on. Also chance of doing the same "sleep loop".

Its an intel 3000 GPU, EDID+dual link injected in DSDT. I've rolled AppleACPIPlatform.kext back to 10.8.1 (might not need that anymore actually) and I'm using the multibeast patched AppleIntelCPUPowerManagement.kext + a SSDT generated for my cpu with ssdtPRGen. CPU P-states seem to work fine.
Any suggestions? I'm re-hackintoshing after a while away from this stuff, and I'm pretty sure it didn't used to be this unreliable on 10.7 and early 10.8 versions.

Don't really know, but I try to avoid rollbacks as much as possible. The idea of mixing kexts from different releases of OSX just seems like a really bad idea.
 
RehabMan, I just want to make sure you saw my last post. Thanks for all your hard work!


I'm also getting 0% battery due to the _BIF error... I think??? I'm hacking an old laptop ASUS U52F

8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager: Battery Supported Count(s) 1.
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::setPowerState: which = 0x1
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery: Using ACPI regular battery information method _BIF
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::clearBatteryState: do_update = false
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::rebuildLegacyIOBatteryInfo called
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::pollBatteryState: path = 0x2
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::pollBatteryState: path = 0x1
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::getBatterySTA called
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatterySTA: battery_status = 0x1f
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::getBatteryBIF called
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::getBatteryBIF: evaluateObject error 0xe00002bc
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBatteryManager::getBatteryBST called
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: fPowerUnit = 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: currentStatus = 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: fCurrentRate = 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0xe4b4
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: fCurrentVoltage = 0x418f
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: adjusted fCurrentRate = 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::setBatteryBST: fAverageRate = 0x0
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery: Battery is charged.
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::constructAppleSerialNumber called
8/11/13 3:46:17.000 PM kernel[0] AppleSmartBattery::rebuildLegacyIOBatteryInfo called
8/11/13 3:46:36.000 PM kernel[0] AppleSmartBattery::pollingTimeOut called


I'm also attaching my dsdt. Thanks!
 
RehabMan, I just want to make sure you saw my last post. Thanks for all your hard work!

Yes, I saw it...

I may have time to work on a DSDT patch for it later...
 
Thanks a lot!
 
I'm also getting 0% battery due to the _BIF error... I think??? I'm hacking an old laptop ASUS U52F
...

I'm also attaching my dsdt. Thanks!

Here is a DSDT battery patch for you to try:
(it is pretty involved, so it may need work yet... we'll see...)

Code:
# ASUS battery patch -jesselid

# created by RehabMan 8/12/2013
# good for Asus N55SL, BIOS rev. 204

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

# not really for battery, but might come in handy to read fan speed(s)
into device label EC0 code_regex TAH0,\s+16 replace_matched begin TH00,8,TH01,8 end;
into device label EC0 code_regex TAH1,\s+16 replace_matched begin TH10,8,TH11,8 end;
into method label TACH code_regex \(TAH0, replace_matched begin (B1B2(TH00,TH01), end;
into method label TACH code_regex \(TAH1, replace_matched begin (B1B2(TH10,TH11), end;

# battery EC
into device label EC0 code_regex B0SN,\s+16 replace_matched begin B0S0,8,B0S1,8 end;
into device label EC0 code_regex B1SN,\s+16 replace_matched begin B1S0,8,B1S1,8 end;
into method label BIFA code_regex \(B0SN, replace_matched begin (B1B2(B0S0,B0S1), end;
into method label BIFA code_regex \(B1SN, replace_matched begin (B1B2(B1S0,B1S1), end;

into device label EC0 insert
begin
Method (RDBA, 0, Serialized)\n
{\n
    Name (TEMP, Buffer(0x20) { })\n
    Store (BA00, Index(TEMP, 0x00))\n
    Store (BA01, Index(TEMP, 0x01))\n
    Store (BA02, Index(TEMP, 0x02))\n
    Store (BA03, Index(TEMP, 0x03))\n
    Store (BA04, Index(TEMP, 0x04))\n
    Store (BA05, Index(TEMP, 0x05))\n
    Store (BA06, Index(TEMP, 0x06))\n
    Store (BA07, Index(TEMP, 0x07))\n
    Store (BA08, Index(TEMP, 0x08))\n
    Store (BA09, Index(TEMP, 0x09))\n
    Store (BA0A, Index(TEMP, 0x0A))\n
    Store (BA0B, Index(TEMP, 0x0B))\n
    Store (BA0C, Index(TEMP, 0x0C))\n
    Store (BA0D, Index(TEMP, 0x0D))\n
    Store (BA0E, Index(TEMP, 0x0E))\n
    Store (BA0F, Index(TEMP, 0x0F))\n
    Store (BA10, Index(TEMP, 0x10))\n
    Store (BA11, Index(TEMP, 0x11))\n
    Store (BA12, Index(TEMP, 0x12))\n
    Store (BA13, Index(TEMP, 0x13))\n
    Store (BA14, Index(TEMP, 0x14))\n
    Store (BA15, Index(TEMP, 0x15))\n
    Store (BA16, Index(TEMP, 0x16))\n
    Store (BA17, Index(TEMP, 0x17))\n
    Store (BA18, Index(TEMP, 0x18))\n
    Store (BA19, Index(TEMP, 0x19))\n
    Store (BA1A, Index(TEMP, 0x1A))\n
    Store (BA1B, Index(TEMP, 0x1B))\n
    Store (BA1C, Index(TEMP, 0x1C))\n
    Store (BA1D, Index(TEMP, 0x1D))\n
    Store (BA1E, Index(TEMP, 0x1E))\n
    Store (BA1F, Index(TEMP, 0x1F))\n
    Return (TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WRBA, 1, Serialized)\n
{\n
    Name (TEMP, Buffer(0x20) { })\n
    Store (Arg0, TEMP)\n
    Store (DerefOf(Index(TEMP, 0x00)), BA00)\n
    Store (DerefOf(Index(TEMP, 0x01)), BA01)\n
    Store (DerefOf(Index(TEMP, 0x02)), BA02)\n
    Store (DerefOf(Index(TEMP, 0x03)), BA03)\n
    Store (DerefOf(Index(TEMP, 0x04)), BA04)\n
    Store (DerefOf(Index(TEMP, 0x05)), BA05)\n
    Store (DerefOf(Index(TEMP, 0x06)), BA06)\n
    Store (DerefOf(Index(TEMP, 0x07)), BA07)\n
    Store (DerefOf(Index(TEMP, 0x08)), BA08)\n
    Store (DerefOf(Index(TEMP, 0x09)), BA09)\n
    Store (DerefOf(Index(TEMP, 0x0A)), BA0A)\n
    Store (DerefOf(Index(TEMP, 0x0B)), BA0B)\n
    Store (DerefOf(Index(TEMP, 0x0C)), BA0C)\n
    Store (DerefOf(Index(TEMP, 0x0D)), BA0D)\n
    Store (DerefOf(Index(TEMP, 0x0E)), BA0E)\n
    Store (DerefOf(Index(TEMP, 0x0F)), BA0F)\n
    Store (DerefOf(Index(TEMP, 0x10)), BA10)\n
    Store (DerefOf(Index(TEMP, 0x11)), BA11)\n
    Store (DerefOf(Index(TEMP, 0x12)), BA12)\n
    Store (DerefOf(Index(TEMP, 0x13)), BA13)\n
    Store (DerefOf(Index(TEMP, 0x14)), BA14)\n
    Store (DerefOf(Index(TEMP, 0x15)), BA15)\n
    Store (DerefOf(Index(TEMP, 0x16)), BA16)\n
    Store (DerefOf(Index(TEMP, 0x17)), BA17)\n
    Store (DerefOf(Index(TEMP, 0x18)), BA18)\n
    Store (DerefOf(Index(TEMP, 0x19)), BA19)\n
    Store (DerefOf(Index(TEMP, 0x1A)), BA1A)\n
    Store (DerefOf(Index(TEMP, 0x1B)), BA1B)\n
    Store (DerefOf(Index(TEMP, 0x1C)), BA1C)\n
    Store (DerefOf(Index(TEMP, 0x1D)), BA1D)\n
    Store (DerefOf(Index(TEMP, 0x1E)), BA1E)\n
    Store (DerefOf(Index(TEMP, 0x1F)), BA1F)\n
}\n
end;

into device label EC0 code_regex BDAT,\s+256 replace_matched 
begin
//BDAT, 256,\n
BA00,8,BA01,8,BA02,8,BA03,8,
BA04,8,BA05,8,BA06,8,BA07,8,
BA08,8,BA09,8,BA0A,8,BA0B,8,
BA0C,8,BA0D,8,BA0E,8,BA0F,8,
BA10,8,BA11,8,BA12,8,BA13,8,
BA14,8,BA15,8,BA16,8,BA17,8,
BA18,8,BA19,8,BA1A,8,BA1B,8,
BA1C,8,BA1D,8,BA1E,8,BA1F,8
end;

into method label SMBR code_regex \(BDAT, replaceall_matched begin (RDBA(), end;
into method label SMBR code_regex Store\s\((.*),\sBDAT\) replaceall_matched begin WRBA(%1) end;
into method label SMBW code_regex Store\s\((.*),\sBDAT\) replaceall_matched begin WRBA(%1) end;
into method label ECSB code_regex Store\s\((.*),\sBDAT\) replaceall_matched begin WRBA(%1) end;
into method label ECSB code_regex \(BDAT, replaceall_matched begin (RDBA(), end;


into device label EC0 insert
begin
Method (RDBB, 0, Serialized)\n
{\n
    Name (TEMP, Buffer(0x20) { })\n
    Store (BB00, Index(TEMP, 0x00))\n
    Store (BB01, Index(TEMP, 0x01))\n
    Store (BB02, Index(TEMP, 0x02))\n
    Store (BB03, Index(TEMP, 0x03))\n
    Store (BB04, Index(TEMP, 0x04))\n
    Store (BB05, Index(TEMP, 0x05))\n
    Store (BB06, Index(TEMP, 0x06))\n
    Store (BB07, Index(TEMP, 0x07))\n
    Store (BB08, Index(TEMP, 0x08))\n
    Store (BB09, Index(TEMP, 0x09))\n
    Store (BB0A, Index(TEMP, 0x0A))\n
    Store (BB0B, Index(TEMP, 0x0B))\n
    Store (BB0C, Index(TEMP, 0x0C))\n
    Store (BB0D, Index(TEMP, 0x0D))\n
    Store (BB0E, Index(TEMP, 0x0E))\n
    Store (BB0F, Index(TEMP, 0x0F))\n
    Store (BB10, Index(TEMP, 0x10))\n
    Store (BB11, Index(TEMP, 0x11))\n
    Store (BB12, Index(TEMP, 0x12))\n
    Store (BB13, Index(TEMP, 0x13))\n
    Store (BB14, Index(TEMP, 0x14))\n
    Store (BB15, Index(TEMP, 0x15))\n
    Store (BB16, Index(TEMP, 0x16))\n
    Store (BB17, Index(TEMP, 0x17))\n
    Store (BB18, Index(TEMP, 0x18))\n
    Store (BB19, Index(TEMP, 0x19))\n
    Store (BB1A, Index(TEMP, 0x1A))\n
    Store (BB1B, Index(TEMP, 0x1B))\n
    Store (BB1C, Index(TEMP, 0x1C))\n
    Store (BB1D, Index(TEMP, 0x1D))\n
    Store (BB1E, Index(TEMP, 0x1E))\n
    Store (BB1F, Index(TEMP, 0x1F))\n
    Return (TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WRBB, 1, Serialized)\n
{\n
    Name (TEMP, Buffer(0x20) { })\n
    Store (Arg0, TEMP)\n
    Store (DerefOf(Index(TEMP, 0x00)), BB00)\n
    Store (DerefOf(Index(TEMP, 0x01)), BB01)\n
    Store (DerefOf(Index(TEMP, 0x02)), BB02)\n
    Store (DerefOf(Index(TEMP, 0x03)), BB03)\n
    Store (DerefOf(Index(TEMP, 0x04)), BB04)\n
    Store (DerefOf(Index(TEMP, 0x05)), BB05)\n
    Store (DerefOf(Index(TEMP, 0x06)), BB06)\n
    Store (DerefOf(Index(TEMP, 0x07)), BB07)\n
    Store (DerefOf(Index(TEMP, 0x08)), BB08)\n
    Store (DerefOf(Index(TEMP, 0x09)), BB09)\n
    Store (DerefOf(Index(TEMP, 0x0A)), BB0A)\n
    Store (DerefOf(Index(TEMP, 0x0B)), BB0B)\n
    Store (DerefOf(Index(TEMP, 0x0C)), BB0C)\n
    Store (DerefOf(Index(TEMP, 0x0D)), BB0D)\n
    Store (DerefOf(Index(TEMP, 0x0E)), BB0E)\n
    Store (DerefOf(Index(TEMP, 0x0F)), BB0F)\n
    Store (DerefOf(Index(TEMP, 0x10)), BB10)\n
    Store (DerefOf(Index(TEMP, 0x11)), BB11)\n
    Store (DerefOf(Index(TEMP, 0x12)), BB12)\n
    Store (DerefOf(Index(TEMP, 0x13)), BB13)\n
    Store (DerefOf(Index(TEMP, 0x14)), BB14)\n
    Store (DerefOf(Index(TEMP, 0x15)), BB15)\n
    Store (DerefOf(Index(TEMP, 0x16)), BB16)\n
    Store (DerefOf(Index(TEMP, 0x17)), BB17)\n
    Store (DerefOf(Index(TEMP, 0x18)), BB18)\n
    Store (DerefOf(Index(TEMP, 0x19)), BB19)\n
    Store (DerefOf(Index(TEMP, 0x1A)), BB1A)\n
    Store (DerefOf(Index(TEMP, 0x1B)), BB1B)\n
    Store (DerefOf(Index(TEMP, 0x1C)), BB1C)\n
    Store (DerefOf(Index(TEMP, 0x1D)), BB1D)\n
    Store (DerefOf(Index(TEMP, 0x1E)), BB1E)\n
    Store (DerefOf(Index(TEMP, 0x1F)), BB1F)\n
}\n
end;

into device label EC0 code_regex BDA2,\s+256 replace_matched 
begin
//BDA2, 256,\n
BB00,8,BB01,8,BB02,8,BB03,8,
BB04,8,BB05,8,BB06,8,BB07,8,
BB08,8,BB09,8,BB0A,8,BB0B,8,
BB0C,8,BB0D,8,BB0E,8,BB0F,8,
BB10,8,BB11,8,BB12,8,BB13,8,
BB14,8,BB15,8,BB16,8,BB17,8,
BB18,8,BB19,8,BB1A,8,BB1B,8,
BB1C,8,BB1D,8,BB1E,8,BB1F,8
end;

into method label SMBR code_regex \(BDA2, replaceall_matched begin (RDBB(), end;
into method label SMBR code_regex Store\s\((.*),\sBDA2\) replaceall_matched begin WRBB(%1) end;
into method label SMBW code_regex Store\s\((.*),\sBDA2\) replaceall_matched begin WRBB(%1) end;
into method label ECSB code_regex Store\s\((.*),\sBDA2\) replaceall_matched begin WRBB(%1) end;
into method label ECSB code_regex \(BDA2, replaceall_matched begin (RDBB(), end;

Edit: Realized a slight mistake. Code block updated...
 
Wow! Thanks! I'll try it tonight and let you know. You da man!
 
hello RehabMan
thanks for your work
but i have some difficulties with my battery in hp envy dv6
after install your last smartbattery i have this in log

and so on...
I can't find what I should change in my DSDT
can you check it?

sorry for my english)

You can try this patch:

Code:
# HP Envy dv6 battery patch -grinchenko

# created by RehabMan 8/12/2013

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

into definitionblock code_regex External\s+\(\\TNOT\) remove_matched;

# battery EC

# 16-bit group1
into scope label _SB.PCI0.LPCB.EC code_regex BSRC,\s+16 replace_matched begin BRC0,8,BRC1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSFC,\s+16 replace_matched begin BFC0,8,BFC1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSPE,\s+16 replace_matched begin BPE0,8,BPE1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSAC,\s+16 replace_matched begin BAC0,8,BAC1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSVO,\s+16 replace_matched begin BVO0,8,BVO1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSCU,\s+16 replace_matched begin BCU0,8,BCU1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSTV,\s+16 replace_matched begin BTV0,8,BTV1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSDC,\s+16 replace_matched begin BDC0,8,BDC1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSDV,\s+16 replace_matched begin BDV0,8,BDV1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSMA,\s+16 replace_matched begin BMA0,8,BMA1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSBS,\s+16 replace_matched begin BBS0,8,BBS1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSCY,\s+16 replace_matched begin BCY0,8,BCY1,8 end;

# 16-bit group2
into scope label _SB.PCI0.LPCB.EC code_regex BSCV,\s+16 replace_matched begin BCV0,8,BCV1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSMD,\s+16 replace_matched begin BMD0,8,BMD1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSCC,\s+16 replace_matched begin BCC0,8,BCC1,8 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSME,\s+16 replace_matched begin BME0,8,BME1,8 end;

# 128-bit
into scope label _SB.PCI0.LPCB.EC code_regex BSMN,\s+128 replace_matched begin BMN_,128 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSDN,\s+128 replace_matched begin BDN_,128 end;
into scope label _SB.PCI0.LPCB.EC code_regex BSCH,\s+128 replace_matched begin BCH_,128 end;


# GBIF 16-bit
into method label GBIF code_regex \(BSFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBIF code_regex \(BSDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into method label GBIF code_regex \(BSSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
# GBIF 128-bit (just remove)
into method label GBIF code_regex Store\s+\(BSDN.* remove_matched;
into method label GBIF code_regex Store\s+\(BSCH.* remove_matched;
into method label GBIF code_regex Store\s+\(BSMN.* remove_matched;

# GBST 16-bit
into method label GBST code_regex \(BSAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into method label GBST code_regex \(BSRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into method label GBST code_regex \(BSFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into method label GBST code_regex \(BSVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;

# GBAT (probably not called by OS X, but…) 16-bit
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BDC0,^^PCI0.LPCB.EC.BDC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSCY, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BCY0,^^PCI0.LPCB.EC.BCY1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSDV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BDV0,^^PCI0.LPCB.EC.BDV1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSBS, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BBS0,^^PCI0.LPCB.EC.BBS1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BDC0,^^PCI0.LPCB.EC.BDC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSSN, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BSN0,^^PCI0.LPCB.EC.BSN1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSMA, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BMA0,^^PCI0.LPCB.EC.BMA1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BDC0,^^PCI0.LPCB.EC.BDC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSFC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BFC0,^^PCI0.LPCB.EC.BFC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSRC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BRC0,^^PCI0.LPCB.EC.BRC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSTV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BTV0,^^PCI0.LPCB.EC.BTV1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSVO, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BVO0,^^PCI0.LPCB.EC.BVO1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSDC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BDC0,^^PCI0.LPCB.EC.BDC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSCU, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BCU0,^^PCI0.LPCB.EC.BCU1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSAC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BAC0,^^PCI0.LPCB.EC.BAC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSME, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BME0,^^PCI0.LPCB.EC.BME1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSMD, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BMD0,^^PCI0.LPCB.EC.BMD1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSCC, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BCC0,^^PCI0.LPCB.EC.BCC1), end;
into method label GBAT code_regex \(\^\^PCI0\.LPCB\.EC\.BSCV, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC.BCV0,^^PCI0.LPCB.EC.BCV1), end;
# GBAT 128-bit (just remove)
into method label GBAT code_regex Store\s+\(.*BSDN.* remove_matched;
into method label GBAT code_regex Store\s+\(.*BSCH.* remove_matched;
into method label GBAT code_regex Store\s+\(.*BSMN.* remove_matched;
 
Here is a DSDT battery patch for you to try:
(it is pretty involved, so it may need work yet... we'll see...)

[...]

Edit: Realized a slight mistake. Code block updated...

For what it's worth, your patch (I didn't apply all of it) allows for the retrieval of the battery's serial number and other extended information correctly (it's much cleaner than what I had taken previously). Thanks, RehabMan!
 
Status
Not open for further replies.
Back
Top