Jump to content

GUIDE: How to Fix Brightness hotkeys in DSDT / SSDT-hotpatch


soumaxetuirk
 Share

110 posts in this topic

Recommended Posts

Hi!
I'm trying to enable Brightness hotkeys on my laptop (Lenovo E580 (20KS003AXS)). I've already found out what is the EC queries for them (_Q14, _Q15).
At this moment I cannot properly patch DSDT for this keys. I do not have any "PS2K/PS2M" methods in my DSDT.
Original code looks like:

Code:
            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                {
                    \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                }

                If (\VIGD)
                {
                    Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                }
            }

I do not understand how to modify it. I've tried replacing method body with:
1) \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x0406)
2) Notify (\_SB.PCI0.GFX0.DD1F, 0x0406)
, but with no success.

Can someone help me to understand how to complete this?

 

DSDT.dsl

debug_6964.zip

Link to comment
Share on other sites

  • 1 month later...
On 5/15/2019 at 1:26 PM, dandepeched said:

Hi!
I'm trying to enable Brightness hotkeys on my laptop (Lenovo E580 (20KS003AXS)). I've already found out what is the EC queries for them (_Q14, _Q15).
At this moment I cannot properly patch DSDT for this keys. I do not have any "PS2K/PS2M" methods in my DSDT.
Original code looks like:

Code:

            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                {
                    \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                }

                If (\VIGD)
                {
                    Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                }
            }

I do not understand how to modify it. I've tried replacing method body with:
1) \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x0406)
2) Notify (\_SB.PCI0.GFX0.DD1F, 0x0406)
, but with no success.

Can someone help me to understand how to complete this?

 

DSDT.dsl

debug_6964.zip

Try use patches from this repository: https://github.com/olderst/Keyboard-Patches/tree/master/ACPIKeyboard

Link to comment
Share on other sites

Hey. I managed to make the brightness adjustment work through Fn + F2 / F3 keys using the DSDT patch and ACPIKeyboar.kext (although the brightness keys did not appear in the keyboard settings in the keyboard shortcuts, probably the monitor is somehow wrong, but it’s not important).

into method label _Q10 replace_content


begin

// Brightness Down\n

Notify(\_SB.PCI0.LPCB.PS2M, 0x0205)\n

Notify(\_SB.PCI0.LPCB.PS2M, 0x0285)\n

end;

into method label _Q11 replace_content

begin

// Brightness Up\n

Notify(\_SB.PCI0.LPCB.PS2M, 0x0206)\n

Notify(\_SB.PCI0.LPCB.PS2M, 0x0286)\n

end;[/CODE]

 

There was a desire to patch all F keys with similar patches for DSDT in order to hang on them almost all the functions of the original F keys from a Macbook.
 
I think I can recognize which "_Qxx" methods in DSDT are called when I press the F key, but I don’t know which codes 0x02 ???? means the native functions of the F keys in a Macbook. Can anyone tell me this?
 
Also, the DSDT patches from oldrest for my HP laptop also turned on the brightness adjustment on the F keys. Here are the links:

https://github.com/olderst/Keyboard-Patches

https://osxpc.ru/zavod/notebook/backlight-fn/

 

P.S.
I turned on the Fn key in BIOS and in macOS all the F key functions (brightness, sound, media) work together with FN, but pressing F11 without FN works as if I were making a touchpad gesture to display the desktop.
Link to comment
Share on other sites

  • 3 months later...
On 5/15/2019 at 3:56 PM, dandepeched said:

Hi!
I'm trying to enable Brightness hotkeys on my laptop (Lenovo E580 (20KS003AXS)). I've already found out what is the EC queries for them (_Q14, _Q15).
At this moment I cannot properly patch DSDT for this keys. I do not have any "PS2K/PS2M" methods in my DSDT.
Original code looks like:

Code:

            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
            {
                If (\_SB.PCI0.LPCB.EC.HKEY.MHKK (0x01, 0x8000))
                {
                    \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x1010)
                }

                If (\VIGD)
                {
                    Notify (\_SB.PCI0.GFX0.DD1F, 0x86)
                }
            }

I do not understand how to modify it. I've tried replacing method body with:
1) \_SB.PCI0.LPCB.EC.HKEY.MHKQ (0x0406)
2) Notify (\_SB.PCI0.GFX0.DD1F, 0x0406)
, but with no success.

Can someone help me to understand how to complete this?

 

DSDT.dsl

debug_6964.zip

 

 

Your device is present at \_SB.PCI0.LPCB.KBD

 

 

Link to comment
Share on other sites

On 6/20/2019 at 8:16 PM, Drovosek said:
Hey. I managed to make the brightness adjustment work through Fn + F2 / F3 keys using the DSDT patch and ACPIKeyboar.kext (although the brightness keys did not appear in the keyboard settings in the keyboard shortcuts, probably the monitor is somehow wrong, but it’s not important).

 

 

