Skip to content

Commit

Permalink
Input: synaptics - fix handling of disabling gesture mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Suggested-by: Gabor Balla <[email protected]>
Tested-by: Gabor Balla <[email protected]>
Tested-by: Nick Bowler <[email protected]>
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
dtor committed Aug 26, 2015
1 parent 1ae5ddb commit e51e384
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,18 @@ static int synaptics_set_mode(struct psmouse *psmouse)
struct synaptics_data *priv = psmouse->private;

priv->mode = 0;
if (priv->absolute_mode)

if (priv->absolute_mode) {
priv->mode |= SYN_BIT_ABSOLUTE_MODE;
if (priv->disable_gesture)
if (SYN_CAP_EXTENDED(priv->capabilities))
priv->mode |= SYN_BIT_W_MODE;
}

if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
priv->mode |= SYN_BIT_DISABLE_GESTURE;

if (psmouse->rate >= 80)
priv->mode |= SYN_BIT_HIGH_RATE;
if (SYN_CAP_EXTENDED(priv->capabilities))
priv->mode |= SYN_BIT_W_MODE;

if (synaptics_mode_cmd(psmouse, priv->mode))
return -1;
Expand Down

0 comments on commit e51e384

Please sign in to comment.