WMI-based hotkeys on not working

displaykey mappinglaptop

On my Dell latitude e6540, the WMI hotkeys Fn+Up and Fn+Down are not working. I have all necesary modules compiled in my kernel:

CONFIG_DELL_LAPTOP=m
CONFIG_DELL_WMI=m
CONFIG_DELL_WMI_AIO=m

On the predecessor model (Latitude e6520), all worked fine, without any need for additional setup. I am using the same (custom build) kernel 3.16.6 on both laptops. On e6520 wmi works, on e6540 it doesn't.

I can still change the brightness with echo:

echo 35 > /sys/class/backlight/acpi_video0/brightness

but only as root, obviously.

Pressing Fn+Up and Fn+Down does not change the walue in /sys/class/backlight/acpi_video0/brightness. On the previous model, it does change the value.

One thing I noticed, on the older model, the max value is 15. On the new model it is 95. Looks like something might have changed inside this mechanism.

Thus my question:
How can I make WMI hotkeys work on my new laptop?

I am using Debian wheezy with custom kernel 3.16.6. I have also tried distribution kernel 3.16 (linux-image-3.16-0.bpo.2-amd64 from Wheezy-backports) and the wmi keys don't work either.

UPDATE:

I have just noticed that the WMI hotkeys work fine when I am in BIOS !!!
That is quite surprising that they don't work when I boot into linux.

following is output of dmesg. The mention of dell_wmi: Received unknown WMI event looks relevant to my problem, but I get the same messages on the old laptop, where wmi hotkeys are working. So this alone does not seeem the be the issue.

dmesg | egrep -i '(dell|wmi)'
[Tue Apr 15 22:04:30 2014] DMI: Dell Inc. Latitude E6540/05V0V4, BIOS A05 09/03/2013
[Tue Apr 15 22:04:30 2014] ACPI: RSDP 00000000000eee60 00024 (v02 DELL  )
[Tue Apr 15 22:04:30 2014] ACPI: XSDT 00000000d8fe0080 0007C (v01 DELL    CBX3    01072009 AMI  00010013)
[Tue Apr 15 22:04:30 2014] ACPI: FACP 00000000d8fed7e8 0010C (v05 DELL    CBX3    01072009 AMI  00010013)
[Tue Apr 15 22:04:30 2014] ACPI: DSDT 00000000d8fe0188 0D659 (v02 DELL    CBX3    00000014 INTL 20091112)
[Tue Apr 15 22:04:30 2014] ACPI: APIC 00000000d8fed8f8 00072 (v03 DELL    CBX3    01072009 AMI  00010013)
[Tue Apr 15 22:04:30 2014] ACPI: FPDT 00000000d8fed970 00044 (v01 DELL    CBX3    01072009 AMI  00010013)
[Tue Apr 15 22:04:30 2014] ACPI: HPET 00000000d8feed38 00038 (v01 DELL    CBX3    01072009 AMI. 00000005)
[Tue Apr 15 22:04:30 2014] ACPI: MCFG 00000000d8fef148 0003C (v01 DELL    CBX3    01072009 MSFT 00000097)
[Tue Apr 15 22:04:38 2014] dcdbas dcdbas: Dell Systems Management Base Driver (version 5.6.0-3.2)
[Tue Apr 15 22:04:39 2014] wmi: Mapper loaded
[Tue Apr 15 22:04:39 2014] input: Dell WMI hotkeys as /devices/virtual/input/input10
[Wed Apr 16 18:30:04 2014] dell_wmi: Received unknown WMI event (0x0)
[Fri Apr 18 17:09:41 2014] dell_wmi: Received unknown WMI event (0x0)
[Fri Apr 18 17:09:41 2014] dell_wmi: Received unknown WMI event (0x0)
[Fri Apr 18 17:09:49 2014] dell_wmi: Received unknown WMI event (0x0)

UPDATE2

after patching the WMI module, I get following messages for Fn+Up and Fn+Down

2014-04-18 19:00:49  kernel: [  120.731480] dell_wmi: WMBU = 0002 0010 0048
2014-04-18 19:00:49  kernel: [  120.731496] wmi: DEBUG Event GUID: 9DBB5994-A997-11DA-B012-B622A1EF5492

2014-04-18 19:00:53  kernel: [  123.935400] dell_wmi: WMBU = 0002 0010 0050
2014-04-18 19:00:53  kernel: [  123.935415] wmi: DEBUG Event GUID: 9DBB5994-A997-11DA-B012-B622A1EF5492

UPDATE3

Also interesting is, that the laptop came with pre-installed Ubuntu 12.04, and the wmi keys are working in Ubuntu.

Best Answer

You could install xbacklight, a utility for managing your brightness using RandR. Then, to activate it, use a simple script along these lines—bound to your two keys:

#!/usr/bin/env bash
up() {
    xbacklight -inc 10
}

down() {
    xbacklight -dec 10
}

notify() {
    bright=$(</sys/class/backlight/acpi_video0/actual_brightness)
    if [[ "$bright" -eq 95 ]]; then
        score="100%"
    else score="$(( $bright * 100 / 95 ))"
    fi
    printf '%s\n' "Backlight set to ${score}%" | dzen2 -p 3
}

if [[ $1 = up ]]; then
    up && notify
elif [[ $1 = down ]]; then
    down && notify
fi

Swap out your notification method for whatever you use as part of your normal setup, eg., notify-send.

Related Question