Lines Matching refs:desc
91 struct idma64_desc *desc = idma64c->desc; in idma64_chan_start() local
92 struct idma64_hw_desc *hw = &desc->hw[0]; in idma64_chan_start()
120 idma64c->desc = NULL; in idma64_start_transfer()
125 idma64c->desc = to_idma64_desc(vdesc); in idma64_start_transfer()
141 struct idma64_desc *desc; in idma64_chan_irq() local
146 desc = idma64c->desc; in idma64_chan_irq()
147 if (desc) { in idma64_chan_irq()
150 desc->status = DMA_ERROR; in idma64_chan_irq()
153 desc->status = DMA_COMPLETE; in idma64_chan_irq()
154 vchan_cookie_complete(&desc->vdesc); in idma64_chan_irq()
155 stat->bytes_transferred += desc->length; in idma64_chan_irq()
160 if (idma64c->desc == NULL || desc->status == DMA_ERROR) in idma64_chan_irq()
197 struct idma64_desc *desc; in idma64_alloc_desc() local
199 desc = kzalloc(sizeof(*desc), GFP_NOWAIT); in idma64_alloc_desc()
200 if (!desc) in idma64_alloc_desc()
203 desc->hw = kcalloc(ndesc, sizeof(*desc->hw), GFP_NOWAIT); in idma64_alloc_desc()
204 if (!desc->hw) { in idma64_alloc_desc()
205 kfree(desc); in idma64_alloc_desc()
209 return desc; in idma64_alloc_desc()
213 struct idma64_desc *desc) in idma64_desc_free() argument
217 if (desc->ndesc) { in idma64_desc_free()
218 unsigned int i = desc->ndesc; in idma64_desc_free()
221 hw = &desc->hw[--i]; in idma64_desc_free()
226 kfree(desc->hw); in idma64_desc_free()
227 kfree(desc); in idma64_desc_free()
277 struct idma64_desc *desc) in idma64_desc_fill() argument
280 unsigned int i = desc->ndesc; in idma64_desc_fill()
281 struct idma64_hw_desc *hw = &desc->hw[i - 1]; in idma64_desc_fill()
287 hw = &desc->hw[--i]; in idma64_desc_fill()
288 idma64_hw_desc_fill(hw, config, desc->direction, llp); in idma64_desc_fill()
290 desc->length += hw->len; in idma64_desc_fill()
306 struct idma64_desc *desc; in idma64_prep_slave_sg() local
310 desc = idma64_alloc_desc(sg_len); in idma64_prep_slave_sg()
311 if (!desc) in idma64_prep_slave_sg()
315 struct idma64_hw_desc *hw = &desc->hw[i]; in idma64_prep_slave_sg()
320 desc->ndesc = i; in idma64_prep_slave_sg()
321 idma64_desc_free(idma64c, desc); in idma64_prep_slave_sg()
329 desc->ndesc = sg_len; in idma64_prep_slave_sg()
330 desc->direction = direction; in idma64_prep_slave_sg()
331 desc->status = DMA_IN_PROGRESS; in idma64_prep_slave_sg()
333 idma64_desc_fill(idma64c, desc); in idma64_prep_slave_sg()
334 return vchan_tx_prep(&idma64c->vchan, &desc->vdesc, flags); in idma64_prep_slave_sg()
343 if (vchan_issue_pending(&idma64c->vchan) && !idma64c->desc) in idma64_issue_pending()
350 struct idma64_desc *desc = idma64c->desc; in idma64_active_desc_size() local
352 size_t bytes = desc->length; in idma64_active_desc_size()
358 hw = &desc->hw[i]; in idma64_active_desc_size()
362 } while (++i < desc->ndesc); in idma64_active_desc_size()
368 bytes += desc->hw[--i].len; in idma64_active_desc_size()
388 if (idma64c->desc && cookie == idma64c->desc->vdesc.tx.cookie) { in idma64_tx_status()
391 status = idma64c->desc->status; in idma64_tx_status()
454 if (idma64c->desc && idma64c->desc->status == DMA_IN_PROGRESS) { in idma64_pause()
456 idma64c->desc->status = DMA_PAUSED; in idma64_pause()
469 if (idma64c->desc && idma64c->desc->status == DMA_PAUSED) { in idma64_resume()
470 idma64c->desc->status = DMA_IN_PROGRESS; in idma64_resume()
487 if (idma64c->desc) { in idma64_terminate_all()
488 idma64_vdesc_free(&idma64c->desc->vdesc); in idma64_terminate_all()
489 idma64c->desc = NULL; in idma64_terminate_all()