aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2012-12-14 03:14:27 -0500
committerMatthew Garrett <matthew.garrett@nebula.com>2013-01-07 12:31:42 -0500
commit8e2286ce073f8f40794669956de8fe92da1d9da0 (patch)
treed7faf0768b172db73a34802130304bfcdd84c8b4 /drivers
parentf20aaba9819d0801fb1314363f97239da0100bac (diff)
acer-wmi: change to emit touchpad on off key
KEY_TOUCHPAD_TOOGLE key is for notice userland change touchpad state via xf86-input-synaptics on the machine that don't toggle touchpad in hardware. But, acer laptop actually toggle touchpad in hardware. So, this patch change to emit KEY_TOUCHPAD_ON/OFF key when acer-wmi grab device state of touchpad. Reference: brc#848270 https://bugzilla.redhat.com/show_bug.cgi?id=848270 Tested-by: Nathanael Noblet <nathanael@gnat.ca> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk> Cc: Matthew Garrett <mjg@redhat.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/acer-wmi.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index ff0a866791ca..44f62b24f0a1 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -125,7 +125,9 @@ static const struct key_entry acer_wmi_keymap[] = {
125 {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} }, 125 {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
126 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ 126 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
127 {KE_IGNORE, 0x81, {KEY_SLEEP} }, 127 {KE_IGNORE, 0x81, {KEY_SLEEP} },
128 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad On/Off */ 128 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */
129 {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} },
130 {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} },
129 {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} }, 131 {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
130 {KE_END, 0} 132 {KE_END, 0}
131}; 133};
@@ -147,6 +149,7 @@ struct event_return_value {
147#define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */ 149#define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */
148#define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */ 150#define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */
149#define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */ 151#define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */
152#define ACER_WMID3_GDS_TOUCHPAD (1<<1) /* Touchpad */
150 153
151struct lm_input_params { 154struct lm_input_params {
152 u8 function_num; /* Function Number */ 155 u8 function_num; /* Function Number */
@@ -1678,6 +1681,7 @@ static void acer_wmi_notify(u32 value, void *context)
1678 acpi_status status; 1681 acpi_status status;
1679 u16 device_state; 1682 u16 device_state;
1680 const struct key_entry *key; 1683 const struct key_entry *key;
1684 u32 scancode;
1681 1685
1682 status = wmi_get_event_data(value, &response); 1686 status = wmi_get_event_data(value, &response);
1683 if (status != AE_OK) { 1687 if (status != AE_OK) {
@@ -1714,6 +1718,7 @@ static void acer_wmi_notify(u32 value, void *context)
1714 pr_warn("Unknown key number - 0x%x\n", 1718 pr_warn("Unknown key number - 0x%x\n",
1715 return_value.key_num); 1719 return_value.key_num);
1716 } else { 1720 } else {
1721 scancode = return_value.key_num;
1717 switch (key->keycode) { 1722 switch (key->keycode) {
1718 case KEY_WLAN: 1723 case KEY_WLAN:
1719 case KEY_BLUETOOTH: 1724 case KEY_BLUETOOTH:
@@ -1727,9 +1732,11 @@ static void acer_wmi_notify(u32 value, void *context)
1727 rfkill_set_sw_state(bluetooth_rfkill, 1732 rfkill_set_sw_state(bluetooth_rfkill,
1728 !(device_state & ACER_WMID3_GDS_BLUETOOTH)); 1733 !(device_state & ACER_WMID3_GDS_BLUETOOTH));
1729 break; 1734 break;
1735 case KEY_TOUCHPAD_TOGGLE:
1736 scancode = (device_state & ACER_WMID3_GDS_TOUCHPAD) ?
1737 KEY_TOUCHPAD_ON : KEY_TOUCHPAD_OFF;
1730 } 1738 }
1731 sparse_keymap_report_entry(acer_wmi_input_dev, key, 1739 sparse_keymap_report_event(acer_wmi_input_dev, scancode, 1, true);
1732 1, true);
1733 } 1740 }
1734 break; 1741 break;
1735 case WMID_ACCEL_EVENT: 1742 case WMID_ACCEL_EVENT: