Code Monkey home page Code Monkey logo

Comments (2)

the-eric-kwok avatar the-eric-kwok commented on May 19, 2024

It seems that battery percentage cannot update after booted up.

from laptop-dsdt-patch.

the-eric-kwok avatar the-eric-kwok commented on May 19, 2024
#Maintained by: RehabMan for: Laptop Patches
#battery_HP-Pavilion-bc015tx.txt

# Modified from battery_HP-Pavilion-n012tx.txt by rockvignesh25
# 2020-2-17 modified by the-eric-kwok

# Works for:
HP-Pavilion-bc015tx

# Split BADC -> ADC0, ADC1
into device label EC0 code_regex BADC,\s+16, replace_matched begin ADC0,8,ADC1,8, end;

# Split BFCC -> FCC0, FCC1
into device label EC0 code_regex BFCC,\s+16, replace_matched begin FCC0,8,FCC1,8, end;
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.FCC0,\^\^PCI0\.LPCB\.EC0\.FCC1), end;


# Split MCUR -> CUR0, CUR1
into device label EC0 code_regex MCUR,\s+16, replace_matched begin CUR0,8,CUR1,8, end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.CUR0,\^\^PCI0\.LPCB\.EC0\.CUR1), end;

# Split MBRM -> BRM0, BRM1
into device label EC0 code_regex MBRM,\s+16, replace_matched begin BRM0,8,BRM1,8, end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BRM0,\^\^PCI0\.LPCB\.EC0\.BRM1), end;
into method label CLRI code_regex \(\^\^LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^LPCB\.EC0\.BRM0,\^\^LPCB\.EC0\.BRM1), end;

# Split MBCV -> BCV0, BCV1
into device label EC0 code_regex MBCV,\s+16, replace_matched begin BCV0,8,BCV1,8, end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCV, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BCV0,\^\^PCI0\.LPCB\.EC0\.BCV1), end;


into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end;


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

# Method to write/read buffers to/from EC0
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 SMWR code_regex Store\s?\(Arg3,\s?\SMD0\) replaceall_matched begin WECB(0x04,256,Arg3) end;

this is my battery patch

from laptop-dsdt-patch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.