From: "Éric Piel" <E.A.B.Piel@tudelft.nl>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Florian Ragwitz <rafl@debian.org>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: [NEEDS TEST][PATCH] elantech: discard the first 2 positions reports for some firmwares
Date: Sun, 30 May 2010 20:42:21 +0200 [thread overview]
Message-ID: <4C02B18D.3050003@tudelft.nl> (raw)
Hello,
Here is a patch to implement a better workaround for the "jumpy cursor"
behaviour. Unfortunately, as I don't have such hardware, this is totally
untested (will, it compiles ;-) ). Hopefully, someone around has access
to such hardware and can test it. Or maybe Florian, or Dmitry, you know
such people?
Cheers,
Eric
8<-------------------------------------------------------
According to the Dell/Ubuntu driver, what was previously observed as "jumpy cursor"
corresponds to the hardware sending incorrect data for the first two reports of a
one touch finger. So let's use the same workaround as in the other driver. Also,
detect another firmware version with the same behaviour, as in the other driver.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
---
drivers/input/mouse/elantech.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index b18862b..1c1d065 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
struct elantech_data *etd = psmouse->private;
unsigned char *packet = psmouse->packet;
int fingers;
- static int old_fingers;
+ static int one_finger_reports;
if (etd->fw_version < 0x020000) {
/*
@@ -203,11 +203,13 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
}
if (etd->jumpy_cursor) {
- /* Discard packets that are likely to have bogus coordinates */
- if (fingers > old_fingers) {
+ if ((fingers == 1) && (one_finger_reports < 2)) {
+ /* Discard first 2 reports of one finger, bogus */
+ one_finger_reports++;
elantech_debug("discarding packet\n");
- goto discard_packet_v1;
- }
+ return;
+ } else if (fingers != 1)
+ one_finger_reports = 0;
}
input_report_key(dev, BTN_TOUCH, fingers != 0);
@@ -238,9 +240,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
}
input_sync(dev);
-
- discard_packet_v1:
- old_fingers = fingers;
}
/*
@@ -733,12 +732,12 @@ int elantech_init(struct psmouse *psmouse)
etd->capabilities = param[0];
/*
- * This firmware seems to suffer from misreporting coordinates when
+ * This firmware suffers from misreporting coordinates when
* a touch action starts causing the mouse cursor or scrolled page
* to jump. Enable a workaround.
*/
- if (etd->fw_version == 0x020022) {
- pr_info("firmware version 2.0.34 detected, enabling jumpy cursor workaround\n");
+ if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) {
+ pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
etd->jumpy_cursor = 1;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2010-05-30 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-30 18:42 Éric Piel [this message]
2010-05-30 18:11 ` [NEEDS TEST][PATCH] elantech: discard the first 2 positions reports for some firmwares Chase Douglas
2010-05-30 18:26 ` Dmitry Torokhov
2010-05-30 18:55 ` Chase Douglas
2010-05-30 20:12 ` Dmitry Torokhov
2010-05-30 20:29 ` Chase Douglas
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=4C02B18D.3050003@tudelft.nl \
--to=e.a.b.piel@tudelft.nl \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=rafl@debian.org \
/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.