Jump to content

How to Fix Your ACPI Brightness Keys Using Smart Touchpad Driver


shinzon

Recommended Posts

Many laptops use calls to DSDT EC query methods to control brightness. On my system, for example, the brightness keys are Fn+LeftArrow (brightness down), and Fn+RightArrow (brightness up). On my machine, when you press the brightness down key-combo it calls EC method _Q11, and calls _Q12 for brightness up.

The problem is that OS X has no idea what do with the results these methods produce when they are called. A DSDT patch is needed to fix the ACPI controlled brightness keys on a hackintosh.

To make brightness keys function as expected when using EMlyDinEsH's Smart touchpad driver (v4.3+), it is necessary to know which methods get called when the buttons are pressed, and where EMlyDinEsH's driver is connecting to your machine.

Finding out where the driver is connecting is the simplest part. Launch IORegistryExplorer and search for keyboard. You should see something like this:

|
--KBC0
    |
    --ps2controller
            |
            --ApplePS2KeyboardDevice
                    |
                    --ApplePS2Keyboard

As you can see, ApplePS2Keyboard attaches to ApplePS2KeyboardDevice, which attaches to ps2controller, all of which attach to, in my case, KBC0, the device name we are looking for. Another common place for a keyboard to attach is PS2K.

With that out of the way, we now need to figure out which EC methods get called when you press your brightness key combos. For this we need to use RehabMan's ACPIDebug kext, found here:

https://github.com/RehabMan/OS-X-ACPI-Debug

Install the kext, and apply the following DSDT patches:

Debug:
https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/debug.txt

Instrument Qxx:
https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/instrument_Qxx.txt

and reboot.

Now, open Console, and when you press your brightness key combos, the methods they call should be displayed in the log.

In my case, the methods were _Q11 for brightness down, and _Q12 for brightness up.

Now that we have the three required pieces of information, which, in my case, is KBC0 (or PS2K in some systems), _Q11, and _Q12, we can now patch our DSDT at those methods to notify EMlyDinEsH's driver.

First remove the ACPIDebug kext, and also remove the two debug patches you applied earlier using this patch:

https://github.com/RehabMan/OS-X-ACPI-Debug/blob/master/remove.txt

 

. Next, apply this patch, changing _Q11, _Q12, and KBC0 for the values you obtained above:

#Edit methods _Q11 and _Q12 to interface with KBC0 (or PS2K in some systems),
into method label _Q11 replace_content
begin
// Brightness Down\n
Notify (KBC0, 0x20)\n
end;

into method label _Q12 replace_content
begin
// Brightness Up\n
Notify (KBC0, 0x10)\n
end;

Reboot and your brightness keys should now be functional.

Much thanks goes to EMlyDinEsH for taking the time to implement what was necessary to make this work on his side, and to RehabMan for his ACPIDebug kext.

  • Like 4
Link to comment
Share on other sites

Guest etrevis

Thanks for the patch. 

In my system also other buttons aren't working properly, i think that this guide could be used to 'correct' the DSDT in order to get back normal functionality for all buttons once you have the linked method. But i haven't found a table with the hex values I have to notify the kext with (0x20  and 0x10 for brightness up and down in the example).

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...