There was a desire to patch all F keys with similar patches for DSDT in order to hang on them almost all the functions of the original F keys from a Macbook.
 
I think I can recognize which "_Qxx" methods in DSDT are called when I press the F key, but I don’t know which codes 0x02 ???? means the native functions of the F keys in a Macbook. Can anyone tell me this?
 
Also, the DSDT patches from oldrest for my HP laptop also turned on the brightness adjustment on the F keys. Here are the links:

https://github.com/olderst/Keyboard-Patches

https://osxpc.ru/zavod/notebook/backlight-fn/

 

P.S.
I turned on the Fn key in BIOS and in macOS all the F key functions (brightness, sound, media) work together with FN, but pressing F11 without FN works as if I were making a touchpad gesture to display the desktop.

 

All functional keys are not always using EC Queries. Sometimes they use PS2 keys. Even combo of PS2 keys  ( As pers windows default shortcut combo win+P, win+L...).

follow the link for custom ADB mappings. 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

HP Envy 13 i7-10510u here.

According to IOREG my keyboard is at KBD0. ACPI Debug shows my brightness keys at Q1D and Q1C (Enter and exit). Monitor brightness in settings is available.

 

Edit, fixed. This is the correct patch:

into method label _Q1D replace_content
begin
// Brightness Down\n
Notify(KBD0, 0x0205)\n
Notify(KBD0, 0x0285)\n
end;
into method label _Q1C replace_content
begin
// Brightness Up\n
Notify(KBD0, 0x0206)\n
Notify(KBD0, 0x0286)\n
end;

 

Any way to improve the smoothness now? When I change the brightness with the keys it just jumps which looks kinda ugly.

Edited by Killuminati91
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 months later...
On 3/14/2015 at 1:09 AM, Allan said:

Yeah! This works for me perfectly.

 

The only change was:

  1. PS2M to PS2K - according to my value found in my DSDT.
  2. The _Q1D/_Q1C to _Q11/_Q12
  3. And i remove the old version of VoodooPS2Controller and install VoodooPS2Controller 1.8.14 version.
  4. Remove AppleACPIPS2Nub too.

 

Repair the disk permissions and rebuild the cache, and tadaaa! My native brightness keys works now like a charm.

 

Thank you very much @RehabMan and @soumaxetuirk  ;)

PS: I will translate this for Portuguese forum! Is awesome  :D

Thank you so much! I been trying for months to fix this and doing what you did fixed it for me. I used Q11 & Q12 as well as changing PS2M TO PS2K.

 

Fixed on HP Envy 15 as133cl

Link to comment
Share on other sites

  • 2 weeks later...

Hey guys,

I have 2 scopes in my DSDT that i could apply the patch too PS2M & PS2K.


Scope (_SB.PCI0.LPCB)
    {
        Device (PS2K)
        {
            Name (_HID, "MSFT0001")  // _HID: Hardware ID
            Name (_CID, EisaId ("PNP0303"))  // _CID: Compatible ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IO (Decode16,
                    0x0060,             // Range Minimum
                    0x0060,             // Range Maximum
                    0x01,               // Alignment
                    0x01,               // Length
                    )
                IO (Decode16,
                    0x0064,             // Range Minimum
                    0x0064,             // Range Maximum
                    0x01,               // Alignment
                    0x01,               // Length
                    )
                IRQ (Edge, ActiveHigh, Exclusive, )
                    {1}
            })
            Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
            {
                StartDependentFn (0x00, 0x00)
                {
                    FixedIO (
                        0x0060,             // Address
                        0x01,               // Length
                        )
                    FixedIO (
                        0x0064,             // Address
                        0x01,               // Length
                        )
                    IRQNoFlags ()
                        {1}
                }
                EndDependentFn ()
            })
        }
    }

    Scope (_SB.PCI0.LPCB)
    {
        Device (PS2M)
        {
            Name (_HID, "SYNA1201")  // _HID: Hardware ID
            Method (_UID, 0, Serialized)  // _UID: Unique ID
            {
                Return (Zero)
            }

            Name (_CID, EisaId ("PNP0F13"))  // _CID: Compatible ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IRQ (Edge, ActiveHigh, Exclusive, )
                    {12}
            })
            Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
            {
                StartDependentFn (0x00, 0x00)
                {
                    IRQNoFlags ()
                        {12}
                }
                EndDependentFn ()
            })
        }
    }

Does anyone know which is the correct one to patch for brightness control?
I know my EC queries relate to Q11 for brightness down and Q12 for up.

I am using ApplePS2SmartTouchPad.kext if that matters?

Also instead of patching my DSDT can i create a hotpatch for brightness controls?

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...