From: "Éric Piel" <E.A.B.Piel@tudelft.nl>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Florian Ragwitz <rafl@debian.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
Henrik Rydberg <rydberg@euromail.se>
Subject: Re: [PATCH 2/2 v3] elantech: Report multitouch with proper ABS_MT messages
Date: Mon, 10 May 2010 22:11:50 +0200 [thread overview]
Message-ID: <4BE86886.2080909@tudelft.nl> (raw)
In-Reply-To: <4BE593AA.6040408@tudelft.nl>
Here is an updated version of the patch. It is identical to the previous
version but rediff'd against the lastest version of patch 1.
Eric
8<-------------------------------------------------------
Multitouch info was reported only via a old protocol used by the
proprietary X driver from elantech. Let's report the multitouch info
also following the official MT protocol.
This was done following the multi-touch-protocol.txt documentation, and
inspired by the bcm5974 implementation. Testing was light as there is
not many applications using this protocol yet, but the X synaptics
driver didn't complain and the X multitouch driver behaved correctly.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
---
drivers/input/mouse/elantech.c | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 3dceb0f..a226f21 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -271,15 +271,20 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
* byte 3: . . w1 w0 . . . .
*/
width = ((packet[1] & 0xf0) >> 2) | ((packet[3] & 0x30) >> 4);
- input_report_abs(dev, ABS_TOOL_WIDTH, width);
- input_report_abs(dev, ABS_X,
- ((packet[1] & 0x07) << 8) | packet[2]);
+ x1 = ((packet[1] & 0x07) << 8) | packet[2];
/*
* byte 4: . . . . . . y9 y8
* byte 5: y7 y6 y5 y4 y3 y2 y1 y0
*/
- input_report_abs(dev, ABS_Y,
- ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]));
+ y1 = ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]);
+ /* Multitouch */
+ input_report_abs(dev, ABS_MT_POSITION_X, x1);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y1);
+ input_mt_sync(dev);
+
+ input_report_abs(dev, ABS_TOOL_WIDTH, width);
+ input_report_abs(dev, ABS_X, x1);
+ input_report_abs(dev, ABS_Y, y1);
break;
case 2:
@@ -299,6 +304,13 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
x2 = ((packet[3] & 0x10) << 4) | packet[4];
/* byte 5: by7 by6 by5 by4 by3 by2 by1 by0 */
y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]);
+ /* Multitouch */
+ input_report_abs(dev, ABS_MT_POSITION_X, x1 << 2);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y1 << 2);
+ input_mt_sync(dev);
+ input_report_abs(dev, ABS_MT_POSITION_X, x2 << 2);
+ input_report_abs(dev, ABS_MT_POSITION_Y, y2 << 2);
+ input_mt_sync(dev);
/*
* For compatibility with the X Synaptics driver scale up
* one coordinate and report as ordinary mouse movent
@@ -483,6 +495,8 @@ static void elantech_set_input_params(struct psmouse *psmouse)
input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2, ETP_WMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0);
+ input_set_abs_params(dev, ABS_MT_POSITION_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0);
+ input_set_abs_params(dev, ABS_MT_POSITION_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0);
input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0);
input_set_abs_params(dev, ABS_HAT0Y, ETP_2FT_YMIN, ETP_2FT_YMAX, 0, 0);
input_set_abs_params(dev, ABS_HAT1X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0);
--
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-05-10 20:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-08 16:39 [PATCH 2/2 v2] elantech: Report multitouch with proper ABS_MT messages Éric Piel
2010-05-10 20:11 ` Éric Piel [this message]
2010-05-10 20:53 ` [PATCH 2/2 v3] " Henrik Rydberg
2010-05-10 22:27 ` Éric Piel
2010-05-10 23:58 ` Henrik Rydberg
2010-05-11 0:11 ` Dmitry Torokhov
2010-05-11 0:48 ` Henrik Rydberg
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=4BE86886.2080909@tudelft.nl \
--to=e.a.b.piel@tudelft.nl \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=rafl@debian.org \
--cc=rydberg@euromail.se \
/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.