aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-04-08 12:26:42 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-04-12 18:39:41 -0400
commit6bcca19f5dcedc3a006ca0bcc3699a437cadee74 (patch)
treeb72aa7111e569de19c7e69ae3428a8f91deedd53 /drivers/input/mouse
parentbd884149aca61de269fd9bad83fe2a4232ffab21 (diff)
Input: alps - fix touchpad buttons getting stuck when used with trackpoint
When the left touchpad button gets pressed, and then the trackpoint is moved, and then the button is released, the following happens: 1) touchpad packet is received, touchpad evdev node reports BTN_LEFT 1 2) pointing stick packet is received, the hw will report a BTN_LEFT 1 in this packet because when the trackstick is active it communicates the combined touchpad + pointing stick buttons in the trackstick packet, since alps_report_bare_ps2_packet passes NULL (*) for the dev2 parameter to alps_report_buttons the combining is not detected and the pointing stick evdev node will also report BTN_LEFT 1 3) on release of the button a pointing stick packet with BTN_LEFT 0 is received and the pointing stick evdev node will report BTN_LEFT 0 Note how because of the passing as NULL for dev2 the touchpad evdev node will never send BTN_LEFT 0 in this scenario leading to a stuck mouse button. This is a regression in 4.0 introduced by commit 04aae283ba6a8 ("Input: ALPS - do not mix trackstick and external PS/2 mouse data") This commit fixes this by passing in the touchpad evdev as dev2 parameter when calling alps_report_buttons for the pointingstick on alps v2 devices, so that alps_report_buttons correctly detect that we're already reporting the button as pressed via the touchpad evdev node, and will also send the release event there. Cc: stable@vger.kernel.org # 4.0 Reported-by: Hans de Bruin <jmdebruin@xmsnet.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/alps.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 27bcdbc950c9..ea6cb64dfb28 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1159,13 +1159,14 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
1159 bool report_buttons) 1159 bool report_buttons)
1160{ 1160{
1161 struct alps_data *priv = psmouse->private; 1161 struct alps_data *priv = psmouse->private;
1162 struct input_dev *dev; 1162 struct input_dev *dev, *dev2 = NULL;
1163 1163
1164 /* Figure out which device to use to report the bare packet */ 1164 /* Figure out which device to use to report the bare packet */
1165 if (priv->proto_version == ALPS_PROTO_V2 && 1165 if (priv->proto_version == ALPS_PROTO_V2 &&
1166 (priv->flags & ALPS_DUALPOINT)) { 1166 (priv->flags & ALPS_DUALPOINT)) {
1167 /* On V2 devices the DualPoint Stick reports bare packets */ 1167 /* On V2 devices the DualPoint Stick reports bare packets */
1168 dev = priv->dev2; 1168 dev = priv->dev2;
1169 dev2 = psmouse->dev;
1169 } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) { 1170 } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
1170 /* Register dev3 mouse if we received PS/2 packet first time */ 1171 /* Register dev3 mouse if we received PS/2 packet first time */
1171 if (!IS_ERR(priv->dev3)) 1172 if (!IS_ERR(priv->dev3))
@@ -1177,7 +1178,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
1177 } 1178 }
1178 1179
1179 if (report_buttons) 1180 if (report_buttons)
1180 alps_report_buttons(dev, NULL, 1181 alps_report_buttons(dev, dev2,
1181 packet[0] & 1, packet[0] & 2, packet[0] & 4); 1182 packet[0] & 1, packet[0] & 2, packet[0] & 4);
1182 1183
1183 input_report_rel(dev, REL_X, 1184 input_report_rel(dev, REL_X,