Lines Matching full:vc
115 * channel (VC)
116 * @vc: An instance for struct virt_dma_chan
122 struct virt_dma_chan vc; member
135 * @vc: The pointer to all available VCs
144 struct mtk_cqdma_vchan *vc; member
155 return container_of(chan, struct mtk_cqdma_vchan, vc.chan); in to_cqdma_vchan()
272 lockdep_assert_held(&cvc->vc.lock); in mtk_cqdma_issue_vchan_pending()
275 list_for_each_entry_safe(vd, vd2, &cvc->vc.desc_issued, node) { in mtk_cqdma_issue_vchan_pending()
295 * return true if this VC is active,
333 spin_lock(&cvc->vc.lock); in mtk_cqdma_consume_work_queue()
340 /* setup completion if this VC is under synchronization */ in mtk_cqdma_consume_work_queue()
347 spin_unlock(&cvc->vc.lock); in mtk_cqdma_consume_work_queue()
429 list_for_each_entry(vd, &cvc->vc.desc_issued, node) in mtk_cqdma_find_active_desc()
452 spin_lock(&cvc->vc.lock); in mtk_cqdma_tx_status()
454 spin_unlock(&cvc->vc.lock); in mtk_cqdma_tx_status()
475 spin_lock_irqsave(&cvc->vc.lock, vc_flags); in mtk_cqdma_issue_pending()
477 if (vchan_issue_pending(&cvc->vc)) in mtk_cqdma_issue_pending()
480 spin_unlock_irqrestore(&cvc->vc.lock, vc_flags); in mtk_cqdma_issue_pending()
550 struct virt_dma_chan *vc = to_virt_chan(c); in mtk_cqdma_free_inactive_desc() local
558 spin_lock_irqsave(&vc->lock, flags); in mtk_cqdma_free_inactive_desc()
559 list_splice_tail_init(&vc->desc_allocated, &head); in mtk_cqdma_free_inactive_desc()
560 list_splice_tail_init(&vc->desc_submitted, &head); in mtk_cqdma_free_inactive_desc()
561 list_splice_tail_init(&vc->desc_issued, &head); in mtk_cqdma_free_inactive_desc()
562 spin_unlock_irqrestore(&vc->lock, flags); in mtk_cqdma_free_inactive_desc()
565 vchan_dma_desc_free_list(vc, &head); in mtk_cqdma_free_inactive_desc()
577 spin_lock_irqsave(&cvc->vc.lock, vc_flags); in mtk_cqdma_free_active_desc()
579 /* synchronization is required if this VC is active */ in mtk_cqdma_free_active_desc()
585 spin_unlock_irqrestore(&cvc->vc.lock, vc_flags); in mtk_cqdma_free_active_desc()
588 /* waiting for the completion of this VC */ in mtk_cqdma_free_active_desc()
593 vchan_synchronize(&cvc->vc); in mtk_cqdma_free_active_desc()
595 WARN_ONCE(!list_empty(&cvc->vc.desc_completed), in mtk_cqdma_free_active_desc()
613 struct mtk_cqdma_vchan *vc = to_cqdma_vchan(c); in mtk_cqdma_alloc_chan_resources() local
650 vc->pc = pc; in mtk_cqdma_alloc_chan_resources()
660 /* free all descriptors in all lists on the VC */ in mtk_cqdma_free_chan_resources()
665 /* PC is not freed until there is no VC mapped to it */ in mtk_cqdma_free_chan_resources()
749 struct mtk_cqdma_vchan *vc; in mtk_cqdma_probe() local
839 cqdma->vc = devm_kcalloc(&pdev->dev, cqdma->dma_requests, in mtk_cqdma_probe()
840 sizeof(*cqdma->vc), GFP_KERNEL); in mtk_cqdma_probe()
841 if (!cqdma->vc) in mtk_cqdma_probe()
845 vc = &cqdma->vc[i]; in mtk_cqdma_probe()
846 vc->vc.desc_free = mtk_cqdma_vdesc_free; in mtk_cqdma_probe()
847 vchan_init(&vc->vc, dd); in mtk_cqdma_probe()
848 init_completion(&vc->issue_completion); in mtk_cqdma_probe()
889 struct mtk_cqdma_vchan *vc; in mtk_cqdma_remove() local
893 /* kill VC task */ in mtk_cqdma_remove()
895 vc = &cqdma->vc[i]; in mtk_cqdma_remove()
897 list_del(&vc->vc.chan.device_node); in mtk_cqdma_remove()
898 tasklet_kill(&vc->vc.task); in mtk_cqdma_remove()