Contribute
Register

How to make keyboard backlight work?

Status
Not open for further replies.
Can you help me?

You have the computer, so you'll need to figure it out on your own... You might try toggling the status in Windows while running RW-Everything and see if you can determine if there is an EC field that controls it.
 
You have the computer, so you'll need to figure it out on your own... You might try toggling the status in Windows while running RW-Everything and see if you can determine if there is an EC field that controls it.

Hello, RehabMan!

I found methods for keyboard backlight control:

Code:
//For brightness up
If (LEqual (Local2, 0x43))
{
    If (LGreaterEqual (ECRD (RefOf (KBDB)), 0x0A))
    {
        \rmdt.p1("EC _Q52 -> 0x43 kbdbDown step")
        Subtract (ECRD (RefOf (KBDB)), 0x0A, Local1)
        ECWT (Local1, RefOf (KBDB))
    }
    Else
    {
        \rmdt.p1("EC _Q52 -> 0x43 kbdbDown full")
        ECWT (Zero, RefOf (KBDB))
    }
    ECMD (0x1B)
}

//For brightness down
If (LEqual (Local2, 0x44))
{
    If (LLessEqual (ECRD (RefOf (KBDB)), 0x5A))
    {
        \rmdt.p1("EC _Q52 -> 0x44 kbdbUp step")
        Add (ECRD (RefOf (KBDB)), 0x0A, Local1)
        ECWT (Local1, RefOf (KBDB))
    }
    Else
    {
        \rmdt.p1("EC _Q52 -> 0x44 kbdbUp full")
        ECWT (0x64, RefOf (KBDB))
    }
    ECMD (0x1B)
}

With ACPI-Debug I see the messages in system.log when I press hotkeys, but keyboard backlight still stay turned off..
Can you please help me to understand what's wrong?
 
Last edited:
Hello, RehabMan!

I found methods for keyboard backlight control:

Code:
//For brightness up
If (LEqual (Local2, 0x43))
{
    If (LGreaterEqual (ECRD (RefOf (KBDB)), 0x0A))
    {
        \rmdt.p1("EC _Q52 -> 0x43 kbdbDown step")
        Subtract (ECRD (RefOf (KBDB)), 0x0A, Local1)
        ECWT (Local1, RefOf (KBDB))
    }
    Else
    {
        \rmdt.p1("EC _Q52 -> 0x43 kbdbDown full")
        ECWT (Zero, RefOf (KBDB))
    }
    ECMD (0x1B)
}

//For brightness down
If (LEqual (Local2, 0x44))
{
    If (LLessEqual (ECRD (RefOf (KBDB)), 0x5A))
    {
        \rmdt.p1("EC _Q52 -> 0x44 kbdbUp step")
        Add (ECRD (RefOf (KBDB)), 0x0A, Local1)
        ECWT (Local1, RefOf (KBDB))
    }
    Else
    {
        \rmdt.p1("EC _Q52 -> 0x44 kbdbUp full")
        ECWT (0x64, RefOf (KBDB))
    }
    ECMD (0x1B)
}

With ACPI-Debug I see the messages in system.log when I press hotkeys, but keyboard backlight still stay turned off..
Can you please help me to understand what's wrong?

What does ECRD/ECWT/ECMD do?
 
What does ECRD/ECWT/ECMD do?
Code:
Method (ECRD, 1, Serialized)
{
    If (LEqual (ECUP, Zero))
    {
        WTGP (0x58, One)
        Sleep (0x10)
    }
    Store (DerefOf (Arg0), Local0)
    Return (Local0)
}

Method (ECWT, 2, Serialized)
{
    If (LEqual (ECUP, Zero))
    {
        WTGP (0x58, One)
        Sleep (0x10)
    }
    Store (Arg0, Arg1)
}

Method (ECMD, 1, Serialized)
{
    While (ECRD (RefOf (CMDR)))
    {
        Stall (0x14)
    }
        ECWT (Arg0, RefOf (CMDR))
        Return (Zero)
}

Method (WTGP, 2, Serialized)
{
    If (LLessEqual (Arg0, 0x5E))
    {
        Store (Add (Add (GPBS, 0x0100), Multiply (Arg0, 0x08)), Local0)
        OperationRegion (LGPI, SystemIO, Local0, 0x04)
        Field (LGPI, AnyAcc, NoLock, Preserve)
        {
                   ,   31, 
            TEMP,   1
        }
        Store (Arg1, TEMP)
    }
}
 
Last edited:
Code:
Method (ECRD, 1, Serialized)
{
    If (LEqual (ECUP, Zero))
    {
        WTGP (0x58, One)
        Sleep (0x10)
    }
    Store (DerefOf (Arg0), Local0)
    Return (Local0)
}

Method (ECWT, 2, Serialized)
{
    If (LEqual (ECUP, Zero))
    {
        WTGP (0x58, One)
        Sleep (0x10)
    }
    Store (Arg0, Arg1)
}

Method (ECMD, 1, Serialized)
{
    While (ECRD (RefOf (CMDR)))
    {
        Stall (0x14)
    }
        ECWT (Arg0, RefOf (CMDR))
        Return (Zero)
}

Method (WTGP, 2, Serialized)
{
    If (LLessEqual (Arg0, 0x5E))
    {
        Store (Add (Add (GPBS, 0x0100), Multiply (Arg0, 0x08)), Local0)
        OperationRegion (LGPI, SystemIO, Local0, 0x04)
        Field (LGPI, AnyAcc, NoLock, Preserve)
        {
                   ,   31, 
            TEMP,   1
        }
        Store (Arg1, TEMP)
    }
}

You'll need to do some debug traces into those methods to see if they execute without a problem...
 
You'll need to do some debug traces into those methods to see if they execute without a problem...

Please tell me where I need to put traces and what to check in those traces?
Now I only see if several times press Fn+F10 to enable backlight:
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp full

And for Fn+F9:
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown full

So, increasing and decreasing works, but something wrong...
 
Please tell me where I need to put traces and what to check in those traces?
Now I only see if several times press Fn+F10 to enable backlight:
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp step
EC _Q52 -> 0x44 kbdbUp full

And for Fn+F9:
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown step
EC _Q52 -> 0x43 kbdbDown full

So, increasing and decreasing works, but something wrong...

You'll have to study the code so you understand how it is supposed to work...

Because of the limited traces you have, you don't even know if the ECRD/etc methods are executing from beginning to end.
 
You'll have to study the code so you understand how it is supposed to work...

Because of the limited traces you have, you don't even know if the ECRD/etc methods are executing from beginning to end.

ECMD run While (ECRD (RefOf (CMDR))) and ECRD stuck on Store (DerefOf (Arg0), Local0)

How to fix this problem?
 
ECMD run While (ECRD (RefOf (CMDR))) and ECRD stuck on Store (DerefOf (Arg0), Local0)

How to fix this problem?

If I understand correctly... (abort in ECRD at Store(DerefOf(Arg0)...) where Arg0 is RefOf(CMDR))...

How is CMDR defined?
 
Status
Not open for further replies.
Back
Top