linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb touch screen of Mimo 720 has x,y rotated 180 degrees
@ 2012-02-22 21:18 shawn
  0 siblings, 0 replies; only message in thread
From: shawn @ 2012-02-22 21:18 UTC (permalink / raw)
  To: linux-input

[-- 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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-22 21:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22 21:18 usb touch screen of Mimo 720 has x,y rotated 180 degrees shawn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).