From: "Éric Piel" <E.A.B.Piel@tudelft.nl>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Cc: Florian Ragwitz <rafl@debian.org>
Subject: [PATCH 3/7] elantech: distinguish various hardware/firmware versions
Date: Mon, 21 Jun 2010 23:03:21 +0200 [thread overview]
Message-ID: <4C1FD399.4000500@tudelft.nl> (raw)
In-Reply-To: <4C1FD2B0.1080504@tudelft.nl>
According to the protocol document, there are a couple of different
versions of the hardware and firmware. Using the version number, it
should be possible to distinguish between them, at least for the
properties we care about.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
---
drivers/input/mouse/elantech.c | 34 +++++++++++++++++++++-------------
drivers/input/mouse/elantech.h | 10 +++++++++-
2 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 1c1d065..f32ffda 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -709,15 +709,32 @@ int elantech_init(struct psmouse *psmouse)
* Assume every version greater than this is new EeePC style
* hardware with 6 byte packets
*/
- if (etd->fw_version >= 0x020030) {
+ if (etd->fw_version >= 0x020800) {
etd->hw_version = 2;
/* For now show extra debug information */
etd->debug = 1;
- /* Parity check is only for 4 byte protocol */
- etd->paritycheck = 0;
+ etd->paritycheck = ETP_CONST_CHECK;
+ etd->reports_pres = 1;
+ } else if (etd->fw_version == 0x020030) {
+ etd->hw_version = 2;
+ /* For now show extra debug information */
+ etd->debug = 1;
+ etd->paritycheck = ETP_EF113_CHECK;
+ etd->reports_pres = 0;
+ } else if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) {
+ /*
+ * This firmware suffers from misreporting coordinates when
+ * a touch action starts causing the mouse cursor or scrolled page
+ * to jump. Enable a workaround.
+ */
+ pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
+ etd->jumpy_cursor = 1;
+ etd->debug = 1;
+ etd->hw_version = 1;
+ etd->paritycheck = ETP_FULL_PC;
} else {
etd->hw_version = 1;
- etd->paritycheck = 1;
+ etd->paritycheck = ETP_FULL_PC;
}
pr_info("assuming hardware version %d, firmware version %d.%d.%d\n",
@@ -731,15 +748,6 @@ int elantech_init(struct psmouse *psmouse)
param[0], param[1], param[2]);
etd->capabilities = param[0];
- /*
- * 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) || (etd->fw_version == 0x020600)) {
- pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
- etd->jumpy_cursor = 1;
- }
if (elantech_set_absolute_mode(psmouse)) {
pr_err("failed to put touchpad into absolute mode.\n");
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index ac57bde..b98c3c2 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -101,12 +101,20 @@ struct elantech_data {
unsigned char debug;
unsigned char capabilities;
unsigned char paritycheck;
- unsigned char jumpy_cursor;
+ unsigned char jumpy_cursor :1;
+ unsigned char reports_pres :1;
unsigned char hw_version;
unsigned int fw_version;
unsigned char parity[256];
};
+enum paritycheck_types {
+ ETP_NOT_CHECK = 0,
+ ETP_FULL_PC, /* used in 4-byte protocol */
+ ETP_EF113_CHECK, /* check used only on the EF113 */
+ ETP_CONST_CHECK, /* used in 6-byte protocol, only checking constant bits */
+};
+
#ifdef CONFIG_MOUSE_PS2_ELANTECH
int elantech_detect(struct psmouse *psmouse, bool set_properties);
int elantech_init(struct psmouse *psmouse);
--
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 prev parent reply other threads:[~2010-06-21 21:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-21 20:59 [PATCH 0/7] elantech: various improvements for 6-byte protocol Éric Piel
2010-06-21 21:01 ` [PATCH 1/7] elantech: Describe further the protocol Éric Piel
2010-06-21 21:02 ` [PATCH 2/7] [NEEDS TEST] elantech: discard the first 2 positions reports for some firmwares Éric Piel
2010-06-21 21:03 ` Éric Piel [this message]
2010-06-21 21:04 ` [PATCH 4/7] elantech: implement data check for 6-byte protocol Éric Piel
2010-06-21 21:05 ` [PATCH 6/7] elantech: export pressure and width when supported Éric Piel
2010-06-21 21:06 ` [PATCH 7/7] elantech: average the two coordinates when 2 fingers Éric Piel
2010-07-21 3:36 ` Dmitry Torokhov
2010-07-30 18:55 ` Éric Piel
2010-07-30 21:01 ` Henrik Rydberg
2010-07-30 21:41 ` Éric Piel
2010-07-31 9:28 ` Henrik Rydberg
2010-07-31 9:33 ` Dmitry Torokhov
2010-07-31 12:49 ` Henrik Rydberg
2010-07-31 23:00 ` Éric Piel
2010-08-01 7:52 ` Henrik Rydberg
2010-07-31 19:56 ` Chris Bagwell
[not found] ` <AANLkTi=cEEx-5eQPbRYvMMaECvXKQ+i-e0Eaw_g4JY7=@mail.gmail.com>
2010-07-31 23:04 ` Éric Piel
2010-08-01 9:37 ` Henrik Rydberg
2010-08-01 11:28 ` Éric Piel
2010-08-01 13:57 ` Henrik Rydberg
2010-08-02 8:17 ` Éric Piel
2010-08-02 10:02 ` Henrik Rydberg
2010-08-02 11:12 ` Éric Piel
2010-08-02 11:22 ` Henrik Rydberg
2010-08-02 11:33 ` Éric Piel
2010-08-02 11:46 ` Henrik Rydberg
2010-08-02 12:13 ` Éric Piel
2010-08-02 12:29 ` Henrik Rydberg
2010-08-02 12:46 ` Éric Piel
2010-08-02 13:03 ` Henrik Rydberg
2010-08-02 13:23 ` Éric Piel
2010-08-02 14:12 ` Henrik Rydberg
2010-08-02 16:39 ` Dmitry Torokhov
2010-08-02 17:15 ` Henrik Rydberg
2010-08-08 22:51 ` Éric Piel
2010-08-08 22:52 ` [PATCH 07/10] elantech: Report multitouch with proper ABS_MT messages Éric Piel
2010-08-08 22:53 ` [PATCH 08/10] elantech: track finger to distinguish coordinates in 2-finger report Éric Piel
2010-08-08 22:54 ` [PATCH 09/10] elantech: remove support for proprietary X driver Éric Piel
2010-08-08 22:55 ` [PATCH 10/10] elantech: don't take into account the border size in the calculations Éric Piel
2010-08-02 16:26 ` [PATCH 7/7] elantech: average the two coordinates when 2 fingers Dmitry Torokhov
2010-08-02 17:05 ` Henrik Rydberg
2010-08-01 7:36 ` Henrik Rydberg
2010-06-21 21:07 ` [PATCH 5/7] elantech: report position also with 3 fingers Éric Piel
2010-07-21 3:38 ` Dmitry Torokhov
2010-07-30 18:37 ` Éric Piel
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=4C1FD399.4000500@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.