Lines Matching full:intr
360 struct zd_usb_interrupt *intr = &usb->intr; in handle_regs_int_override() local
363 spin_lock_irqsave(&intr->lock, flags); in handle_regs_int_override()
364 if (atomic_read(&intr->read_regs_enabled)) { in handle_regs_int_override()
365 atomic_set(&intr->read_regs_enabled, 0); in handle_regs_int_override()
366 intr->read_regs_int_overridden = 1; in handle_regs_int_override()
367 complete(&intr->read_regs.completion); in handle_regs_int_override()
369 spin_unlock_irqrestore(&intr->lock, flags); in handle_regs_int_override()
375 struct zd_usb_interrupt *intr = &usb->intr; in handle_regs_int() local
380 spin_lock_irqsave(&intr->lock, flags); in handle_regs_int()
390 } else if (atomic_read(&intr->read_regs_enabled)) { in handle_regs_int()
392 intr->read_regs.length = urb->actual_length; in handle_regs_int()
393 if (len > sizeof(intr->read_regs.buffer)) in handle_regs_int()
394 len = sizeof(intr->read_regs.buffer); in handle_regs_int()
396 memcpy(intr->read_regs.buffer, urb->transfer_buffer, len); in handle_regs_int()
404 if (!check_read_regs(usb, intr->read_regs.req, in handle_regs_int()
405 intr->read_regs.req_count)) in handle_regs_int()
408 atomic_set(&intr->read_regs_enabled, 0); in handle_regs_int()
409 intr->read_regs_int_overridden = 0; in handle_regs_int()
410 complete(&intr->read_regs.completion); in handle_regs_int()
416 spin_unlock_irqrestore(&intr->lock, flags); in handle_regs_int()
420 atomic_read(&intr->read_regs_enabled)) in handle_regs_int()
429 struct zd_usb_interrupt *intr; in int_urb_complete() local
462 intr = &usb->intr; in int_urb_complete()
463 if (hdr->id != USB_INT_ID_REGS && atomic_read(&intr->read_regs_enabled)) in int_urb_complete()
484 /* TODO: add worker to reset intr->urb */ in int_urb_complete()
505 struct zd_usb_interrupt *intr = &usb->intr; in usb_int_enabled() local
508 spin_lock_irqsave(&intr->lock, flags); in usb_int_enabled()
509 urb = intr->urb; in usb_int_enabled()
510 spin_unlock_irqrestore(&intr->lock, flags); in usb_int_enabled()
518 struct zd_usb_interrupt *intr = &usb->intr; in zd_usb_enable_int() local
530 spin_lock_irq(&intr->lock); in zd_usb_enable_int()
531 if (intr->urb) { in zd_usb_enable_int()
532 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
536 intr->urb = urb; in zd_usb_enable_int()
537 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
540 intr->buffer = usb_alloc_coherent(udev, USB_MAX_EP_INT_BUFFER, in zd_usb_enable_int()
541 GFP_KERNEL, &intr->buffer_dma); in zd_usb_enable_int()
542 if (!intr->buffer) { in zd_usb_enable_int()
549 intr->buffer, USB_MAX_EP_INT_BUFFER, in zd_usb_enable_int()
551 intr->interval); in zd_usb_enable_int()
552 urb->transfer_dma = intr->buffer_dma; in zd_usb_enable_int()
555 dev_dbg_f(zd_usb_dev(usb), "submit urb %p\n", intr->urb); in zd_usb_enable_int()
566 intr->buffer, intr->buffer_dma); in zd_usb_enable_int()
568 spin_lock_irq(&intr->lock); in zd_usb_enable_int()
569 intr->urb = NULL; in zd_usb_enable_int()
570 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
581 struct zd_usb_interrupt *intr = &usb->intr; in zd_usb_disable_int() local
586 spin_lock_irqsave(&intr->lock, flags); in zd_usb_disable_int()
587 urb = intr->urb; in zd_usb_disable_int()
589 spin_unlock_irqrestore(&intr->lock, flags); in zd_usb_disable_int()
592 intr->urb = NULL; in zd_usb_disable_int()
593 buffer = intr->buffer; in zd_usb_disable_int()
594 buffer_dma = intr->buffer_dma; in zd_usb_disable_int()
595 intr->buffer = NULL; in zd_usb_disable_int()
596 spin_unlock_irqrestore(&intr->lock, flags); in zd_usb_disable_int()
1158 struct zd_usb_interrupt *intr = &usb->intr; in init_usb_interrupt() local
1160 spin_lock_init(&intr->lock); in init_usb_interrupt()
1161 intr->interval = int_urb_interval(zd_usb_to_usbdev(usb)); in init_usb_interrupt()
1162 init_completion(&intr->read_regs.completion); in init_usb_interrupt()
1163 atomic_set(&intr->read_regs_enabled, 0); in init_usb_interrupt()
1164 intr->read_regs.cr_int_addr = cpu_to_le16((u16)CR_INTERRUPT); in init_usb_interrupt()
1602 struct zd_usb_interrupt *intr = &usb->intr; in prepare_read_regs_int() local
1604 spin_lock_irq(&intr->lock); in prepare_read_regs_int()
1605 atomic_set(&intr->read_regs_enabled, 1); in prepare_read_regs_int()
1606 intr->read_regs.req = req; in prepare_read_regs_int()
1607 intr->read_regs.req_count = count; in prepare_read_regs_int()
1608 reinit_completion(&intr->read_regs.completion); in prepare_read_regs_int()
1609 spin_unlock_irq(&intr->lock); in prepare_read_regs_int()
1614 struct zd_usb_interrupt *intr = &usb->intr; in disable_read_regs_int() local
1616 spin_lock_irq(&intr->lock); in disable_read_regs_int()
1617 atomic_set(&intr->read_regs_enabled, 0); in disable_read_regs_int()
1618 spin_unlock_irq(&intr->lock); in disable_read_regs_int()
1625 struct zd_usb_interrupt *intr = &usb->intr; in check_read_regs() local
1626 struct read_regs_int *rr = &intr->read_regs; in check_read_regs()
1666 struct zd_usb_interrupt *intr = &usb->intr; in get_results() local
1667 struct read_regs_int *rr = &intr->read_regs; in get_results()
1670 spin_lock_irq(&intr->lock); in get_results()
1675 *retry = !!intr->read_regs_int_overridden; in get_results()
1691 spin_unlock_irq(&intr->lock); in get_results()
1751 time_left = wait_for_completion_timeout(&usb->intr.read_regs.completion, in zd_usb_ioread16v()