Lines Matching refs:vc

44 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head);
45 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
56 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan *vc, in vchan_tx_prep() argument
61 dma_async_tx_descriptor_init(&vd->tx, &vc->chan); in vchan_tx_prep()
69 spin_lock_irqsave(&vc->lock, flags); in vchan_tx_prep()
70 list_add_tail(&vd->node, &vc->desc_allocated); in vchan_tx_prep()
71 spin_unlock_irqrestore(&vc->lock, flags); in vchan_tx_prep()
82 static inline bool vchan_issue_pending(struct virt_dma_chan *vc) in vchan_issue_pending() argument
84 list_splice_tail_init(&vc->desc_submitted, &vc->desc_issued); in vchan_issue_pending()
85 return !list_empty(&vc->desc_issued); in vchan_issue_pending()
96 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cookie_complete() local
101 dev_vdbg(vc->chan.device->dev, "txd %p[%x]: marked complete\n", in vchan_cookie_complete()
103 list_add_tail(&vd->node, &vc->desc_completed); in vchan_cookie_complete()
105 tasklet_schedule(&vc->task); in vchan_cookie_complete()
114 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_vdesc_fini() local
117 list_add(&vd->node, &vc->desc_allocated); in vchan_vdesc_fini()
119 vc->desc_free(vd); in vchan_vdesc_fini()
128 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cyclic_callback() local
130 vc->cyclic = vd; in vchan_cyclic_callback()
131 tasklet_schedule(&vc->task); in vchan_cyclic_callback()
142 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_terminate_vdesc() local
145 if (vc->vd_terminated) in vchan_terminate_vdesc()
146 vchan_vdesc_fini(vc->vd_terminated); in vchan_terminate_vdesc()
148 vc->vd_terminated = vd; in vchan_terminate_vdesc()
149 if (vc->cyclic == vd) in vchan_terminate_vdesc()
150 vc->cyclic = NULL; in vchan_terminate_vdesc()
159 static inline struct virt_dma_desc *vchan_next_desc(struct virt_dma_chan *vc) in vchan_next_desc() argument
161 return list_first_entry_or_null(&vc->desc_issued, in vchan_next_desc()
175 static inline void vchan_get_all_descriptors(struct virt_dma_chan *vc, in vchan_get_all_descriptors() argument
178 list_splice_tail_init(&vc->desc_allocated, head); in vchan_get_all_descriptors()
179 list_splice_tail_init(&vc->desc_submitted, head); in vchan_get_all_descriptors()
180 list_splice_tail_init(&vc->desc_issued, head); in vchan_get_all_descriptors()
181 list_splice_tail_init(&vc->desc_completed, head); in vchan_get_all_descriptors()
184 static inline void vchan_free_chan_resources(struct virt_dma_chan *vc) in vchan_free_chan_resources() argument
190 spin_lock_irqsave(&vc->lock, flags); in vchan_free_chan_resources()
191 vchan_get_all_descriptors(vc, &head); in vchan_free_chan_resources()
194 spin_unlock_irqrestore(&vc->lock, flags); in vchan_free_chan_resources()
196 vchan_dma_desc_free_list(vc, &head); in vchan_free_chan_resources()
208 static inline void vchan_synchronize(struct virt_dma_chan *vc) in vchan_synchronize() argument
212 tasklet_kill(&vc->task); in vchan_synchronize()
214 spin_lock_irqsave(&vc->lock, flags); in vchan_synchronize()
215 if (vc->vd_terminated) { in vchan_synchronize()
216 vchan_vdesc_fini(vc->vd_terminated); in vchan_synchronize()
217 vc->vd_terminated = NULL; in vchan_synchronize()
219 spin_unlock_irqrestore(&vc->lock, flags); in vchan_synchronize()