Contribute
Register

[Guide] Patching DSDT/SSDT for LAPTOP backlight control

You should read the guide carefully and make sure you understand conceptually and the specific examples given in the guide.
Then refer to other guides that already do it (eg. all of my guides, refer to github content).

If you're not up for it technically, then do static patch.
I found the brightness example and it shouldn't be too hard. But then my own DSDT does not look like yours at all.

This is the patch I want to apply through hot-patch:
Code:
into method label _Q1C replace_content
begin
// Brightness Down\n
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0405)\n
end;
into method label _Q1D replace_content
begin
// Brightness Up\n
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0406)\n
end;

I want to make
Code:
Scope (_SB.PCI0.LPCB.EC0)
    {
        Name (ACIO, Zero)
        Name (DCIO, Zero)
        Method (_Q1C, 0, NotSerialized)  // _Qxx: EC Query
        {
            Store (0x1C, P80H)
            Store (And (SWBL, One), Local0)
            If (LEqual (Local0, Zero))
            {
                Store (Or (SWBL, One), Local1)
                Store (Local1, SWBL)
            }
            Else
            {
                Acquire (MSGF, 0xFFFF)
                BRTN (0x86)
                Release (MSGF)
            }

            If (LEqual (OSYS, 0x07D9))
            {
                Sleep (0x64)
                Or (VP1D, 0x10, VP1D)
                Notify (VPC0, 0x80)
            }
        }
into
Code:
Scope (_SB.PCI0.LPCB.EC0)
    {
        Name (ACIO, Zero)
        Name (DCIO, Zero)
        Method (_Q1C, 0, NotSerialized)  // _Qxx: EC Query
        {
        
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0405)\
        }

And same for other key.. but the guide does not state how? Is it even possible? I am replacing code, chunks of it from what I can see, not renaming.
 
I found the brightness example and it shouldn't be too hard. But then my own DSDT does not look like yours at all.

This is the patch I want to apply through hot-patch:
Code:
into method label _Q1C replace_content
begin
// Brightness Down\n
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0405)\n
end;
into method label _Q1D replace_content
begin
// Brightness Up\n
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0406)\n
end;

I want to make
Code:
Scope (_SB.PCI0.LPCB.EC0)
    {
        Name (ACIO, Zero)
        Name (DCIO, Zero)
        Method (_Q1C, 0, NotSerialized)  // _Qxx: EC Query
        {
            Store (0x1C, P80H)
            Store (And (SWBL, One), Local0)
            If (LEqual (Local0, Zero))
            {
                Store (Or (SWBL, One), Local1)
                Store (Local1, SWBL)
            }
            Else
            {
                Acquire (MSGF, 0xFFFF)
                BRTN (0x86)
                Release (MSGF)
            }

            If (LEqual (OSYS, 0x07D9))
            {
                Sleep (0x64)
                Or (VP1D, 0x10, VP1D)
                Notify (VPC0, 0x80)
            }
        }
into
Code:
Scope (_SB.PCI0.LPCB.EC0)
    {
        Name (ACIO, Zero)
        Name (DCIO, Zero)
        Method (_Q1C, 0, NotSerialized)  // _Qxx: EC Query
        {
       
    Notify(\_SB.PCI0.LPCB.KBD0, 0x0405)\
        }

And same for other key.. but the guide does not state how? Is it even possible? I am replacing code, chunks of it from what I can see, not renaming.

Use the "rename/replace" pattern:
- config.plist/ACPI/DSDT/Patches to rename _Q1C/_Q1D to XQ1C/XQ1D, respectively
- add SSDT with replacement _Q1C/_Q1D code
 
Use the "rename/replace" pattern:
- config.plist/ACPI/DSDT/Patches to rename _Q1C/_Q1D to XQ1C/XQ1D, respectively
- add SSDT with replacement _Q1C/_Q1D code
I had the .dsl in front of me and seemed so much easier to just apply a static patch so I did. Working fine. Thanks anyway!
 
I had the .dsl in front of me and seemed so much easier to just apply a static patch so I did. Working fine. Thanks anyway!

Yes. Static patch is easier to implement and understand.

But hotpatch pays dividends later.
 
Hi Rehabman,
I tried to generate my Hack's Fn key to control backlight, i had did step by step, then when i open console, error mess below.
can you tell me something a bout this error?
 

Attachments

  • Screen Shot 2017-09-30 at 8.21.23 AM.png
    Screen Shot 2017-09-30 at 8.21.23 AM.png
    130.1 KB · Views: 129
Hi @RehabMan
Thanks for this post.
I apologize if my question is already answered, but i haven't found the answer to it.

My config is as mentionned in signature.

I upgraded to version 10.12.6 (16G29) and i have a trouble when i switch on my laptop after switching it off.

The backlight can't be restored because of the keys(F10 on my HP 8470P), that handles brigthness and volume at the same time.

It seems that volume is now controlled by F6 and F7.

How to fix that properly ?

Do i have to follow your whole tutorial ?

Thanks so much for all your work !
 
Hi @RehabMan
Thanks for this post.
I apologize if my question is already answered, but i haven't found the answer to it.

My config is as mentionned in signature.

I upgraded to version 10.12.6 (16G29) and i have a trouble when i switch on my laptop after switching it off.

The backlight can't be restored because of the keys(F10 on my HP 8470P), that handles brigthness and volume at the same time.

It seems that volume is now controlled by F6 and F7.

How to fix that properly ?

Do i have to follow your whole tutorial ?

Thanks so much for all your work !

Your laptop has a guide:

https://www.tonymacx86.com/threads/...book-zbook-using-clover-uefi-hotpatch.232949/
 
Back
Top