Contribute
Register

[Guide] How to patch DSDT for working battery status

[/HTML][/HTML]

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 ?

No. Have to replace the entire Store with WECB.

eg.

Store(X, SMDA)

->

WECB(offset-of-SMDA, sizeof-SMDA, X)

There are numerous examples in the existing patches in the laptop repo.
 
Thank you RehabMan,
You help is more than I aspect !!
I continue tomorrow ...
 
Mr RebahMan,
Thank you from my heart :oops: for great guide and hard work and your patience.
I'm pleased to tell you that with your help a make something I think is not possible (for me) to make a patch for working Battery for Lenovo G50-70.
 
Mr RebahMan,
Thank you from my heart :oops: for great guide and hard work and your patience.
I'm pleased to tell you that with your help a make something I think is not possible (for me) to make a patch for working Battery for Lenovo G50-70.

Post native DSDT as well. I'm not adding patches to the repo without the ability to test them...
 
Mr RebahMan,
Thank you from my heart :oops: for great guide and hard work and your patience.
I'm pleased to tell you that with your help a make something I think is not possible (for me) to make a patch for working Battery for Lenovo G50-70.

Your offset for SMDA is wrong:
Code:
                        EXSI,   8, //5d
                        EXSB,   8, //5e
                        EXND,   8, //5f
                        SMPR,   8, //60
                        SMST,   8, //61
                        SMAD,   8, //62
                        SMCM,   8, //63
                        SMDA,   256, //!!64

In your own count, you skipped 0x5f.
Code:
#                        Offset (0x5D), 
#                        EXSI,   8, //(0x5d)
#                        EXSB,   8, //(0x5e)
#                        EXND,   8, //(0x60) //!! oops... wrong
#                        SMPR,   8, //(0x61)
#                        SMST,   8, //(0x62)
#                        SMAD,   8, //(0x63)
#                        SMCM,   8, //(0x64)
#                        SMDA,256,//!!(0x65)
 
Your offset for SMDA is wrong:
Code:
                        EXSI,   8, //5d
                        EXSB,   8, //5e
                        EXND,   8, //5f
                        SMPR,   8, //60
                        SMST,   8, //61
                        SMAD,   8, //62
                        SMCM,   8, //63
                        SMDA,   256, //!!64

In your own count, you skipped 0x5f.
Code:
#                        Offset (0x5D), 
#                        EXSI,   8, //(0x5d)
#                        EXSB,   8, //(0x5e)
#                        EXND,   8, //(0x60) //!! oops... wrong
#                        SMPR,   8, //(0x61)
#                        SMST,   8, //(0x62)
#                        SMAD,   8, //(0x63)
#                        SMCM,   8, //(0x64)
#                        SMDA,256,//!!(0x65)
Oupssssss...i fix it AGAIN!!
 
Back
Top