Re: [PATCH v2] Input: Bug 18122 - Support Lenovo S10-3t's 2-button ClickPad

Previous thread: [PATCH] ASoC: Simplify pm860x_probe error handling by Axel Lin on Tuesday, November 30, 2010 - 12:34 am. (2 messages)

Next thread: Kernel bug (2.6.36) with vhost_net by Jean-Philippe Menil on Tuesday, November 30, 2010 - 1:01 am. (1 message)
From: Yan Li
Date: Tuesday, November 30, 2010 - 12:44 am

This is for kernel bug #18122 and MeeGo bug #4807, version 2.

Lenovo S10-3t's ClickPad is a 2-button ClickPad that reports BTN_LEFT
and BTN_RIGHT as normal touchpad, unlike the 1-button ClickPad used in
HP mini 210 that reports solely BTN_MIDDLE.

Of c0-cap response, the 1-button ClickPad has the 20-bit set while
2-button ClickPad has the 8-bit set.

This patch makes the kernel only handle 1-button ClickPad specially,
and treat 2-button ClickPad as same as other normal touchpads.

Signed-off-by: Yan Li <yan.i.li@intel.com>
---
 drivers/input/mouse/synaptics.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 613a365..20468b6 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -51,7 +51,13 @@
 #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)
+/* This macro detects 1-button ClickPad. Of ex0c capacity, if the
+ * 20-bit of ex0c is set the touchpad is a 1-button ClickPad, which
+ * needs special handling because it reports only BTN_MIDDLE.  If the
+ * 8-bit is set it is a 2-button ClickPad which reports BTN_* events
+ * normally and needs no special handling. Therefore this macro
+ * detects 1-button ClickPad only.  */
+#define SYN_CAP_CLICKPAD(ex0c)		((ex0c) & 0x100000)
 #define SYN_CAP_MAX_DIMENSIONS(ex0c)	((ex0c) & 0x020000)
 
 /* synaptics modes query bits */
-- 
1.7.2.3


-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net
--

From: Dmitry Torokhov
Date: Tuesday, November 30, 2010 - 12:50 am

As Takashi mentioned, HP Clickpads have the same 0x0c signature than
Lenovos non-clickpads so this is not that simple. We need to wait and
see if Christopher will shed some light here...

Thanks.

-- 
Dmitry
--

From: Li, Yan I
Date: Tuesday, November 30, 2010 - 1:08 am

So the only exception is the one reported by tob. These are the bits
I've collected:

Yan's S10-3t: model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xa40000/0x4a0500 (2 button clickpad)
tob's S10-3t: model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xe40000/0x5a0400 (?)
hp Envy 14/mini210:
              model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xe40000/0x5a0400 (1 button clickpad)

I asked tob to double-check his model and whether his touchpad emits
BTN_MIDDLE or not but get no reply yet. I've checked 4 S10-3t
purchased at different dates and all of them show same exc0 cap, but I
have to say other models selling in other parts of the world may be
still different.

-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net
--

From: Tobyn Bertram
Date: Tuesday, November 30, 2010 - 8:48 am

I do not have a S10-3t.  I have a HP DV7t with a standard 1 button Clickpad.
I am sorry for any confusion.

I think that 2 different Clickpads will need to be defined: 1 button
Clickpads and 2 button Clickpads.  Maybe like this?

#define SYN_CAP_CLICKPAD1BTN(ex0c)		((ex0c) & 0x100000)
#define SYN_CAP_CLICKPAD2BTN(ex0c)		((ex0c) & 0x000100)

Tobyn

-----Original Message-----
From: Li, Yan I [mailto:yan.i.li@intel.com] 
Sent: Tuesday, November 30, 2010 12:08 AM
To: Dmitry Torokhov; tobynbertram@hotmail.com
Cc: linux-input@vger.kernel.org; Takashi Iwai; Ding, Jian-feng;
linux-kernel@vger.kernel.org; meego-kernel@lists.meego.com
Subject: Re: [PATCH v2] Input: Bug 18122 - Support Lenovo S10-3t's 2-button
ClickPad


So the only exception is the one reported by tob. These are the bits
I've collected:

Yan's S10-3t: model: 1, fw: 7.4, id: 0x1e0b1, caps:
0xd04771/0xa40000/0x4a0500 (2 button clickpad)
tob's S10-3t: model: 1, fw: 7.4, id: 0x1e0b1, caps:
0xd04771/0xe40000/0x5a0400 (?)
hp Envy 14/mini210:
              model: 1, fw: 7.4, id: 0x1e0b1, caps:
0xd04771/0xe40000/0x5a0400 (1 button clickpad)

I asked tob to double-check his model and whether his touchpad emits
BTN_MIDDLE or not but get no reply yet. I've checked 4 S10-3t
purchased at different dates and all of them show same exc0 cap, but I
have to say other models selling in other parts of the world may be
still different.

-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net

--

From: Li, Yan I
Date: Tuesday, November 30, 2010 - 9:11 pm

Thank you. This clarify the S10-3t touchpad mystery. So I think my v2

Maybe, although we don't have any code that needs
SYN_CAP_CLICKPAD2BTN() so far, only 1-button clickpad needs special
handling, but it's good to have a more precise name.

-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net
--

From: Takashi Iwai
Date: Tuesday, November 30, 2010 - 11:04 pm

At Wed, 1 Dec 2010 12:11:04 +0800,

Agreed.  Also, it's interesting to see how 2-button clickpad devices 
behave in multi-touch mode...


thanks,

Takashi
--

From: Li, Yan I
Date: Wednesday, December 1, 2010 - 12:18 am

Talk to a kernel developer and s/he will tell you to implement that
logic in X. :)

In X we already have so much code to handle the complexity and quirks
of 1000 different touchpads in the wild.

-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net
--

From: Dmitry Torokhov
Date: Wednesday, December 1, 2010 - 12:23 am

You knew, you knew ;)

-- 
Dmitry
--

From: Dmitry Torokhov
Date: Wednesday, December 1, 2010 - 12:46 am

Yep, I'll queue it gfor .37.

Thanks,

-- 
Dmitry
--

From: Li, Yan I
Date: Wednesday, December 1, 2010 - 1:01 am

Thank you. Here we're testing it extensively. Will report if I seen
any new issues.

-- 
Best regards,
Li, Yan

MeeGo Team, Opensource Technology Center, SSG, Intel
Office tel.: +86-10-82171695 (inet: 8-758-1695)
OpenPGP key: 5C6C31EF
IRC: yanli on network irc.freenode.net
--

Previous thread: [PATCH] ASoC: Simplify pm860x_probe error handling by Axel Lin on Tuesday, November 30, 2010 - 12:34 am. (2 messages)

Next thread: Kernel bug (2.6.36) with vhost_net by Jean-Philippe Menil on Tuesday, November 30, 2010 - 1:01 am. (1 message)