mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Input: elantech - enable middle button of touchpads on ThinkPad P52
commit 24bb555e6e upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
54ae564b35
commit
465e965f64
@@ -1173,6 +1173,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static const char * const middle_button_pnp_ids[] = {
|
||||
"LEN2131", /* ThinkPad P52 w/ NFC */
|
||||
"LEN2132", /* ThinkPad P52 */
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Set the appropriate event bits for the input subsystem
|
||||
*/
|
||||
@@ -1192,7 +1198,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
|
||||
__clear_bit(EV_REL, dev->evbit);
|
||||
|
||||
__set_bit(BTN_LEFT, dev->keybit);
|
||||
if (dmi_check_system(elantech_dmi_has_middle_button))
|
||||
if (dmi_check_system(elantech_dmi_has_middle_button) ||
|
||||
psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
|
||||
__set_bit(BTN_MIDDLE, dev->keybit);
|
||||
__set_bit(BTN_RIGHT, dev->keybit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user