@@ -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