linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alastair Bridgewater <nyef@lisphacker.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] input: Add support for eGalax TouchKit USB touchscreen used on HP tx1305us
Date: Fri, 27 Jun 2008 21:36:47 -0400	[thread overview]
Message-ID: <486595AF.7040103@lisphacker.com> (raw)

The eGalax touchscreen used in the HP tx1305us tablet PC (and presumably 
the rest of the tx1000 series) uses a different format for events from 
the device than the existing driver supports.

Add a new device description and interrupt packet handler for the 
touchscreen used in the tx1305us, claiming the USB device ID for the 
device that this patch was tested with from the older eGalax device code.

Signed-off-by: Alastair Bridgewater <nyef@lisphacker.com>

---

Applies clean with linux-2.6.25 and linux-2.6.26-rc6.

--- linux-2.6.26-rc6/drivers/input/touchscreen/usbtouchscreen.c   
 2008-06-27 20:34:34.886969800 -0400
+++ linux-2.6.25/drivers/input/touchscreen/usbtouchscreen.c   
 2008-06-06 12:19:16.460568440 -0400
@@ -103,6 +103,7 @@ struct usbtouch_usb {
 enum {
     DEVTPYE_DUMMY = -1,
     DEVTYPE_EGALAX,
+    DEVTYPE_EGALAX2,
     DEVTYPE_PANJIT,
     DEVTYPE_3M,
     DEVTYPE_ITM,
@@ -120,7 +121,7 @@ static struct usb_device_id usbtouch_dev
     {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX},
     {USB_DEVICE(0x3823, 0x0002), .driver_info = DEVTYPE_EGALAX},
     {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX},
-    {USB_DEVICE(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX},
+    {USB_DEVICE(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX2},
     {USB_DEVICE(0x0eef, 0x0002), .driver_info = DEVTYPE_EGALAX},
     {USB_DEVICE(0x1234, 0x0001), .driver_info = DEVTYPE_EGALAX},
     {USB_DEVICE(0x1234, 0x0002), .driver_info = DEVTYPE_EGALAX},
@@ -217,6 +218,15 @@ static int egalax_get_pkt_len(unsigned c
 
     return 0;
 }
+
+static int egalax2_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+{
+    dev->x = ((pkt[3] & 0x0F) << 8) | pkt[2];
+    dev->y = ((pkt[5] & 0x0F) << 8) | pkt[4];
+    dev->touch = pkt[1] & 0x01;
+
+    return 1;
+}
 #endif
 
 
@@ -555,6 +565,15 @@ static struct usbtouch_device_info usbto
         .get_pkt_len    = egalax_get_pkt_len,
         .read_data    = egalax_read_data,
     },
+
+    [DEVTYPE_EGALAX2] = {
+        .min_xc        = 0x0,
+        .max_xc        = 0x0fff,
+        .min_yc        = 0x0,
+        .max_yc        = 0x0fff,
+        .rept_size    = 8,
+        .read_data    = egalax2_read_data,
+    },
 #endif
 
 #ifdef CONFIG_TOUCHSCREEN_USB_PANJIT


             reply	other threads:[~2008-06-28  1:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-28  1:36 Alastair Bridgewater [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-28 15:19 [PATCH] input: Add support for eGalax TouchKit USB touchscreen used on HP tx1305us Daniel Ritz
2008-06-28 15:57 ` Daniel Ritz
2008-06-28 18:18   ` Alastair Bridgewater
2008-06-30 15:23     ` Dmitry Torokhov
2008-06-30 20:18       ` Daniel Ritz
2008-06-30 20:24         ` Dmitry Torokhov
2008-07-01 19:49           ` Daniel Ritz

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=486595AF.7040103@lisphacker.com \
    --to=nyef@lisphacker.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).