Contribute
Register

[Guide] Patching DSDT/SSDT for LAPTOP backlight control

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Use Rehabman's driver on my Dell laptop, without any modification for brightness keys mapping, I have Fn + F6 triggering brightness down. Any other Fx key, or Fn + Fx key combination doesn't trigger brightness up.
How can I map the keys to have brightness-up to work.
Following are related log shown when key pressed.

Code:
F1:
2019-01-19 14:56:14.851269+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3b=7a down
2019-01-19 14:56:14.851296+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=6dd2b0ea, cmp=e0028010
2019-01-19 14:56:14.851311+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=6dd2b0ea, cmp=e0028010

2019-01-19 14:56:14.934185+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3b=7a up
2019-01-19 14:56:14.934213+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=72c47c3d, cmp=e0028010
2019-01-19 14:56:14.934227+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=72c47c3d, cmp=e0028010


Fn + F1
2019-01-19 13:06:01.974751+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e020=4a down
2019-01-19 13:06:01.974778+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=fb5f2c2e, cmp=e0028010
2019-01-19 13:06:01.974793+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=fb5f2c2e, cmp=e0028010

2019-01-19 13:06:02.047951+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e020=4a up
2019-01-19 13:06:02.047970+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=ffbc3015, cmp=e0028010
2019-01-19 13:06:02.047980+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=ffbc3015, cmp=e0028010


==================================================================================================================================================
F2:
2019-01-19 12:48:34.038117+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3c=78 down
2019-01-19 12:48:34.038143+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=fd9cbe9a, cmp=e0028010
2019-01-19 12:48:34.038158+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=fd9cbe9a, cmp=e0028010

2019-01-19 12:48:34.086529+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3c=78 up
2019-01-19 12:48:34.086548+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=7f8744, cmp=e0028010
2019-01-19 12:48:34.086557+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=7f8744, cmp=e0028010


Fn + F2
2019-01-19 12:49:33.520831+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e02e=49 down
2019-01-19 12:49:33.520858+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=d70cd512, cmp=e0028010
2019-01-19 12:49:33.520871+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=d70cd512, cmp=e0028010

2019-01-19 12:49:33.577019+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e02e=49 up
2019-01-19 12:49:33.577032+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=da665a3e, cmp=e0028010
2019-01-19 12:49:33.577038+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=da665a3e, cmp=e0028010



==================================================================================================================================================
F3:
2019-01-19 12:53:17.634976+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3d=63 down
2019-01-19 12:53:17.634993+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=5436e07, cmp=e0028010
2019-01-19 12:53:17.635003+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=5436e07, cmp=e0028010

2019-01-19 12:53:17.676751+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3d=63 up
2019-01-19 12:53:17.676776+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=7c09d8c, cmp=e0028010
2019-01-19 12:53:17.676790+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=7c09d8c, cmp=e0028010


Fn + F3
2019-01-19 12:54:49.780372+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e030=48 down
2019-01-19 12:54:49.780397+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=798b10e2, cmp=e0028010
2019-01-19 12:54:49.780411+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=798b10e2, cmp=e0028010

2019-01-19 12:54:49.838554+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key e030=48 up
2019-01-19 12:54:49.838574+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=7d031d20, cmp=e0028010
2019-01-19 12:54:49.838583+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=7d031d20, cmp=e0028010



==================================================================================================================================================
F4:
2019-01-19 13:00:17.042165+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3e=76 down
2019-01-19 13:00:17.042181+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=abd279c3, cmp=e0028010
2019-01-19 13:00:17.042187+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=abd279c3, cmp=e0028010

2019-01-19 13:00:17.106474+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 3e=76 up
2019-01-19 13:00:17.106491+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=afa791b0, cmp=e0028010
2019-01-19 13:00:17.106499+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=afa791b0, cmp=e0028010

Fn + F4:
No log



==================================================================================================================================================
F6:
2019-01-19 13:02:47.485773+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 40=61 down
2019-01-19 13:02:47.485798+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=b2f37dc7, cmp=e0028010
2019-01-19 13:02:47.485813+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=b2f37dc7, cmp=e0028010

