RehabMan
Moderator
- Joined
- May 2, 2012
- Messages
- 181,015
- Motherboard
- Intel DH67BL
- CPU
- i7-2600K
- Graphics
- HD 3000
- Mac
- Mobile Phone
@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;