diff mbox

[3.13.y-ckt,47/85] Input: synaptics - fix handling of disabling gesture mode

Message ID 1445376941-7046-48-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa Oct. 20, 2015, 9:35 p.m. UTC
3.13.11-ckt28 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

commit e51e38494a8ecc18650efb0c840600637891de2c upstream.

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>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/mouse/synaptics.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Dmitry Torokhov Oct. 20, 2015, 10:44 p.m. UTC | #1
Hi Kamal,

On Tue, Oct 20, 2015 at 2:35 PM, Kamal Mostafa <kamal@canonical.com> wrote:
> 3.13.11-ckt28 -stable review patch.  If anyone has any objections, please let me know.

Please drop this one, it's been shown wrong and is reverted form mainline.

Thanks!

>
> ------------------
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> commit e51e38494a8ecc18650efb0c840600637891de2c upstream.
>
> 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>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  drivers/input/mouse/synaptics.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index 17b0285..e772a2a 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -486,14 +486,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;
> --
> 1.9.1
>
Kamal Mostafa Oct. 21, 2015, 8:26 p.m. UTC | #2
On Tue, 2015-10-20 at 15:44 -0700, Dmitry Torokhov wrote:
> Hi Kamal,
> 
> On Tue, Oct 20, 2015 at 2:35 PM, Kamal Mostafa <kamal@canonical.com> wrote:
> > 3.13.11-ckt28 -stable review patch.  If anyone has any objections, please let me know.
> 
> Please drop this one, it's been shown wrong and is reverted form mainline.

Dropped from 3.13-stable.  Thanks very much, Dmitry!

 -Kamal


> Thanks!
> 
> >
> > ------------------
> >
> > From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >
> > commit e51e38494a8ecc18650efb0c840600637891de2c upstream.
> >
> > 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>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> > ---
> >  drivers/input/mouse/synaptics.c | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> > index 17b0285..e772a2a 100644
> > --- a/drivers/input/mouse/synaptics.c
> > +++ b/drivers/input/mouse/synaptics.c
> > @@ -486,14 +486,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;
> > --
> > 1.9.1
> >
> 
> 
>
diff mbox

Patch

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 17b0285..e772a2a 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -486,14 +486,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;