Linux Input/HID development
 help / color / mirror / Atom feed
From: shawn <shawnlandden@gmail.com>
To: linux-input@vger.kernel.org
Subject: usb touch screen of Mimo 720 has x,y rotated 180 degrees
Date: Wed, 22 Feb 2012 13:18:54 -0800	[thread overview]
Message-ID: <1329945534.2237.13.camel@ssd-ubuntu> (raw)

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

I just got a Mimo 720 usb-only touchscreen. using module
"usbtouchscreen"
The x and y are rotated 180 deg.

While I initially thought the touch device used by usbtouchscreen.c was 
17e9:401a, it turns out it is is 1ac7:0001, which matches it's controller, but
is a problem as this may be the only model where x any y are 180 deg off.

The module has an option to rotate 90 deg, and with a 180 deg rotation parameter
we could support all possible rotations from mis-installations (if that is what this is).

Would it make sense to add a parameter to flip a usbtouchscreen 180 deg, and if so,
should that setting apply to every (or most) displays in the module, or just
this one where there is a backwards implamentations?
I see that some touchscreens already invert one or both of their axis' from the input.

Inc. patch that inverts _all_ e2i touchscreens. I came across this on 3.2.2

computer information: https://bugzilla.kernel.org/show_bug.cgi?id=42743

[-- Attachment #2: Type: text/plain, Size: 627 bytes --]

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 73fd664..a9f2303 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -265,8 +265,8 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
 static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 {
 	int tmp = (pkt[0] << 8) | pkt[1];
-	dev->x  = (pkt[2] << 8) | pkt[3];
-	dev->y  = (pkt[4] << 8) | pkt[5];
+	dev->x  = 0x7fff - ((pkt[2] << 8) | pkt[3]);
+	dev->y  = 0x7fff - ((pkt[4] << 8) | pkt[5]);
 
 	tmp = tmp - 0xA000;
 	dev->touch = (tmp > 0);

                 reply	other threads:[~2012-02-22 21:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1329945534.2237.13.camel@ssd-ubuntu \
    --to=shawnlandden@gmail.com \
    --cc=linux-input@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox