a1ef73
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
a1ef73
Date: Sun, 8 Mar 2015 22:34:50 -0700
a1ef73
Subject: [PATCH] Input: synaptics - remove TOPBUTTONPAD property for Lenovos
a1ef73
 2015
a1ef73
a1ef73
The 2015 series of the Lenovo thinkpads added back the hardware buttons on
a1ef73
top of the touchpad for the trackstick.
a1ef73
a1ef73
Unfortunately, Lenovo used the PNPIDs that are supposed to be "5 buttons"
a1ef73
touchpads, so the new laptops also have the INPUT_PROP_TOPBUTTONPAD. Yay!
a1ef73
a1ef73
Instead of manually removing each of the new ones, or hoping that we know
a1ef73
all the current ones, we can consider that the PNPIDs list that were given
a1ef73
contains touchpads that have the trackstick buttons, either physically
a1ef73
wired to them, or emulated with the top software button property.
a1ef73
a1ef73
Thanks to the extra buttons capability in query $10, we can reliably detect
a1ef73
the physical buttons from the software ones, and so we can remove the
a1ef73
TOPBUTTONPAD property even if it was declared as such.
a1ef73
a1ef73
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
a1ef73
Acked-by: Hans de Goede <hdegoede@redhat.com>
a1ef73
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
a1ef73
---
a1ef73
 drivers/input/mouse/synaptics.c | 3 ++-
a1ef73
 1 file changed, 2 insertions(+), 1 deletion(-)
a1ef73
a1ef73
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
a1ef73
index 8f6a153677b9..9d599eb79f17 100644
a1ef73
--- a/drivers/input/mouse/synaptics.c
a1ef73
+++ b/drivers/input/mouse/synaptics.c
a1ef73
@@ -1570,7 +1570,8 @@ static void set_input_params(struct psmouse *psmouse,
a1ef73
 
a1ef73
 	if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
a1ef73
 		__set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
a1ef73
-		if (psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids))
a1ef73
+		if (psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&
a1ef73
+		    !SYN_CAP_EXT_BUTTONS_STICK(priv->ext_cap_10))
a1ef73
 			__set_bit(INPUT_PROP_TOPBUTTONPAD, dev->propbit);
a1ef73
 		/* Clickpads report only left button */
a1ef73
 		__clear_bit(BTN_RIGHT, dev->keybit);
a1ef73
-- 
a1ef73
2.1.0
a1ef73