mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Three buttons reported on two-button touchpad
Date: Sun, 15 Nov 2009 11:48:29 +0300	[thread overview]
Message-ID: <200911151148.32631.arvidjaar@mail.ru> (raw)
In-Reply-To: <20091115062036.GA9844@core.coreip.homeip.net>

[-- Attachment #1: Type: Text/Plain, Size: 2127 bytes --]

On Sunday 15 of November 2009 09:20:36 Dmitry Torokhov wrote:
> Hi Andrey,
> 
> On Sat, Nov 14, 2009 at 03:51:10PM +0300, Andrey Borzenkov wrote:
> > Kernel 2.6.31.x
> >
> > dmesg:
> > Synaptics Touchpad, model: 1, fw: 6.3, id: 0x1c0b1, caps:
> > 0xa04751/0x0
> >
> > but /proc/bus/input/devices:
> >
> > I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
> > N: Name="SynPS/2 Synaptics TouchPad"
> > P: Phys=isa0060/serio1/input0
> > S: Sysfs=/devices/platform/i8042/serio1/input/input15
> > U: Uniq=
> > H: Handlers=mouse1 event2
> > B: EV=b
> > B: KEY=420 70000 0 0 0 0
> > B: ABS=11000003
> >
> > So even when capabilities clear say only 2 buttons, driver claims
> > there are 3 of them.
> >
> > The reason most likely is initialization sequence.
> > psmouse_switch_protocol() unconditionally sets supported buttons:
> >
> >         input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
> >         input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT)
> > | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); input_dev->relbit[0]
> > = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
> >
> > before even starting hardware detection and knowing real
> > capabilities. Detection for specific hardware won't change it
> > (possibly only extend).
> 
> Some of them do.
> 
> > Is it OK to move button bits setting into ps2bare_detect()? This
> > seems to agree with comments in psmouse_extensions() as well:
> >
> > /*
> >  * Okay, all failed, we have a standard mouse here. The number of
> > the buttons
> >  * is still a question, though. We assume 3.
> >  */
> >
> > All other detection routines seem to be setting those bits already.
> 
> Not all of them but yes, I think we should to this. DOes th patch
>  below work for you?
> 

Yes (I can test only Synaptics case).

Tested-by: Andrey Borzenkov <arvidjaar@mail.ru>

> +       input_dev->keybit[BIT_WORD(BTN_MOUSE)] =
> +                               BIT_MASK(BTN_LEFT) | 
BIT_MASK(BTN_RIGHT);

Just curious - is Apple touchpad (as found on MacBook) handled by 
different driver? Because it has just single button.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-11-15  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14 12:51 Andrey Borzenkov
2009-11-15  6:20 ` Dmitry Torokhov
2009-11-15  8:48   ` Andrey Borzenkov [this message]
2009-11-15 23:59     ` Dmitry Torokhov

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=200911151148.32631.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®