aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-08-20 17:28:48 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-08-26 13:09:22 -0400
commite51e38494a8ecc18650efb0c840600637891de2c (patch)
tree22c219137b4a0f9d385ac9f0718d05979fd5312d
parent1ae5ddb6f8837558928a1a694c7b8af7f09fdd21 (diff)
Input: synaptics - fix handling of disabling gesture mode
Bit 2 of the mode byte has dual meaning: it can disable reporting of gestures when touchpad works in Relative mode or normal Absolute mode, or it can enable so called Extended W-Mode when touchpad uses enhanced Absolute mode (W-mode). The extended W-Mode confuses our driver and causes missing button presses on some Thinkpads (x250, T450s), so let's make sure we do not enable it. Also, according to the spec W mode "... bit is defined only in Absolute mode on pads whose capExtended capability bit is set. In Relative mode and in TouchPads without this capability, the bit is reserved and should be left at 0.", so let's make sure we respect this requirement as well. Reported-by: Nick Bowler <nbowler@draconx.ca> Suggested-by: Gabor Balla <gaborwho@gmail.com> Tested-by: Gabor Balla <gaborwho@gmail.com> Tested-by: Nick Bowler <nbowler@draconx.ca> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/synaptics.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 6025eb430c0a..994ae7886156 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse *psmouse)
519 struct synaptics_data *priv = psmouse->private; 519 struct synaptics_data *priv = psmouse->private;
520 520
521 priv->mode = 0; 521 priv->mode = 0;
522 if (priv->absolute_mode) 522
523 if (priv->absolute_mode) {
523 priv->mode |= SYN_BIT_ABSOLUTE_MODE; 524 priv->mode |= SYN_BIT_ABSOLUTE_MODE;
524 if (priv->disable_gesture) 525 if (SYN_CAP_EXTENDED(priv->capabilities))
526 priv->mode |= SYN_BIT_W_MODE;
527 }
528
529 if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
525 priv->mode |= SYN_BIT_DISABLE_GESTURE; 530 priv->mode |= SYN_BIT_DISABLE_GESTURE;
531
526 if (psmouse->rate >= 80) 532 if (psmouse->rate >= 80)
527 priv->mode |= SYN_BIT_HIGH_RATE; 533 priv->mode |= SYN_BIT_HIGH_RATE;
528 if (SYN_CAP_EXTENDED(priv->capabilities))
529 priv->mode |= SYN_BIT_W_MODE;
530 534
531 if (synaptics_mode_cmd(psmouse, priv->mode)) 535 if (synaptics_mode_cmd(psmouse, priv->mode))
532 return -1; 536 return -1;