• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/input/touchscreen/

Lines Matching defs:usbtouch

87 	void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);
97 int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt);
98 int (*alloc) (struct usbtouch_usb *usbtouch);
99 int (*init) (struct usbtouch_usb *usbtouch);
100 void (*exit) (struct usbtouch_usb *usbtouch);
103 /* a usbtouch device */
250 static int e2i_init(struct usbtouch_usb *usbtouch)
253 struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
361 static int mtouch_init(struct usbtouch_usb *usbtouch)
364 struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
391 input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0);
392 input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0);
508 static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
510 struct usb_device *dev = interface_to_usbdev(usbtouch->interface);
739 static int nexio_alloc(struct usbtouch_usb *usbtouch)
744 usbtouch->priv = kmalloc(sizeof(struct nexio_priv), GFP_KERNEL);
745 if (!usbtouch->priv)
748 priv = usbtouch->priv;
757 dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__);
771 static int nexio_init(struct usbtouch_usb *usbtouch)
773 struct usb_device *dev = interface_to_usbdev(usbtouch->interface);
774 struct usb_host_interface *interface = usbtouch->interface->cur_altsetting;
775 struct nexio_priv *priv = usbtouch->priv;
843 nexio_ack_complete, usbtouch);
851 static void nexio_exit(struct usbtouch_usb *usbtouch)
853 struct nexio_priv *priv = usbtouch->priv;
861 static int nexio_read_data(struct usbtouch_usb *usbtouch, unsigned char *pkt)
864 struct nexio_priv *priv = usbtouch->priv;
882 if (!usbtouch->type->max_xc) {
883 usbtouch->type->max_xc = 2 * x_len;
884 input_set_abs_params(usbtouch->input, ABS_X,
885 0, usbtouch->type->max_xc, 0, 0);
886 usbtouch->type->max_yc = 2 * y_len;
887 input_set_abs_params(usbtouch->input, ABS_Y,
888 0, usbtouch->type->max_yc, 0, 0);
916 usbtouch->x = 2 * begin_x + w;
917 usbtouch->y = 2 * begin_y + h;
918 usbtouch->touch = packet->flags & 0x01;
936 static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
1133 static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch,
1136 struct usbtouch_device_info *type = usbtouch->type;
1138 if (!type->read_data(usbtouch, pkt))
1141 input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch);
1144 input_report_abs(usbtouch->input, ABS_X, usbtouch->y);
1145 input_report_abs(usbtouch->input, ABS_Y, usbtouch->x);
1147 input_report_abs(usbtouch->input, ABS_X, usbtouch->x);
1148 input_report_abs(usbtouch->input, ABS_Y, usbtouch->y);
1151 input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press);
1152 input_sync(usbtouch->input);
1157 static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
1164 if (unlikely(usbtouch->buf_len)) {
1166 pkt_len = usbtouch->type->get_pkt_len(
1167 usbtouch->buffer, usbtouch->buf_len);
1178 if (usbtouch->buf_len + append >= usbtouch->type->rept_size)
1180 memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, append);
1181 usbtouch->buf_len += append;
1183 pkt_len = usbtouch->type->get_pkt_len(
1184 usbtouch->buffer, usbtouch->buf_len);
1190 tmp = pkt_len - usbtouch->buf_len;
1191 if (usbtouch->buf_len + tmp >= usbtouch->type->rept_size)
1193 memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, tmp);
1194 usbtouch_process_pkt(usbtouch, usbtouch->buffer, pkt_len);
1207 pkt_len = usbtouch->type->get_pkt_len(buffer + pos,
1218 usbtouch_process_pkt(usbtouch, buffer + pos, pkt_len);
1221 memcpy(usbtouch->buffer, buffer + pos, buf_len - pos);
1222 usbtouch->buf_len = buf_len - pos;
1229 usbtouch->buf_len = 0;
1237 struct usbtouch_usb *usbtouch = urb->context;
1263 usbtouch->type->process_pkt(usbtouch, usbtouch->data, urb->actual_length);
1266 usb_mark_last_busy(interface_to_usbdev(usbtouch->interface));
1275 struct usbtouch_usb *usbtouch = input_get_drvdata(input);
1278 usbtouch->irq->dev = interface_to_usbdev(usbtouch->interface);
1280 r = usb_autopm_get_interface(usbtouch->interface) ? -EIO : 0;
1284 if (!usbtouch->type->irq_always) {
1285 if (usb_submit_urb(usbtouch->irq, GFP_KERNEL)) {
1291 usbtouch->interface->needs_remote_wakeup = 1;
1293 usb_autopm_put_interface(usbtouch->interface);
1300 struct usbtouch_usb *usbtouch = input_get_drvdata(input);
1303 if (!usbtouch->type->irq_always)
1304 usb_kill_urb(usbtouch->irq);
1305 r = usb_autopm_get_interface(usbtouch->interface);
1306 usbtouch->interface->needs_remote_wakeup = 0;
1308 usb_autopm_put_interface(usbtouch->interface);
1314 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1316 usb_kill_urb(usbtouch->irq);
1323 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1324 struct input_dev *input = usbtouch->input;
1328 if (input->users || usbtouch->type->irq_always)
1329 result = usb_submit_urb(usbtouch->irq, GFP_NOIO);
1337 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1338 struct input_dev *input = usbtouch->input;
1342 if (usbtouch->type->init) {
1343 err = usbtouch->type->init(usbtouch);
1354 err = usb_submit_urb(usbtouch->irq, GFP_NOIO);
1361 struct usbtouch_usb *usbtouch)
1363 usb_free_coherent(udev, usbtouch->type->rept_size,
1364 usbtouch->data, usbtouch->data_dma);
1365 kfree(usbtouch->buffer);
1383 struct usbtouch_usb *usbtouch;
1398 usbtouch = kzalloc(sizeof(struct usbtouch_usb), GFP_KERNEL);
1400 if (!usbtouch || !input_dev)
1404 usbtouch->type = type;
1408 usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
1409 GFP_KERNEL, &usbtouch->data_dma);
1410 if (!usbtouch->data)
1414 usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL);
1415 if (!usbtouch->buffer)
1419 usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
1420 if (!usbtouch->irq) {
1421 dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__);
1425 usbtouch->interface = intf;
1426 usbtouch->input = input_dev;
1429 strlcpy(usbtouch->name, udev->manufacturer, sizeof(usbtouch->name));
1433 strlcat(usbtouch->name, " ", sizeof(usbtouch->name));
1434 strlcat(usbtouch->name, udev->product, sizeof(usbtouch->name));
1437 if (!strlen(usbtouch->name))
1438 snprintf(usbtouch->name, sizeof(usbtouch->name),
1443 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
1444 strlcat(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
1446 input_dev->name = usbtouch->name;
1447 input_dev->phys = usbtouch->phys;
1451 input_set_drvdata(input_dev, usbtouch);
1465 usb_fill_int_urb(usbtouch->irq, udev,
1467 usbtouch->data, type->rept_size,
1468 usbtouch_irq, usbtouch, endpoint->bInterval);
1470 usb_fill_bulk_urb(usbtouch->irq, udev,
1472 usbtouch->data, type->rept_size,
1473 usbtouch_irq, usbtouch);
1475 usbtouch->irq->dev = udev;
1476 usbtouch->irq->transfer_dma = usbtouch->data_dma;
1477 usbtouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1481 err = type->alloc(usbtouch);
1490 err = type->init(usbtouch);
1497 err = input_register_device(usbtouch->input);
1503 usb_set_intfdata(intf, usbtouch);
1505 if (usbtouch->type->irq_always) {
1508 err = usb_submit_urb(usbtouch->irq, GFP_KERNEL);
1524 type->exit(usbtouch);
1526 usb_free_urb(usbtouch->irq);
1528 usbtouch_free_buffers(udev, usbtouch);
1531 kfree(usbtouch);
1537 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1541 if (!usbtouch)
1544 dbg("%s - usbtouch is initialized, cleaning up", __func__);
1547 input_unregister_device(usbtouch->input);
1548 usb_free_urb(usbtouch->irq);
1549 if (usbtouch->type->exit)
1550 usbtouch->type->exit(usbtouch);
1551 usbtouch_free_buffers(interface_to_usbdev(intf), usbtouch);
1552 kfree(usbtouch);