Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262597
b: refs/heads/master
c: c4453f6
h: refs/heads/master
i:
  262595: eaf47b3
v: v3
  • Loading branch information
Seth Forshee authored and Matthew Garrett committed Aug 5, 2011
1 parent 08a0612 commit e5a415d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49979d091d1847823c064301da1ec173619ddd92
refs/heads/master: c4453f6a7ceff330ff37a9712ee8305fc3f8e9b6
12 changes: 11 additions & 1 deletion trunk/drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 &&
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/platform/x86/asus-wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <linux/platform_device.h>

#define ASUS_WMI_KEY_IGNORE (-1)

struct module;
struct key_entry;
struct asus_wmi;
Expand All @@ -44,6 +46,10 @@ struct asus_wmi_driver {
const struct key_entry *keymap;
const char *input_name;
const char *input_phys;
/* Returns new code, value, and autorelease values in arguments.
* Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
void (*key_filter) (struct asus_wmi_driver *driver, int *code,
unsigned int *value, bool *autorelease);

int (*probe) (struct platform_device *device);
void (*quirks) (struct asus_wmi_driver *driver);
Expand Down

0 comments on commit e5a415d

Please sign in to comment.