aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ma <aaron.ma@canonical.com>2018-06-21 20:14:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-06-21 20:19:56 -0400
commit24bb555e6e46d96e2a954aa0295029a81cc9bbaa (patch)
treea86bf88550bdaad60d11b639040c9a413bd14349
parent01f7e67a053f7f5696fbdefe2b066303469b6db5 (diff)
Input: elantech - enable middle button of touchpads on ThinkPad P52
PNPID is better way to identify the type of touchpads. Enable middle button support on 2 types of touchpads on Lenovo P52. Cc: stable@vger.kernel.org Signed-off-by: Aaron Ma <aaron.ma@canonical.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/elantech.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index fb4d902c4403..4c52e43c9273 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
1175 { } 1175 { }
1176}; 1176};
1177 1177
1178static const char * const middle_button_pnp_ids[] = {
1179 "LEN2131", /* ThinkPad P52 w/ NFC */
1180 "LEN2132", /* ThinkPad P52 */
1181 NULL
1182};
1183
1178/* 1184/*
1179 * Set the appropriate event bits for the input subsystem 1185 * Set the appropriate event bits for the input subsystem
1180 */ 1186 */
@@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
1194 __clear_bit(EV_REL, dev->evbit); 1200 __clear_bit(EV_REL, dev->evbit);
1195 1201
1196 __set_bit(BTN_LEFT, dev->keybit); 1202 __set_bit(BTN_LEFT, dev->keybit);
1197 if (dmi_check_system(elantech_dmi_has_middle_button)) 1203 if (dmi_check_system(elantech_dmi_has_middle_button) ||
1204 psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
1198 __set_bit(BTN_MIDDLE, dev->keybit); 1205 __set_bit(BTN_MIDDLE, dev->keybit);
1199 __set_bit(BTN_RIGHT, dev->keybit); 1206 __set_bit(BTN_RIGHT, dev->keybit);
1200 1207