From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Gabor Balla <gaborwho@gmail.com>
Cc: linux-input@vger.kernel.org,
Benjamin Tissoires <benjamin.tissoires@gmail.com>,
Stephen Chandler Paul <thatslyude@gmail.com>,
Nick Bowler <nbowler@draconx.ca>,
Andrew Duggan <andrew.duggan@gmail.com>
Subject: Re: PROBLEM: Missing events on thinkpad trackpoint buttons
Date: Thu, 20 Aug 2015 15:56:33 -0700 [thread overview]
Message-ID: <20150820225633.GA12900@localhost> (raw)
In-Reply-To: <CAMmwwr-uYWurxAQnDdy9hVO-A3PGK92uSmHjYagp5eTXmPnZ_Q@mail.gmail.com>
On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote:
> 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.
Yes, you are right, the bot does have meaning on Absolute mode, however
we want to give option to enable gestures only when in relative mode;
I've adjusted the description accordingly.
By the way, I re-read the spec and it says that when in Relative mode we
should not touch W-mode bit at all so I adjusted it as well.
Thanks.
--
Dmitry
Input: synaptics - fix handling of disabling gesture mode
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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). Given that
we only want to give option of enabling gestures when touchpad works in
relative mode let's adjust synaptics_set_mode() so that we do not touch
that bit in absolute mode.
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>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/mouse/synaptics.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 28daca1..298f65d 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -519,14 +519,17 @@ 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;
+ } 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;
if (synaptics_mode_cmd(psmouse, priv->mode))
return -1;
@@ -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;
/*
--
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
next prev parent reply other threads:[~2015-08-20 22:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 20:50 PROBLEM: Missing events on thinkpad trackpoint buttons Gabor Balla
2015-08-20 21:35 ` Dmitry Torokhov
2015-08-20 22:24 ` Gabor Balla
2015-08-20 22:42 ` Gabor Balla
2015-08-20 22:56 ` Dmitry Torokhov [this message]
2015-08-20 23:01 ` Dmitry Torokhov
2015-08-20 23:05 ` Gabor Balla
2015-08-20 23:08 ` Dmitry Torokhov
2015-08-20 23:13 ` Dmitry Torokhov
2015-08-20 23:35 ` Gabor Balla
2015-08-21 0:06 ` Dmitry Torokhov
2015-08-24 17:57 ` Dmitry Torokhov
2015-08-24 23:44 ` Nick Bowler
[not found] ` <CAN+gG=H88uVbRun=Vs1r1b8jM=wpnC1285BquFpDsh8HQdr07Q@mail.gmail.com>
2015-09-27 12:14 ` Benjamin Tissoires
2015-09-28 22:52 ` Dmitry Torokhov
2015-09-29 0:22 ` Nick Bowler
2015-09-29 0:26 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2015-08-18 2:31 Nick Bowler
2015-08-18 19:06 ` Benjamin Tissoires
2015-08-19 13:52 ` Benjamin Tissoires
2015-08-19 14:10 ` Nick Bowler
2015-08-19 14:12 ` Benjamin Tissoires
2015-08-19 21:27 ` Dmitry Torokhov
2015-08-19 21:33 ` Stephen Chandler Paul
2015-08-19 21:34 ` Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150820225633.GA12900@localhost \
--to=dmitry.torokhov@gmail.com \
--cc=andrew.duggan@gmail.com \
--cc=benjamin.tissoires@gmail.com \
--cc=gaborwho@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=nbowler@draconx.ca \
--cc=thatslyude@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox