linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollis_blanchard@mentor.com>
To: Daniel Ritz <daniel.ritz-ml@swissonline.ch>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: hack for Lilliput 669GL-70NP/C/T 7" USB touchscreen
Date: Mon, 26 Apr 2010 11:48:21 -0700	[thread overview]
Message-ID: <1272307701.19363.69.camel@localhost.localdomain> (raw)

I've been working with a Lilliput 7" USB touchscreen (model
669GL-70NP/C/T), and discovered that while usbtouchscreen.c claims to
support its USB ID, the driver didn't actually work.

Here is the lsusb output:

Bus 001 Device 003: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0eef D-WAV Scientific Co., Ltd
  idProduct          0x0001 eGalax TouchScreen
  bcdDevice            1.00
  iManufacturer           1 eGalax Inc.
  iProduct                2 USB TouchController
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength         8704
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          1 eGalax Inc.
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
      ** UNRECOGNIZED:  09 21 10 02 00 01 22 8d 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0800  2x 0 bytes
        bInterval               3
Device Status:     0x0000
  (Bus Powered)

After dumping the incoming bytestream, here is the hack I made to
usbtouchscreen.c to actually register touches correctly. I haven't tried
to clean it up because I'm not sure what the real problem is. It sounds
like this device is not expected to work with the standard usbhid driver
(and it doesn't), but neither does it work with usbtouchscreen.c. I
really don't know anything about USB, but I could figure out how to
interpret this 6-byte packet...

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 68ece58..e9597fa 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -252,6 +252,7 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned 
 #define EGALAX_PKT_TYPE_REPT           0x80
 #define EGALAX_PKT_TYPE_DIAG           0x0A
 
+#if 0
 static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 {
        if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT)
@@ -279,6 +280,34 @@ static int egalax_get_pkt_len(unsigned char *buf, int len)
 
        return 0;
 }
+
+#else
+
+static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+{
+       if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != 2)
+               return 0;
+
+       dev->x = (pkt[5] << 8) | pkt[4];
+       dev->y = (pkt[3] << 8) | pkt[2];
+       dev->touch = pkt[1] & 0x01;
+
+       return 1;
+}
+
+static int egalax_get_pkt_len(unsigned char *buf, int len)
+{
+       switch (buf[0] & EGALAX_PKT_TYPE_MASK) {
+       case 2:
+               return 6;
+       default:
+               printk(KERN_WARNING "%s: unknown packet type 0x%x\n", __func__, buf[0]);
+       }
+
+       return 0;
+}
+#endif
+
 #endif
 
 
Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>

Comments?

-- 
Hollis Blanchard
Mentor Graphics, Embedded Systems Division

                 reply	other threads:[~2010-04-26 18:48 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=1272307701.19363.69.camel@localhost.localdomain \
    --to=hollis_blanchard@mentor.com \
    --cc=daniel.ritz-ml@swissonline.ch \
    --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).