2009-01-26 15:08:34

by Andy Whitcroft

[permalink] [raw]
Subject: elantech touchpad driver miss-recognising logitech mice

We have been receiving reports of the elantech driver miss-recognising
logitech mice as per the patchwork thread below:

http://patchwork.kernel.org/patch/319/

That thread indicates that the patch as presented is not sufficient
so I am wondering if this has progressed and if there is a later patch I
could test with. I cannot see anything later in mainline as yet?

Failing that I did build a modified patch (below) based on that from the
thread plus the suggested improvements. This has been tested by people
with the Logitech mice successfully, and also by people with elantech
touchpads who report no regressions.

If there is no later patches then perhaps you could test this one, and
then I can push it upstream.

Comments?

-apw


>From b39b647dfd5106c340d588920704b6d696b182d9 Mon Sep 17 00:00:00 2001
From: Andy Whitcroft <[email protected]>
Date: Fri, 23 Jan 2009 17:42:05 +0000
Subject: [PATCH 1/1] elantech touchpad -- weed out incorrectly identified Logitech Mice

Some Logitech USB-PS/2 Optical Mouse are triggering on the special knock
sequence when attached on PS/2. Use the version number to weed those out.
Note that as we have no private data we end up doing the version check
twice.

Based on an original patch by Arjan Opmeer <[email protected]> and based
on suggestions from him on how to improve it.

Signed-off-by: Andy Whitcroft <[email protected]>
---
drivers/input/mouse/elantech.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index b9a25d5..32febf5 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -556,6 +556,22 @@ int elantech_detect(struct psmouse *psmouse, int set_properties)
return -1;
}

+ /*
+ * Some Logitech USB-PS/2 Optical Mouse devices are responding to
+ * our magic knock. So ask for our device version and validate
+ * using that.
+ */
+ if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
+ pr_err("elantech.c: failed to query firmware version.\n");
+ return -1;
+ }
+ pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
+ param[0], param[1], param[2]);
+ if (param[0] == 0 || param[1] != 0) {
+ pr_info("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+ return -1;
+ }
+
if (set_properties) {
psmouse->vendor = "Elantech";
psmouse->name = "Touchpad";
--
1.6.1.258.g7ff14.dirty


2009-01-26 16:23:28

by Arjan Opmeer

[permalink] [raw]
Subject: Re: elantech touchpad driver miss-recognising logitech mice


On Mon, Jan 26, 2009 at 03:08:21PM +0000, Andy Whitcroft wrote:
>
> Failing that I did build a modified patch (below) based on that from the
> thread plus the suggested improvements. This has been tested by people
> with the Logitech mice successfully, and also by people with elantech
> touchpads who report no regressions.

Good! This means the suggested fix is working :)

However, my original proposal:

http://patchwork.kernel.org/patch/595/

also removed printing the version query result in elantech_init() to keep
the amount of log messages the same.

> If there is no later patches then perhaps you could test this one, and
> then I can push it upstream.

Dmitry suggested moving the Elantech detection down in psmouse_extensions()
in psmouse-base.c to make the mouse detection less chatty:

http://lkml.org/lkml/2009/1/20/55

However, Alexander pointed out he did not move it far enough down:

http://lkml.org/lkml/2009/1/22/18

It should have been moved all the way down below the call to
im_explorer_detect() for him to not see the extra Elantech detection noise.

Now, it is Dmitry's call again to determine whether he really wants to move
the call to elantech_detect() that far down or can live with the extra log
messages... :)


Arjan

2009-01-30 23:24:23

by Andrew Morton

[permalink] [raw]
Subject: Re: elantech touchpad driver miss-recognising logitech mice

On Mon, 26 Jan 2009 17:23:03 +0100
Arjan Opmeer <[email protected]> wrote:

>
> On Mon, Jan 26, 2009 at 03:08:21PM +0000, Andy Whitcroft wrote:
> >
> > Failing that I did build a modified patch (below) based on that from the
> > thread plus the suggested improvements. This has been tested by people
> > with the Logitech mice successfully, and also by people with elantech
> > touchpads who report no regressions.
>
> Good! This means the suggested fix is working :)
>
> However, my original proposal:
>
> http://patchwork.kernel.org/patch/595/
>
> also removed printing the version query result in elantech_init() to keep
> the amount of log messages the same.
>
> > If there is no later patches then perhaps you could test this one, and
> > then I can push it upstream.
>
> Dmitry suggested moving the Elantech detection down in psmouse_extensions()
> in psmouse-base.c to make the mouse detection less chatty:
>
> http://lkml.org/lkml/2009/1/20/55
>
> However, Alexander pointed out he did not move it far enough down:
>
> http://lkml.org/lkml/2009/1/22/18
>
> It should have been moved all the way down below the call to
> im_explorer_detect() for him to not see the extra Elantech detection noise.
>
> Now, it is Dmitry's call again to determine whether he really wants to move
> the call to elantech_detect() that far down or can live with the extra log
> messages... :)
>

blah. Please propose a final patch for me to stash away, lest the
issue get forgotten about.