diff mbox

PROBLEM: Missing events on thinkpad trackpoint buttons

Message ID 20150820213526.GA10980@localhost (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Torokhov Aug. 20, 2015, 9:35 p.m. UTC
Hi Gabor,

On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
> Hi,
> 
> I could also reproduce this issue using a T450s, but have probably found the
> issue behind it.
> 
> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
> can be enabled by setting bit 2 of the mode byte. But previously this bit was
> used for 'Disable Gesture', whatever that stands for, and it was reused for
> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
> than disable gesture is on by default and bit 2 selects EWmode instead.
> 
> Reference:
> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
> 
> The current implementation of the driver doesn't take EWmode into account, and
> enables it, when setting both Wmode and what it thinks to be the disable
> gesture bit. It is probably selecting EWmode that causes the glitch.
> 
> A quick fix follows:
> 
> diff -ru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> --- a/drivers/input/mouse/synaptics.c2015-08-20 22:25:05.261546729 +0200
> +++ b/drivers/input/mouse/synaptics.c2015-08-20 22:21:28.560038539 +0200
> @@ -521,7 +521,7 @@
>  priv->mode = 0;
>  if (priv->absolute_mode)
>  priv->mode |= SYN_BIT_ABSOLUTE_MODE;
> -if (priv->disable_gesture && !SYN_CAP_EXTENDED(priv->capabilities))
> +if (priv->disable_gesture)

It looks like the patch "direction" is reverted. Also, the presence of
extended capabilities is not the indication that gesture mode should not
be used: in relative mode bit 2 disables gesture reporting, in absolute
mode it enables Extended W-mode.

Does the patch below also work for you?

Thanks.

Comments

Gabor Balla Aug. 20, 2015, 10:24 p.m. UTC | #1
Hi Dmitry,

On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote:
[...]
>> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This
>> can be enabled by setting bit 2 of the mode byte. But previously this bit was
>> used for 'Disable Gesture', whatever that stands for, and it was reused for
>> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte,
>> than disable gesture is on by default and bit 2 selects EWmode instead.
>>
>> Reference:
>> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf
[...]
>> A quick fix follows:
[...]
>
> It looks like the patch "direction" is reverted. Also, the presence of
> extended capabilities is not the indication that gesture mode should not
> be used: in relative mode bit 2 disables gesture reporting, in absolute
> mode it enables Extended W-mode.
>
> Does the patch below also work for you?

If I'm not mistaken, the function of bit 2 depends on the state of W mode rather
than absolute vs relative mode. From page 40 of the PDF:

"If the Wmode bit is not set (0), then Gesture is reported and bit 2 refers to
DisGest. (..) When this bit is 1, the Relative mode mouse packet reports the
true physical button states, and the Absolute mode packet’s Gesture bit always
reports as zero."

So it still has a meaning in absolute mode, when Wmode is disabled.
I've tried the patch, it works, but I don't believe it's correct.

Sorry for the reversed patch, I'm not really experienced with making patches.

Regards,
Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 28daca1..97c5dde 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,12 +519,15 @@  static int synaptics_set_mode(struct psmouse *psmouse)
 	struct synaptics_data *priv = psmouse->private;
 
 	priv->mode = 0;
+
 	if (priv->absolute_mode)
 		priv->mode |= SYN_BIT_ABSOLUTE_MODE;
-	if (priv->disable_gesture)
+	else if (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;
 
@@ -1482,7 +1485,7 @@  static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
 	}
 
 	priv->absolute_mode = absolute_mode;
-	if (SYN_ID_DISGEST_SUPPORTED(priv->identity))
+	if (!absolute_mode && SYN_ID_DISGEST_SUPPORTED(priv->identity))
 		priv->disable_gesture = true;
 
 	/*