2019-01-19 13:02:47.555998+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 40=61 up
2019-01-19 13:02:47.556023+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=b7230992, cmp=e0028010
2019-01-19 13:02:47.556038+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=b7230992, cmp=e0028010



Fn + F6             
(*** This trigger brightness down)
2019-01-19 13:01:54.976447+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 46=6b down
2019-01-19 13:01:54.976475+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=79288ce3, cmp=e0028010
2019-01-19 13:01:54.976489+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=79288ce3, cmp=e0028010

2019-01-19 13:01:55.035726+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 46=6b up
2019-01-19 13:01:55.035750+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=7cb0e7f0, cmp=e0028010
2019-01-19 13:01:55.035765+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=7cb0e7f0, cmp=e0028010




==================================================================================================================================================
F11:
2019-01-19 13:57:25.475046+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 57=67 down
2019-01-19 13:57:25.475073+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=e9ef848d, cmp=e0028010
2019-01-19 13:57:25.475087+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=e9ef848d, cmp=e0028010

2019-01-19 13:57:25.539327+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 57=67 up
2019-01-19 13:57:25.539359+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=edc3f07d, cmp=e0028010
2019-01-19 13:57:25.539380+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=edc3f07d, cmp=e0028010


Fn + F11:
No log




==================================================================================================================================================
F12:
2019-01-19 13:57:22.835021+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 58=6f down
2019-01-19 13:57:22.835048+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=4c93dc1f, cmp=e0028010
2019-01-19 13:57:22.835067+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=4c93dc1f, cmp=e0028010

2019-01-19 13:57:22.926774+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard: sending key 58=6f up
2019-01-19 13:57:22.926801+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff8066, provider=<private>, argument=<private>, argument=520c0988, cmp=e0028010
2019-01-19 13:57:22.926816+0000 0x104      Default     0x0                  0      0    kernel: (kernel) ApplePS2Keyboard::message: type=e3ff806e, provider=<private>, argument=<private>, argument=520c0988, cmp=e0028010


Fn + F12:
No log
Your keys are likely handled in ACPI.
Read post #1 carefully.
 
Joined
Apr 22, 2018
Messages
17
Motherboard
Dell Inspiron 5566 0YRTVV - Clover
CPU
i3-7100U
Graphics
HD620 / 1366 x 768
Hello, im trying to fix my Brightness Keys since those are mapped to FN+S and FN+B. I did the debug thing and i get two things in console. One if after pressing the key and another one is after holding down they key. But i cant find anything in my DSDT that matches what im looking at my console log.
Right now everything is working fine, except that.
Please i could use some help.
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hello, im trying to fix my Brightness Keys since those are mapped to FN+S and FN+B. I did the debug thing and i get two things in console. One if after pressing the key and another one is after holding down they key. But i cant find anything in my DSDT that matches what im looking at my console log.
Right now everything is working fine, except that.
Please i could use some help.
Read post #1 regarding BRT6.
 
Joined
Mar 12, 2019
Messages
3
Motherboard
Dell Studio 1747 laptop
CPU
i7-720QM
Graphics
HD 4650
hello @RehabMan,
I have tweaked your graphics_PNLF-ACPI100 patch to work with a dell studio 1747 with a radeon hd 4650

It works without adding any kexts

I really don't know if it is the preferred way to do it but it works
I inserted the PLNF device under the LCD device
and, as I could not understand ,what the relative path to _BQC and other methods was, I wrote the absolute path
e.g . Return(\_SB.PCI0.P0P2.M86.LCD._BQC())

I attach the patch so you can add it to your repo if you like


P.S. you have to run the patch "rename gfx0 to igpu" for this to work

thanks for all the beautiful work

eric
 

Attachments

Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
hello @RehabMan,
I have tweaked your graphics_PNLF-ACPI100 patch to work with a dell studio 1747 with a radeon hd 4650

It works without adding any kexts

I really don't know if it is the preferred way to do it but it works
I inserted the PLNF device under the LCD device
and, as I could not understand ,what the relative path to _BQC and other methods was, I wrote the absolute path
e.g . Return(\_SB.PCI0.P0P2.M86.LCD._BQC())

I attach the patch so you can add it to your repo if you like


