Contribute
Register

[Fix] ACPI Brightness Keys using Smart Touchpad Driver

Joined
Oct 22, 2013
Messages
212
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). 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+), you first need some information: which methods get called when the brightness 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:
Code:
|
--[B]KBC0[/B]
    |
    --ps2controller
            |
            --ApplePS2KeyboardDevice
                    |
                    --ApplePS2Keyboard
As you can see, ApplePS2Keyboard attaches to ApplePS2KeyboardDevice, which attaches to ps2controller, all of which attach to, on my machine, 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 system 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 for me are:

KBC0, the device to which the keyboard attaches,
_Q11, the method called when the brightnes down button is pressed, and
_Q12, the method called when the brightnes up button is pressed,

we can now patch our DSDT at those methods to notify EMlyDinEsH's driver on key press.

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:

Code:
#Edit methods _Q11 and _Q12 to interface with KBC0
into method label [B]_Q11[/B] replace_content
begin
// Brightness Down\n
Notify ([B]KBC0[/B], 0x20)\n
end;

into method label [B]_Q12[/B] replace_content
begin
// Brightness Up\n
Notify ([B]KBC0[/B], 0x10)\n
end
Replacing KBC0 in the lines

Code:
Notify ([B]KBC0[/B], 0x10)
with the name of your device, and replacing _Q11 & _Q12 in the lines

Code:
into method label [B]_Q11[/B] replace_content
into method label [B]_Q12[/B] replace_content
with the name of your methods for brightness up, and for brightness down respectively.

Reboot, and your brightness keys should now be functional. Do note that by default the Smart Touchpad driver has FinerFNBrightnessControl enabled in its configuration plist. This breaks the brightness scale into 64 steps, instead of the normal 16 that OSX uses. To configure the keyboard driver, reference this thread: http://forum.osxlatitude.com/index.php?/topic/5969-details-about-the-enhanced-keyboard-for-smart-touchpad-driver/

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.
 
Joined
May 21, 2016
Messages
23
Motherboard
Acer Aspire E1-471G
CPU
i5-3230M
Graphics
HD4000, GeForce 710M
Mobile Phone
Android
Thank a lot:clap:, I'm looking for this for a long time since i notice SmartTouchpad.
I almost give up SmartTouchpad cuz ACPI brightness Key wouldn't work.

And using 16 level brightness/Volume needs to turn off FinerFNBrightnessControl/FinerFnVolumeControl, I wasn't notice that in the first time read it.

And did you know the correct notify value of MediaPlayPause/MediaPrevious/MediaNext or Mission_Control ?
 
Joined
May 21, 2016
Messages
23
Motherboard
Acer Aspire E1-471G
CPU
i5-3230M
Graphics
HD4000, GeForce 710M
Mobile Phone
Android
O,Thanks! I already know that, but that's for Voodoo-PS2-Controller, SmartTouchpad aren't compatible.
When I using Voodoo-PS2-Controller, it couldn't get multi-touch supported or I don't know how. So I was trying to turn to SmartTouchpad, which gets multi-touch supported. Until saw this, I never did cuz SmartTouchpad notify different value then Voodoo-PS2-Controller.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,063
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
O,Thanks! I already know that, but that's for Voodoo-PS2-Controller, SmartTouchpad aren't compatible.
You should read it carefully. It actually has instructions for both.
 
Joined
Feb 4, 2013
Messages
10
Motherboard
Gigabyte GA-G41MT-S2PT
CPU
Q9650
Graphics
GT 220
Mac
iMac
it's working, Fn+LeftArrow (brightness down), and Fn+RightArrow (brightness up).
but still occur, when i press FN button only, it make brightness up only.
how to turn off/disable FN button only behaviour???
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,063
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Joined
Feb 4, 2013
Messages
10
Motherboard
Gigabyte GA-G41MT-S2PT
CPU
Q9650
Graphics
GT 220
Mac
iMac
Problem report:

how to disable
1. RightShift+Up/Down Arrow = Mute/UnMute
2. RightShift+Right/Left Arrow = Mute/UnMute
3. FN keys (only) = BrightnessUP (icon popup)

how to enable:
FN+UpArrow = AudioVolume UP
FN+DownArrow = AudioVolume DOWN

litte bit off topic beside above problem,
any advice//suggestion amongs my setup would be appreciated
eg.
- DSDT patch
- kexts
- is my USB port ok?
- clover configuration
- anything for fast boot

Thanks in advance.....
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,063
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Problem report:

how to disable
1. RightShift+Up/Down Arrow = Mute/UnMute
2. RightShift+Right/Left Arrow = Mute/UnMute
You need to analyze key logs in the kernel log to determine what PS2 codes these keys are generating.

3. FN keys (only) = BrightnessUP (icon popup)
What do you mean by "FN keys (only)"?

how to enable:
FN+UpArrow = AudioVolume UP
FN+DownArrow = AudioVolume DOWN
Again, are these your standard volume controls? (in Windows?).
If not, you would need to determine what codes they generate (if they generate anything).
You should really consider why you're not using the standard PS2 codes for volume though.

litte bit off topic beside above problem,
any advice//suggestion amongs my setup would be appreciated
eg.
- DSDT patch
- kexts
- is my USB port ok?
- clover configuration
- anything for fast boot

Thanks in advance.....
Your responsibility to test your laptop to identify any problems.
 
Top