diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2011-07-01 05:34:28 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-08-05 14:45:50 -0400 |
commit | 6ae8b807371ba8d5b42648721c528582295136f7 (patch) | |
tree | 5a5c9ee80a5f7d97f8db6745e8dbc3ec91b18b8c | |
parent | c4453f6a7ceff330ff37a9712ee8305fc3f8e9b6 (diff) |
eeepc-wmi: Add support for T101MT Home/Express Gate key
This key is different than other hotkeys, having seperate scan
codes for press, release, and hold, so it requires some special
filtering. Press and release events are passed on, and hold events
are ignored since sparse-keymap does not support hardware
autorepeat.
Note that "Home" in the context of this button doesn't mean the
same thing as the usual Home key, and it really isn't clear at
all what is meant by "Home". The manufacurer's description of the
button indicates that it should launch some sort of touch screen
settings interface on short press and apply a desktop rotation on
long press.
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>
-rw-r--r-- | drivers/platform/x86/eeepc-wmi.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 4aa867a9b88b..f41a977efa94 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
@@ -56,6 +56,11 @@ MODULE_PARM_DESC(hotplug_wireless, | |||
56 | "If your laptop needs that, please report to " | 56 | "If your laptop needs that, please report to " |
57 | "acpi4asus-user@lists.sourceforge.net."); | 57 | "acpi4asus-user@lists.sourceforge.net."); |
58 | 58 | ||
59 | /* Values for T101MT "Home" key */ | ||
60 | #define HOME_PRESS 0xe4 | ||
61 | #define HOME_HOLD 0xea | ||
62 | #define HOME_RELEASE 0xe5 | ||
63 | |||
59 | static const struct key_entry eeepc_wmi_keymap[] = { | 64 | static const struct key_entry eeepc_wmi_keymap[] = { |
60 | /* Sleep already handled via generic ACPI code */ | 65 | /* Sleep already handled via generic ACPI code */ |
61 | { KE_KEY, 0x30, { KEY_VOLUMEUP } }, | 66 | { KE_KEY, 0x30, { KEY_VOLUMEUP } }, |
@@ -71,6 +76,7 @@ static const struct key_entry eeepc_wmi_keymap[] = { | |||
71 | { KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } }, | 76 | { KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } }, |
72 | { KE_KEY, 0xe0, { KEY_PROG1 } }, /* Task Manager */ | 77 | { KE_KEY, 0xe0, { KEY_PROG1 } }, /* Task Manager */ |
73 | { KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */ | 78 | { KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */ |
79 | { KE_KEY, HOME_PRESS, { KEY_CONFIG } }, /* Home/Express gate key */ | ||
74 | { KE_KEY, 0xe8, { KEY_SCREENLOCK } }, | 80 | { KE_KEY, 0xe8, { KEY_SCREENLOCK } }, |
75 | { KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } }, | 81 | { KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } }, |
76 | { KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } }, | 82 | { KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } }, |
@@ -81,6 +87,25 @@ static const struct key_entry eeepc_wmi_keymap[] = { | |||
81 | { KE_END, 0}, | 87 | { KE_END, 0}, |
82 | }; | 88 | }; |
83 | 89 | ||
90 | static void eeepc_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code, | ||
91 | unsigned int *value, bool *autorelease) | ||
92 | { | ||
93 | switch (*code) { | ||
94 | case HOME_PRESS: | ||
95 | *value = 1; | ||
96 | *autorelease = 0; | ||
97 | break; | ||
98 | case HOME_HOLD: | ||
99 | *code = ASUS_WMI_KEY_IGNORE; | ||
100 | break; | ||
101 | case HOME_RELEASE: | ||
102 | *code = HOME_PRESS; | ||
103 | *value = 0; | ||
104 | *autorelease = 0; | ||
105 | break; | ||
106 | } | ||
107 | } | ||
108 | |||
84 | static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level, | 109 | static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level, |
85 | void *context, void **retval) | 110 | void *context, void **retval) |
86 | { | 111 | { |
@@ -151,6 +176,7 @@ static struct asus_wmi_driver asus_wmi_driver = { | |||
151 | .keymap = eeepc_wmi_keymap, | 176 | .keymap = eeepc_wmi_keymap, |
152 | .input_name = "Eee PC WMI hotkeys", | 177 | .input_name = "Eee PC WMI hotkeys", |
153 | .input_phys = EEEPC_WMI_FILE "/input0", | 178 | .input_phys = EEEPC_WMI_FILE "/input0", |
179 | .key_filter = eeepc_wmi_key_filter, | ||
154 | .probe = eeepc_wmi_probe, | 180 | .probe = eeepc_wmi_probe, |
155 | .quirks = eeepc_wmi_quirks, | 181 | .quirks = eeepc_wmi_quirks, |
156 | }; | 182 | }; |