diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2011-07-01 13:34:27 +0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-08-05 22:45:48 +0400 |
commit | c4453f6a7ceff330ff37a9712ee8305fc3f8e9b6 (patch) | |
tree | 6a1564cbff80f8a7df4fa7160cc442ed6d49103a /drivers/platform/x86/asus-wmi.c | |
parent | 49979d091d1847823c064301da1ec173619ddd92 (diff) | |
download | linux-c4453f6a7ceff330ff37a9712ee8305fc3f8e9b6.tar.xz |
asus-wmi: Add callback for hotkey filtering
This is required for the T101MT home key, which behaves differently
than other hotkeys.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index bcb9fb41ddc4..cea9fdcad64c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1061,6 +1061,8 @@ static void asus_wmi_notify(u32 value, void *context) acpi_status status; int code; int orig_code; + unsigned int key_value = 1; + bool autorelease = 1; status = wmi_get_event_data(value, &response); if (status != AE_OK) { @@ -1076,6 +1078,13 @@ static void asus_wmi_notify(u32 value, void *context) code = obj->integer.value; orig_code = code; + if (asus->driver->key_filter) { + asus->driver->key_filter(asus->driver, &code, &key_value, + &autorelease); + if (code == ASUS_WMI_KEY_IGNORE) + goto exit; + } + if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX) code = NOTIFY_BRNUP_MIN; else if (code >= NOTIFY_BRNDOWN_MIN && @@ -1085,7 +1094,8 @@ static void asus_wmi_notify(u32 value, void *context) if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) { if (!acpi_video_backlight_support()) asus_wmi_backlight_notify(asus, orig_code); - } else if (!sparse_keymap_report_event(asus->inputdev, code, 1, true)) + } else if (!sparse_keymap_report_event(asus->inputdev, code, + key_value, autorelease)) pr_info("Unknown key %x pressed\n", code); exit: |