diff mbox

hack for Lilliput 669GL-70NP/C/T 7" USB touchscreen

Message ID 1272307701.19363.69.camel@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Hollis Blanchard April 26, 2010, 6:48 p.m. UTC
None
diff mbox

Patch

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