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()
419 if (int_num == CR_INTERRUPT && atomic_read(&intr->read_regs_enabled)) in handle_regs_int()
428 struct zd_usb_interrupt *intr; in int_urb_complete() local
461 intr = &usb->intr; in int_urb_complete()
462 if (hdr->id != USB_INT_ID_REGS && atomic_read(&intr->read_regs_enabled)) in int_urb_complete()
483 /* TODO: add worker to reset intr->urb */ in int_urb_complete()
504 struct zd_usb_interrupt *intr = &usb->intr; in usb_int_enabled() local
507 spin_lock_irqsave(&intr->lock, flags); in usb_int_enabled()
508 urb = intr->urb; in usb_int_enabled()
509 spin_unlock_irqrestore(&intr->lock, flags); in usb_int_enabled()
517 struct zd_usb_interrupt *intr = &usb->intr; in zd_usb_enable_int() local
529 spin_lock_irq(&intr->lock); in zd_usb_enable_int()
530 if (intr->urb) { in zd_usb_enable_int()
531 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
535 intr->urb = urb; in zd_usb_enable_int()
536 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
539 intr->buffer = usb_alloc_coherent(udev, USB_MAX_EP_INT_BUFFER, in zd_usb_enable_int()
540 GFP_KERNEL, &intr->buffer_dma); in zd_usb_enable_int()
541 if (!intr->buffer) { in zd_usb_enable_int()
548 intr->buffer, USB_MAX_EP_INT_BUFFER, in zd_usb_enable_int()
550 intr->interval); in zd_usb_enable_int()
551 urb->transfer_dma = intr->buffer_dma; in zd_usb_enable_int()
554 dev_dbg_f(zd_usb_dev(usb), "submit urb %p\n", intr->urb); in zd_usb_enable_int()
565 intr->buffer, intr->buffer_dma); in zd_usb_enable_int()
567 spin_lock_irq(&intr->lock); in zd_usb_enable_int()
568 intr->urb = NULL; in zd_usb_enable_int()
569 spin_unlock_irq(&intr->lock); in zd_usb_enable_int()
580 struct zd_usb_interrupt *intr = &usb->intr; in zd_usb_disable_int() local
585 spin_lock_irqsave(&intr->lock, flags); in zd_usb_disable_int()
586 urb = intr->urb; in zd_usb_disable_int()
588 spin_unlock_irqrestore(&intr->lock, flags); in zd_usb_disable_int()
591 intr->urb = NULL; in zd_usb_disable_int()
592 buffer = intr->buffer; in zd_usb_disable_int()
593 buffer_dma = intr->buffer_dma; in zd_usb_disable_int()
594 intr->buffer = NULL; in zd_usb_disable_int()
595 spin_unlock_irqrestore(&intr->lock, flags); in zd_usb_disable_int()
1157 struct zd_usb_interrupt *intr = &usb->intr; in init_usb_interrupt() local
1159 spin_lock_init(&intr->lock); in init_usb_interrupt()
1160 intr->interval = int_urb_interval(zd_usb_to_usbdev(usb)); in init_usb_interrupt()
1161 init_completion(&intr->read_regs.completion); in init_usb_interrupt()
1162 atomic_set(&intr->read_regs_enabled, 0); in init_usb_interrupt()
1163 intr->read_regs.cr_int_addr = cpu_to_le16((u16)CR_INTERRUPT); in init_usb_interrupt()
1601 struct zd_usb_interrupt *intr = &usb->intr; in prepare_read_regs_int() local
1603 spin_lock_irq(&intr->lock); in prepare_read_regs_int()
1604 atomic_set(&intr->read_regs_enabled, 1); in prepare_read_regs_int()
1605 intr->read_regs.req = req; in prepare_read_regs_int()
1606 intr->read_regs.req_count = count; in prepare_read_regs_int()
1607 reinit_completion(&intr->read_regs.completion); in prepare_read_regs_int()
1608 spin_unlock_irq(&intr->lock); in prepare_read_regs_int()
1613 struct zd_usb_interrupt *intr = &usb->intr; in disable_read_regs_int() local
1615 spin_lock_irq(&intr->lock); in disable_read_regs_int()
1616 atomic_set(&intr->read_regs_enabled, 0); in disable_read_regs_int()
1617 spin_unlock_irq(&intr->lock); in disable_read_regs_int()
1624 struct zd_usb_interrupt *intr = &usb->intr; in check_read_regs() local
1625 struct read_regs_int *rr = &intr->read_regs; in check_read_regs()
1665 struct zd_usb_interrupt *intr = &usb->intr; in get_results() local
1666 struct read_regs_int *rr = &intr->read_regs; in get_results()
1669 spin_lock_irq(&intr->lock); in get_results()
1674 *retry = !!intr->read_regs_int_overridden; in get_results()
1690 spin_unlock_irq(&intr->lock); in get_results()
1750 timeout = wait_for_completion_timeout(&usb->intr.read_regs.completion, in zd_usb_ioread16v()