From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: JJ Ding <jj_ding@emc.com.tw>
Cc: "Seth Forshee" <seth.forshee@canonical.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
"Aaron Huang" <aaron_huang@emc.com.tw>,
"Tom Lin" <tom_lin@emc.com.tw>,
"Éric Piel" <E.A.B.Piel@tudelft.nl>,
"Daniel Kurtz" <djkurtz@chromium.org>,
"Chase Douglas" <chase.douglas@canonical.com>,
"Henrik Rydberg" <rydberg@euromail.se>,
"Alessandro Rubini" <rubini@cvml.unipv.it>
Subject: Re: [PATCH v2 7/7] Input: elantech - add v3 hardware support
Date: Thu, 25 Aug 2011 00:06:42 -0700 [thread overview]
Message-ID: <20110825070642.GB15655@core.coreip.homeip.net> (raw)
In-Reply-To: <87mxeynvpt.fsf@emc.com.tw>
On Thu, Aug 25, 2011 at 09:09:02AM +0800, JJ Ding wrote:
> Hi Seth,
>
> Thank you. You are right.
> I think I somehow tested the worng touchpad for this patch.
>
How about we change it thusly:
Input: elamtech - fix V3 packet checking
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/mouse/elantech.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 1e2b9da..d814bf74 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -508,24 +508,18 @@ static int elantech_packet_check_v2(struct psmouse *psmouse)
*/
static int elantech_packet_check_v3(struct psmouse *psmouse)
{
+ const u8 debounce_packet[] = { 0xc4, 0xff, 0xff, 0x02, 0xff, 0xff };
unsigned char *packet = psmouse->packet;
- if ((packet[0] & 0x0c) == 0x04 &&
- (packet[3] & 0xcf) == 0x02)
+ if (!memcmp(packet, debounce_packet, sizeof(debounce_packet)))
+ return PACKET_DEBOUNCE;
+
+ if ((packet[0] & 0x0c) == 0x04 && (packet[3] & 0xcf) == 0x02)
return PACKET_V3_HEAD;
- if ((packet[0] & 0x0c) == 0x0c &&
- (packet[3] & 0xce) == 0x0c)
+ if ((packet[0] & 0x0c) == 0x0c && (packet[3] & 0xce) == 0x0c)
return PACKET_V3_TAIL;
- if (packet[0] == 0xc4 &&
- packet[1] == 0xff &&
- packet[2] == 0xff &&
- packet[3] == 0x02 &&
- packet[4] == 0xff &&
- packet[5] == 0xff)
- return PACKET_DEBOUNCE;
-
return PACKET_UNKNOWN;
}
Thanks.
--
Dmitry
next prev parent reply other threads:[~2011-08-25 7:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 5:44 [PATCH v2 0/7] Input: elantech: add support for newer hardware JJ Ding
2011-08-24 5:44 ` [PATCH v2 1/7] Input: elantech - correct x, y value range for v2 hardware JJ Ding
2011-08-24 5:44 ` [PATCH v2 2/7] Input: elantech - get rid of ETP_2FT_* in elantech.h JJ Ding
2011-08-24 5:44 ` [PATCH v2 3/7] Input: elantech - use firmware provided x, y ranges JJ Ding
2011-08-24 5:44 ` [PATCH v2 4/7] Input: elantech - remove ETP_EDGE_FUZZ_V2 JJ Ding
2011-08-24 5:44 ` [PATCH v2 5/7] Input: elantech - packet checking for v2 hardware JJ Ding
2011-08-24 5:44 ` [PATCH v2 6/7] Input: elantech - clean up elantech_init JJ Ding
2011-08-24 5:44 ` [PATCH v2 7/7] Input: elantech - add v3 hardware support JJ Ding
2011-08-24 14:35 ` Seth Forshee
2011-08-25 1:09 ` JJ Ding
2011-08-25 7:06 ` Dmitry Torokhov [this message]
2011-08-25 8:22 ` JJ Ding
-- strict thread matches above, loose matches on Subject: below --
2011-08-24 5:38 [PATCH v2 0/7] Input: elantech: add support for newer hardware JJ Ding
2011-08-24 5:38 ` [PATCH v2 7/7] Input: elantech - add v3 hardware support JJ Ding
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=20110825070642.GB15655@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=E.A.B.Piel@tudelft.nl \
--cc=aaron_huang@emc.com.tw \
--cc=chase.douglas@canonical.com \
--cc=djkurtz@chromium.org \
--cc=jj_ding@emc.com.tw \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rubini@cvml.unipv.it \
--cc=rydberg@euromail.se \
--cc=seth.forshee@canonical.com \
--cc=tom_lin@emc.com.tw \
/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®