From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: [patch 19/22] input: elantech touchpad driver miss-recognising logitech mice Date: Wed, 04 Mar 2009 11:59:09 -0800 Message-ID: <200903041959.n24Jx9cY028481@imap1.linux-foundation.org> Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:48983 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756365AbZCDUKA (ORCPT ); Wed, 4 Mar 2009 15:10:00 -0500 Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: dtor@mail.ru Cc: linux-input@vger.kernel.org, akpm@linux-foundation.org, arjan@opmeer.net, apw@shadowen.org From: Arjan Opmeer Some Logitech mice react to the magic knock like an Elantech touchpad would. This leads to those mice being misdetected as Elantech touchpads. Add a version query to elantech_detect() to distinguish the two. Signed-off-by: Arjan Opmeer Cc: Andy Whitcroft Cc: Dmitry Torokhov Signed-off-by: Andrew Morton --- drivers/input/mouse/elantech.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff -puN drivers/input/mouse/elantech.c~input-elantech-touchpad-driver-miss-recognising-logitech-mice drivers/input/mouse/elantech.c --- a/drivers/input/mouse/elantech.c~input-elantech-touchpad-driver-miss-recognising-logitech-mice +++ a/drivers/input/mouse/elantech.c @@ -567,14 +567,27 @@ int elantech_detect(struct psmouse *psmo return -1; } - pr_debug("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_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); return -1; } + /* + * There are Logitech mice that react to the magic knock exactly + * like an Elantech touchpad would, so do a version query here to + * try to distinguish the two + */ + 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"; _