Contribute
Register

[Guide] How to patch DSDT for working battery status

Ok... I"m confused from others answer-questions in the same post "here".
From the first class of school...if you don"t mine?
When has the "offset" (0x12), we count from here to 0x13, 0x14....
And when the "offset" is (0x5d) we count 0x5c, 0x5d.... Until we found the next 4 letters that needs "fix"
Ok sow far, I get it?

Yes, it is basic counting/addition.

I want help... I'm 1 step before make my first DSDT for the battery to work .
My goall is to post "my??" DSDT to your Laptop patches.
I have 2 errors for SMDA ( after rename it SM00, SM01....) Somewhere in progress I lost it.

You should work through the example DSDT before you attempt with your own.

I see from other Lenovo patches that not match with mine but I take other example from them and make another but they have errors to.

The existing patches can be used as examples to go by.
 
Mr RehabMan...
In #1 post and you made a wrong...

Similar to the patches for 16-bit, but instead we use B1B4:

Code:
# fix 32-bit methods
into method label GBTI code_regex \(BTY0, replaceall_matched begin (B1B4(TY00,TY01,TY02,TY03), end; You missed 1 line here from 32-bit

into method label GBTI code_regex \(BTY1, replaceall_matched begin (B1B4(TY10,TY11,TY12,TY13), end;

I do read-test all examples and all from Lenovo patches.
O know that is to much the #1322 posts!!



 
...You missed 1 line here from 32-bit

into method label GBTI code_regex \(BTY1, replaceall_matched begin (B1B4(TY10,TY11,TY12,TY13), end;

Fixed...

Note: It is correct in the patch repo for this particular DSDT.
 
Hi there,

I've a half working battery status : when I click into the battery menu , I can see how much time remaining.
But the percentage is 0 % all the time.

Any kind man here who would like to see my DSDT or SSDT ??

I tried to follow the guide, but I dont understand anything above the second line...

Thanks,
 
Hi there,

I've a half working battery status : when I click into the battery menu , I can see how much time remaining.
But the percentage is 0 % all the time.

Any kind man here who would like to see my DSDT or SSDT ??

I tried to follow the guide, but I dont understand anything above the second line...

Thanks,

Did you work through the example DSDT first? Don't expect to jump right in with your own.
 
Hallo again sir......
I notice in post #1 that with 16-bit method, that in some registers you put ''s'' before letters, e.g.

into method label GBTI code_regex \sBMD0\) replaceall_matched begin B1B2(MD00,MD01)) end;

This is because is more than 1 like example is 5's BMD0's...?

I'm confused cause I have 5 of SMDA 256-bit and cannot compile without error...
Reading more than 51 pages with posts and counting to see something I do wrong to make it work...
Maybe i stuck...

I attach my patches for Lenovo G50-70
 
Hallo again sir......
I notice in post #1 that with 16-bit method, that in some registers you put ''s'' before letters, e.g.

into method label GBTI code_regex \sBMD0\) replaceall_matched begin B1B2(MD00,MD01)) end;

This is because is more than 1 like example is 5's BMD0's...?

\s is for space (ASCII 32). You might want to read up on regex.

I'm confused cause I have 5 of SMDA 256-bit and cannot compile without error...
Reading more than 51 pages with posts and counting to see something I do wrong to make it work...
Maybe i stuck...

I attach my patches for Lenovo G50-70

Also, you should read up on hexadecimal (looking at your offset calculations and related patches). It is base-16, valid hex digits 0-9 and A-F.

The existing patches in the repo can serve as examples for what you need to do.
 
\s is for space (ASCII 32). You might want to read up on regex.



Also, you should read up on hexadecimal (looking at your offset calculations and related patches). It is base-16, valid hex digits 0-9 and A-F.

The existing patches in the repo can serve as examples for what you need to do.
Ok i think i fix ..I understand what i made error...
Now NOT ERROR at all but still no battery status (X)
 
Ok i think i fix ..I understand what i made error...
Now NOT ERROR at all but still no battery status (X)

You cannot use RECB as the second param of a Store. The second param indicates a 'write', not 'read'. You must use WECB in that case.
 
[/HTML][/HTML]
You cannot use RECB as the second param of a Store. The second param indicates a 'write', not 'read'. You must use WECB in that case.

into method label WE1B parent_label EC0 remove_entry;
into method label WECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
// Arg2 - value to write\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Store(Arg2, TEMP)\n
Add(Arg0, Arg1, Arg1)\n
Store(0, Local0)\n
While (LLess(Arg0, Arg1))\n
{\n
WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
Increment(Arg0)\n
Increment(Local0)\n
}\n
}\n
end;


into method label MHPF code_regex \sSMDA\) replaceall_matched begin WECB(0x65,256)) end;
into method label CFUN code_regex \sSMDA\) replaceall_matched begin WECB(0x65,256)) end;

Ok I did that, but give errors....
Before that with previous patch without WECB, without other patches give me counting ??!!
But i must do it right ....Now I'm back with errors again...
What is the next, where I make wrong, what did not understand ?
 
Back
Top