Lines Matching refs:vc

46 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head);
47 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
58 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan *vc, in vchan_tx_prep() argument
63 dma_async_tx_descriptor_init(&vd->tx, &vc->chan); in vchan_tx_prep()
68 spin_lock_irqsave(&vc->lock, flags); in vchan_tx_prep()
69 list_add_tail(&vd->node, &vc->desc_allocated); in vchan_tx_prep()
70 spin_unlock_irqrestore(&vc->lock, flags); in vchan_tx_prep()
81 static inline bool vchan_issue_pending(struct virt_dma_chan *vc) in vchan_issue_pending() argument
83 list_splice_tail_init(&vc->desc_submitted, &vc->desc_issued); in vchan_issue_pending()
84 return !list_empty(&vc->desc_issued); in vchan_issue_pending()
95 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cookie_complete() local
100 dev_vdbg(vc->chan.device->dev, "txd %p[%x]: marked complete\n", in vchan_cookie_complete()
102 list_add_tail(&vd->node, &vc->desc_completed); in vchan_cookie_complete()
104 tasklet_schedule(&vc->task); in vchan_cookie_complete()
113 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_vdesc_fini() local
116 list_add(&vd->node, &vc->desc_allocated); in vchan_vdesc_fini()
118 vc->desc_free(vd); in vchan_vdesc_fini()
127 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cyclic_callback() local
129 vc->cyclic = vd; in vchan_cyclic_callback()
130 tasklet_schedule(&vc->task); in vchan_cyclic_callback()
141 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_terminate_vdesc() local
144 if (vc->vd_terminated) in vchan_terminate_vdesc()
145 vchan_vdesc_fini(vc->vd_terminated); in vchan_terminate_vdesc()
147 vc->vd_terminated = vd; in vchan_terminate_vdesc()
148 if (vc->cyclic == vd) in vchan_terminate_vdesc()
149 vc->cyclic = NULL; in vchan_terminate_vdesc()
158 static inline struct virt_dma_desc *vchan_next_desc(struct virt_dma_chan *vc) in vchan_next_desc() argument
160 return list_first_entry_or_null(&vc->desc_issued, in vchan_next_desc()
174 static inline void vchan_get_all_descriptors(struct virt_dma_chan *vc, in vchan_get_all_descriptors() argument
177 list_splice_tail_init(&vc->desc_allocated, head); in vchan_get_all_descriptors()
178 list_splice_tail_init(&vc->desc_submitted, head); in vchan_get_all_descriptors()
179 list_splice_tail_init(&vc->desc_issued, head); in vchan_get_all_descriptors()
180 list_splice_tail_init(&vc->desc_completed, head); in vchan_get_all_descriptors()
183 static inline void vchan_free_chan_resources(struct virt_dma_chan *vc) in vchan_free_chan_resources() argument
189 spin_lock_irqsave(&vc->lock, flags); in vchan_free_chan_resources()
190 vchan_get_all_descriptors(vc, &head); in vchan_free_chan_resources()
193 spin_unlock_irqrestore(&vc->lock, flags); in vchan_free_chan_resources()
195 vchan_dma_desc_free_list(vc, &head); in vchan_free_chan_resources()
207 static inline void vchan_synchronize(struct virt_dma_chan *vc) in vchan_synchronize() argument
211 tasklet_kill(&vc->task); in vchan_synchronize()
213 spin_lock_irqsave(&vc->lock, flags); in vchan_synchronize()
214 if (vc->vd_terminated) { in vchan_synchronize()
215 vchan_vdesc_fini(vc->vd_terminated); in vchan_synchronize()
216 vc->vd_terminated = NULL; in vchan_synchronize()
218 spin_unlock_irqrestore(&vc->lock, flags); in vchan_synchronize()