mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Yan Li <yan.i.li@intel.com>
Cc: linux-input@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
	jian-feng.ding@intel.com, linux-kernel@vger.kernel.org,
	meego-kernel@lists.meego.com,
	Christopher Heiny <christopherheiny@gmail.com>
Subject: Re: [PATCH] Input: Lenovo S10-3t's touchpad support
Date: Fri, 26 Nov 2010 23:55:28 -0800	[thread overview]
Message-ID: <20101127075528.GA28667@core.coreip.homeip.net> (raw)
In-Reply-To: <aefc1833eeede37ae6ea4a9ddeaa602eb7d31101.1290823698.git.yan.i.li@intel.com>

Hi Yan,

On Sat, Nov 27, 2010 at 11:56:59AM +0800, Yan Li wrote:
> This is for kernel bug #18122 and MeeGo bug #4807.
> 
> Current code detects Clickpad by checking the 8 and 20 bits of 0x0c
> cap. However, the code returns true if either of those bits is 1,
> while it should only return true when both are 1. This has lead to the
> touchpad on Lenovo S10-3t be mistakenly recognized as Clickpad and its
> BTN_LEFT and BTN_RIGHT blocked.
> 
> So far we've found that the S10-3ts are shipped with two slightly
> different models of touchpads, of which the 0x0c cap is either
> 0x5a0400 or 0x4a0500. They are not Clickpad and return BTN_LEFT and
> BTN_RIGHT normally.

Hmm, this is weird. According to my data:

>> Treat it as a two-bit field.
>>   0x00 == not a clickpad
>>   0x01 == 1 button clickpad
>>   0x02 == 2 button clickpad
>>   0x03 == reserved

Moreover, Takashi's HP returns 0x5a 0x04 0x00 in response to 0x0c query
and _is_ a clickpad.

Christopher, was there any more updates to the protocol by any chance?

> 
> This patch fixed this issue by checking both sign bits are 1. Tested
> on my S10-3t and worked well.
> 
> Signed-off-by: Yan Li <yan.i.li@intel.com>
> ---
>  drivers/input/mouse/synaptics.h |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
> index 613a365..0c1083c 100644
> --- a/drivers/input/mouse/synaptics.h
> +++ b/drivers/input/mouse/synaptics.h
> @@ -51,7 +51,11 @@
>  #define SYN_EXT_CAP_REQUESTS(c)		(((c) & 0x700000) >> 20)
>  #define SYN_CAP_MULTI_BUTTON_NO(ec)	(((ec) & 0x00f000) >> 12)
>  #define SYN_CAP_PRODUCT_ID(ec)		(((ec) & 0xff0000) >> 16)
> -#define SYN_CAP_CLICKPAD(ex0c)		((ex0c) & 0x100100)
> +/* Synaptics' ClickPad has both 8th and 20th bits set in the 0x0c
> + * cap. Other models (like those shipped with Lenovo S10-3t) may have
> + * either one of them set but not both, and they are *not* ClickPad
> + * although they look similar. */
> +#define SYN_CAP_CLICKPAD(ex0c)		((ex0c) & 0x100100 == 0x100100)

In C comparison operators have higher precedence than bitwise ones. Your
expression reduces to ((ex0c) & 1) which is not correct. The proper
expression would be:

#define SYN_CAP_CLICKPAD(ex0c)		(((ex0c) & 0x100100) == 0x100100)

but it really contradicts the data I have...

Thanks.

-- 
Dmitry

  reply	other threads:[~2010-11-27  7:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-27  3:56 Yan Li
2010-11-27  7:55 ` Dmitry Torokhov [this message]
2010-11-30  2:18   ` Li, Yan I
2010-11-30  7:12     ` Takashi Iwai
2010-11-30  8:09       ` Li, Yan I
2010-11-30  7:44 ` [PATCH v2] Input: Bug 18122 - Support Lenovo S10-3t's 2-button ClickPad Yan Li
2010-11-30  7:50   ` Dmitry Torokhov
2010-11-30  8:08     ` Li, Yan I
2010-11-30 15:48       ` Tobyn Bertram
2010-12-01  4:11         ` Li, Yan I
2010-12-01  6:04           ` Takashi Iwai
     [not found]             ` <BAY130-W15C8BF6B2994FAE083FAF5DE260@phx.gbl>
2010-12-01  7:18               ` Li, Yan I
2010-12-01  7:23                 ` Dmitry Torokhov
2010-12-01  7:46           ` Dmitry Torokhov
2010-12-01  8:01             ` Li, Yan I

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=20101127075528.GA28667@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=christopherheiny@gmail.com \
    --cc=jian-feng.ding@intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meego-kernel@lists.meego.com \
    --cc=tiwai@suse.de \
    --cc=yan.i.li@intel.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

Powered by JetHome