Lines Matching refs:uchan
343 static void usb_dmac_soft_reset(struct usb_dmac_chan *uchan) in usb_dmac_soft_reset() argument
345 struct dma_chan *chan = &uchan->vc.chan; in usb_dmac_soft_reset()
351 if (usb_dmac_chan_is_busy(uchan)) in usb_dmac_soft_reset()
383 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_alloc_chan_resources() local
386 while (uchan->descs_allocated < USB_DMAC_INITIAL_NR_DESC) { in usb_dmac_alloc_chan_resources()
387 ret = usb_dmac_desc_alloc(uchan, USB_DMAC_INITIAL_NR_SG, in usb_dmac_alloc_chan_resources()
390 usb_dmac_desc_free(uchan); in usb_dmac_alloc_chan_resources()
393 uchan->descs_allocated++; in usb_dmac_alloc_chan_resources()
401 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_free_chan_resources() local
405 spin_lock_irqsave(&uchan->vc.lock, flags); in usb_dmac_free_chan_resources()
406 usb_dmac_chan_halt(uchan); in usb_dmac_free_chan_resources()
407 spin_unlock_irqrestore(&uchan->vc.lock, flags); in usb_dmac_free_chan_resources()
409 usb_dmac_desc_free(uchan); in usb_dmac_free_chan_resources()
410 vchan_free_chan_resources(&uchan->vc); in usb_dmac_free_chan_resources()
420 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_prep_slave_sg() local
431 desc = usb_dmac_desc_get(uchan, sg_len, GFP_NOWAIT); in usb_dmac_prep_slave_sg()
442 return vchan_tx_prep(&uchan->vc, &desc->vd, dma_flags); in usb_dmac_prep_slave_sg()
447 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_chan_terminate_all() local
453 spin_lock_irqsave(&uchan->vc.lock, flags); in usb_dmac_chan_terminate_all()
454 usb_dmac_chan_halt(uchan); in usb_dmac_chan_terminate_all()
455 vchan_get_all_descriptors(&uchan->vc, &head); in usb_dmac_chan_terminate_all()
456 if (uchan->desc) in usb_dmac_chan_terminate_all()
457 uchan->desc = NULL; in usb_dmac_chan_terminate_all()
458 list_splice_init(&uchan->desc_got, &list); in usb_dmac_chan_terminate_all()
460 list_move_tail(&desc->node, &uchan->desc_freed); in usb_dmac_chan_terminate_all()
461 spin_unlock_irqrestore(&uchan->vc.lock, flags); in usb_dmac_chan_terminate_all()
462 vchan_dma_desc_free_list(&uchan->vc, &head); in usb_dmac_chan_terminate_all()
532 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_tx_status() local
542 spin_lock_irqsave(&uchan->vc.lock, flags); in usb_dmac_tx_status()
544 residue = usb_dmac_chan_get_residue_if_complete(uchan, cookie); in usb_dmac_tx_status()
546 residue = usb_dmac_chan_get_residue(uchan, cookie); in usb_dmac_tx_status()
547 spin_unlock_irqrestore(&uchan->vc.lock, flags); in usb_dmac_tx_status()
556 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_issue_pending() local
559 spin_lock_irqsave(&uchan->vc.lock, flags); in usb_dmac_issue_pending()
560 if (vchan_issue_pending(&uchan->vc) && !uchan->desc) in usb_dmac_issue_pending()
561 usb_dmac_chan_start_desc(uchan); in usb_dmac_issue_pending()
562 spin_unlock_irqrestore(&uchan->vc.lock, flags); in usb_dmac_issue_pending()
638 struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); in usb_dmac_chan_filter() local
642 if (uchan->index != dma_spec->args[0]) in usb_dmac_chan_filter()
708 struct usb_dmac_chan *uchan, in usb_dmac_chan_probe() argument
716 uchan->index = index; in usb_dmac_chan_probe()
717 uchan->iomem = dmac->iomem + USB_DMAC_CHAN_OFFSET(index); in usb_dmac_chan_probe()
721 uchan->irq = platform_get_irq_byname(pdev, pdev_irqname); in usb_dmac_chan_probe()
722 if (uchan->irq < 0) in usb_dmac_chan_probe()
730 ret = devm_request_irq(dmac->dev, uchan->irq, usb_dmac_isr_channel, in usb_dmac_chan_probe()
731 IRQF_SHARED, irqname, uchan); in usb_dmac_chan_probe()
734 uchan->irq, ret); in usb_dmac_chan_probe()
738 uchan->vc.desc_free = usb_dmac_virt_desc_free; in usb_dmac_chan_probe()
739 vchan_init(&uchan->vc, &dmac->engine); in usb_dmac_chan_probe()
740 INIT_LIST_HEAD(&uchan->desc_freed); in usb_dmac_chan_probe()
741 INIT_LIST_HEAD(&uchan->desc_got); in usb_dmac_chan_probe()
863 struct usb_dmac_chan *uchan) in usb_dmac_chan_remove() argument
865 usb_dmac_chan_halt(uchan); in usb_dmac_chan_remove()
866 devm_free_irq(dmac->dev, uchan->irq, uchan); in usb_dmac_chan_remove()