All of lore.kernel.org
 help / color / mirror / Atom feed
From: JJ Ding <jj_ding@emc.com.tw>
To: "Richard Schütz" <r.schtz@t-online.de>, linux-input@vger.kernel.org
Cc: Aaron Huang <aaron_huang@emc.com.tw>, Tom Lin <tom_lin@emc.com.tw>
Subject: Re: elantech touchpad issues
Date: Thu, 08 Sep 2011 12:18:08 +0800	[thread overview]
Message-ID: <87sjo7oef3.fsf@emc.com.tw> (raw)
In-Reply-To: <4E6633E5.6080108@t-online.de>

Hi Richard,

It turns out that v2 hardware has debounce packet, too. But with
different signature compared to v3. To the best of my knowledge, I can
only say some models of v2 hardware have this, and others don't. So we
always check for debounce.

Please test this patch and see if it works for you.
Please apply this on up of my v5 series.

Thanks
---
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 38fb155..1e5ea1d 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -613,6 +613,13 @@ static int elantech_packet_check_v1(struct psmouse *psmouse)
 	       etd->parity[packet[3]] == p3;
 }
 
+static int elantech_check_debounce_v2(struct psmouse *psmouse)
+{
+	const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
+	unsigned char *packet = psmouse->packet;
+	return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
+}
+
 static int elantech_packet_check_v2(struct psmouse *psmouse)
 {
 	struct elantech_data *etd = psmouse->private;
@@ -708,6 +715,9 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
 		break;
 
 	case 2:
+		if (elantech_check_debounce_v2(psmouse))
+			return PSMOUSE_FULL_PACKET;
+
 		if (etd->paritycheck && !elantech_packet_check_v2(psmouse))
 			return PSMOUSE_BAD_DATA;
--
jj

  parent reply	other threads:[~2011-09-08  4:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 14:53 elantech touchpad issues Richard Schütz
2011-09-07  1:46 ` JJ Ding
2011-09-08  4:18 ` JJ Ding [this message]
2011-09-08 18:17   ` Richard Schütz
2011-09-12  8:42     ` Éric Piel
2011-09-12  9:57       ` Richard Schütz
2011-09-13  1:27       ` JJ Ding
  -- strict thread matches above, loose matches on Subject: below --
2011-01-23 14:12 Richard Schütz

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=87sjo7oef3.fsf@emc.com.tw \
    --to=jj_ding@emc.com.tw \
    --cc=aaron_huang@emc.com.tw \
    --cc=linux-input@vger.kernel.org \
    --cc=r.schtz@t-online.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.