Lines Matching refs:pkt
77 int (*get_pkt_len) (unsigned char *pkt, int len);
79 int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt);
105 void (*process_pkt)(struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);
129 static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in e2i_read_data() argument
131 int tmp = (pkt[0] << 8) | pkt[1]; in e2i_read_data()
132 dev->x = (pkt[2] << 8) | pkt[3]; in e2i_read_data()
133 dev->y = (pkt[4] << 8) | pkt[5]; in e2i_read_data()
200 static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in egalax_read_data() argument
202 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) in egalax_read_data()
205 dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); in egalax_read_data()
206 dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); in egalax_read_data()
207 dev->touch = pkt[0] & 0x01; in egalax_read_data()
255 static int etouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in etouch_read_data() argument
257 if ((pkt[0] & ETOUCH_PKT_TYPE_MASK) != ETOUCH_PKT_TYPE_REPT && in etouch_read_data()
258 (pkt[0] & ETOUCH_PKT_TYPE_MASK) != ETOUCH_PKT_TYPE_REPT2) in etouch_read_data()
261 dev->x = ((pkt[1] & 0x1F) << 7) | (pkt[2] & 0x7F); in etouch_read_data()
262 dev->y = ((pkt[3] & 0x1F) << 7) | (pkt[4] & 0x7F); in etouch_read_data()
263 dev->touch = pkt[0] & 0x01; in etouch_read_data()
300 static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in panjit_read_data() argument
302 dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; in panjit_read_data()
303 dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3]; in panjit_read_data()
304 dev->touch = pkt[0] & 0x01; in panjit_read_data()
331 static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in mtouch_read_data() argument
334 dev->x = (pkt[4] << 8) | pkt[3]; in mtouch_read_data()
335 dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]); in mtouch_read_data()
337 dev->x = (pkt[8] << 8) | pkt[7]; in mtouch_read_data()
338 dev->y = (pkt[10] << 8) | pkt[9]; in mtouch_read_data()
340 dev->touch = (pkt[2] & 0x40) ? 1 : 0; in mtouch_read_data()
490 static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in itm_read_data() argument
499 dev->press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); in itm_read_data()
501 touch = ~pkt[7] & 0x20; in itm_read_data()
511 dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); in itm_read_data()
512 dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); in itm_read_data()
537 static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in eturbo_read_data() argument
542 if (!(pkt[0] & 0x80)) in eturbo_read_data()
545 shift = (6 - (pkt[0] & 0x03)); in eturbo_read_data()
546 dev->x = ((pkt[3] << 7) | pkt[4]) >> shift; in eturbo_read_data()
547 dev->y = ((pkt[1] << 7) | pkt[2]) >> shift; in eturbo_read_data()
548 dev->touch = (pkt[0] & 0x10) ? 1 : 0; in eturbo_read_data()
578 static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in gunze_read_data() argument
580 if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) in gunze_read_data()
583 dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); in gunze_read_data()
584 dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); in gunze_read_data()
585 dev->touch = pkt[0] & 0x20; in gunze_read_data()
666 static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in dmc_tsc10_read_data() argument
668 dev->x = ((pkt[2] & 0x03) << 8) | pkt[1]; in dmc_tsc10_read_data()
669 dev->y = ((pkt[4] & 0x03) << 8) | pkt[3]; in dmc_tsc10_read_data()
670 dev->touch = pkt[0] & 0x01; in dmc_tsc10_read_data()
691 static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in irtouch_read_data() argument
693 dev->x = (pkt[3] << 8) | pkt[2]; in irtouch_read_data()
694 dev->y = (pkt[5] << 8) | pkt[4]; in irtouch_read_data()
695 dev->touch = (pkt[1] & 0x03) ? 1 : 0; in irtouch_read_data()
723 static int tc45usb_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in tc45usb_read_data() argument
725 dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; in tc45usb_read_data()
726 dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3]; in tc45usb_read_data()
727 dev->touch = pkt[0] & 0x01; in tc45usb_read_data()
758 static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in idealtek_read_data() argument
760 switch (pkt[0] & 0x98) { in idealtek_read_data()
763 dev->x = (pkt[1] << 5) | (pkt[2] >> 2); in idealtek_read_data()
764 dev->y = (pkt[3] << 5) | (pkt[4] >> 2); in idealtek_read_data()
765 dev->touch = (pkt[0] & 0x40) ? 1 : 0; in idealtek_read_data()
770 dev->x = (pkt[2] << 5) | (pkt[1] >> 2); in idealtek_read_data()
771 dev->y = (pkt[4] << 5) | (pkt[3] >> 2); in idealtek_read_data()
772 dev->touch = (pkt[0] & 0x40) ? 1 : 0; in idealtek_read_data()
795 static int general_touch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in general_touch_read_data() argument
797 dev->x = (pkt[2] << 8) | pkt[1]; in general_touch_read_data()
798 dev->y = (pkt[4] << 8) | pkt[3]; in general_touch_read_data()
799 dev->press = pkt[5] & 0xff; in general_touch_read_data()
800 dev->touch = pkt[0] & 0x01; in general_touch_read_data()
819 static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in gotop_read_data() argument
821 dev->x = ((pkt[1] & 0x38) << 4) | pkt[2]; in gotop_read_data()
822 dev->y = ((pkt[1] & 0x07) << 7) | pkt[3]; in gotop_read_data()
823 dev->touch = pkt[0] & 0x01; in gotop_read_data()
842 static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in jastec_read_data() argument
844 dev->x = ((pkt[0] & 0x3f) << 6) | (pkt[2] & 0x3f); in jastec_read_data()
845 dev->y = ((pkt[1] & 0x3f) << 6) | (pkt[3] & 0x3f); in jastec_read_data()
846 dev->touch = (pkt[0] & 0x40) >> 6; in jastec_read_data()
865 static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in zytronic_read_data() argument
869 switch (pkt[0]) { in zytronic_read_data()
871 dev_dbg(&intf->dev, "%s: Command response %d\n", __func__, pkt[1]); in zytronic_read_data()
875 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); in zytronic_read_data()
876 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); in zytronic_read_data()
882 dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); in zytronic_read_data()
883 dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); in zytronic_read_data()
889 dev_dbg(&intf->dev, "%s: Unknown return %d\n", __func__, pkt[0]); in zytronic_read_data()
1054 static int nexio_read_data(struct usbtouch_usb *usbtouch, unsigned char *pkt) in nexio_read_data() argument
1057 struct nexio_touch_packet *packet = (void *) pkt; in nexio_read_data()
1065 if ((pkt[0] & 0xe0) != 0xe0) in nexio_read_data()
1155 static int elo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) in elo_read_data() argument
1157 dev->x = (pkt[3] << 8) | pkt[2]; in elo_read_data()
1158 dev->y = (pkt[5] << 8) | pkt[4]; in elo_read_data()
1159 dev->touch = pkt[6] > 0; in elo_read_data()
1160 dev->press = pkt[6]; in elo_read_data()
1181 unsigned char *pkt, int len) in usbtouch_process_pkt() argument
1185 if (!type->read_data(usbtouch, pkt)) in usbtouch_process_pkt()
1205 unsigned char *pkt, int len) in usbtouch_process_multi() argument
1227 memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, append); in usbtouch_process_multi()
1240 memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, tmp); in usbtouch_process_multi()
1243 buffer = pkt + tmp; in usbtouch_process_multi()
1246 buffer = pkt; in usbtouch_process_multi()
1281 unsigned char *pkt, int len) in usbtouch_process_multi() argument