P.S. you have to run the patch "rename gfx0 to igpu" for this to work

thanks for all the beautiful work

eric
macOS will not natively use the ACPI methods for brightness (_BQC, _BCM, etc).
So no need to add them at all if you're using native brightness capability.
 
Joined
Mar 5, 2019
Messages
76
Motherboard
Dell Inspiron 15 7580
CPU
i5-8265u
Graphics
UHD 620
Mobile Phone
iOS
macOS will not natively use the ACPI methods for brightness (_BQC, _BCM, etc).
So no need to add them at all if you're using native brightness capability.
Hello @RehabMan
When I use the SSDT-PNLF.aml.
Although it look like black-screen, it can get into system.My screen will always like normal but get dark soon so make it look likes black-screen. Actually I can't control it, without a Flashlight lol.
I want to let you watch the video that what I'm talking about but can't upload here.

It is because I want my HDMI audio output get work at the begging, but there maybe have a problem and I go to ask and check what the problem is.
First I find that in the IOREG don't have AppleBacklightDisplay under the AppleDisplay and this is the laptop internal screen.
395807


but when I change my ACPI DSDT fixes addPNLF on, the AppleBacklightDisplay will appear.
395809


And When I follow the guide that you posted how to enable the HDMI audio,
I find that when I connected my HDMI monitor for AppleIntelFramebuffer@1 connector-type still is 00 04 00 00 , not 00 08 00 00 as you said.(the first img)

Also in the Hackintools if I don't turn on the addPNLF, in the display my laptop monitor will never get internal on when open the tools, but if I use the addPNLF on, I have check that the internal will get tick when open the tools.
395810

but if I use addPNLF my screen will get very very dark and hard to use,
so I follow the guide that you post, SSDT-PNLF and Applebacklightfix to fix my problem, but it will make my first problem appear.
 
Last edited:
Joined
Apr 6, 2019
Messages
1
Motherboard
Mobile Intel HM65 Express
CPU
Intel Core I7 2630 QM 2.0GHz
Graphics
Nvidia GeForce GTX 460M 1.5 GB
I have succesfull installed macOS Sierra 10.12.6 to my Asus G73SW laptop. I've got a lot of working except the brightness control with my FN keys.

First I've patched my DSDT with the "Brightness fix" to enable the brightness slider in sys preference. After the patch the slider appears but the brightness went down (no problem at all). Than I wanted to control the brightness with the FN keys (FN + F5 brightness down and FN + F6 brightness up).

First I found out that the FN + F5 button = Q0E
and that the FN + F6 button = Q0F
and I found out that I need to use "SBRG" instead of "LPCB"

So I tried to patch my DSDT with this code:
Code:
into method label _Q0E replace_content
begin
// Brightness Down\n
    Notify(\_SB.PCI0.SBRG.PS2K, 0x0405)\n
end;
into method label _Q0F replace_content
begin
// Brightness Up\n
    Notify(\_SB.PCI0.SBRG.PS2K, 0x0406)\n
end;
Compiled and placed in /EFI/ACPI/Patched, reboot. No luck can't control the brightness with the FN + Keys
 
Joined
Aug 25, 2015
Messages
221
Motherboard
DELL Inspiron 7370
CPU
i7-8550U
Graphics
UHD620
Mac
iMac, MacBook Air
Mobile Phone
Android, iOS
Hi Rehabman,

Is there a chart for adb codes for its function? Also, it's interesting that adb 131 is not working for me to go into launchpad.
 
Joined
Apr 24, 2019
Messages
35
Motherboard
Lenovo E580 (20KS003AXS)
CPU
i5-8250U
Graphics
UHD620, RX 550
Hi!
I'm trying to enable Brightness hotkeys on my laptop. 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.
Original one 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.

Please help to understand how to complete this?
 

Attachments

Last edited:
Joined
Dec 11, 2013
Messages
27
Motherboard
Alienware R3 13 Signature Edition
CPU
i7-7700HQ
Graphics
Intel HD 630 + GTX 1060
Hello @RehabMan, I'd hate to bother you not sure if you're active in the hackintosh community or not. I am having issues getting my hackintosh laptop to work properly. I was going to see if you could give me a hand with it?
 
Top