Lines Matching refs:desc
95 struct idma64_desc *desc = idma64c->desc; in idma64_chan_start() local
96 struct idma64_hw_desc *hw = &desc->hw[0]; in idma64_chan_start()
124 idma64c->desc = NULL; in idma64_start_transfer()
129 idma64c->desc = to_idma64_desc(vdesc); in idma64_start_transfer()
144 struct idma64_desc *desc; in idma64_chan_irq() local
148 desc = idma64c->desc; in idma64_chan_irq()
149 if (desc) { in idma64_chan_irq()
152 desc->status = DMA_ERROR; in idma64_chan_irq()
155 desc->status = DMA_COMPLETE; in idma64_chan_irq()
156 vchan_cookie_complete(&desc->vdesc); in idma64_chan_irq()
161 if (idma64c->desc == NULL || desc->status == DMA_ERROR) in idma64_chan_irq()
202 struct idma64_desc *desc; in idma64_alloc_desc() local
204 desc = kzalloc(sizeof(*desc), GFP_NOWAIT); in idma64_alloc_desc()
205 if (!desc) in idma64_alloc_desc()
208 desc->hw = kcalloc(ndesc, sizeof(*desc->hw), GFP_NOWAIT); in idma64_alloc_desc()
209 if (!desc->hw) { in idma64_alloc_desc()
210 kfree(desc); in idma64_alloc_desc()
214 return desc; in idma64_alloc_desc()
218 struct idma64_desc *desc) in idma64_desc_free() argument
222 if (desc->ndesc) { in idma64_desc_free()
223 unsigned int i = desc->ndesc; in idma64_desc_free()
226 hw = &desc->hw[--i]; in idma64_desc_free()
231 kfree(desc->hw); in idma64_desc_free()
232 kfree(desc); in idma64_desc_free()
283 struct idma64_desc *desc) in idma64_desc_fill() argument
286 struct idma64_hw_desc *hw = &desc->hw[desc->ndesc - 1]; in idma64_desc_fill()
289 unsigned int i = desc->ndesc; in idma64_desc_fill()
293 hw = &desc->hw[--i]; in idma64_desc_fill()
294 llp = idma64_hw_desc_fill(hw, config, desc->direction, llp); in idma64_desc_fill()
295 desc->length += hw->len; in idma64_desc_fill()
308 struct idma64_desc *desc; in idma64_prep_slave_sg() local
312 desc = idma64_alloc_desc(sg_len); in idma64_prep_slave_sg()
313 if (!desc) in idma64_prep_slave_sg()
317 struct idma64_hw_desc *hw = &desc->hw[i]; in idma64_prep_slave_sg()
322 desc->ndesc = i; in idma64_prep_slave_sg()
323 idma64_desc_free(idma64c, desc); in idma64_prep_slave_sg()
331 desc->ndesc = sg_len; in idma64_prep_slave_sg()
332 desc->direction = direction; in idma64_prep_slave_sg()
333 desc->status = DMA_IN_PROGRESS; in idma64_prep_slave_sg()
335 idma64_desc_fill(idma64c, desc); in idma64_prep_slave_sg()
336 return vchan_tx_prep(&idma64c->vchan, &desc->vdesc, flags); in idma64_prep_slave_sg()
345 if (vchan_issue_pending(&idma64c->vchan) && !idma64c->desc) in idma64_issue_pending()
352 struct idma64_desc *desc = idma64c->desc; in idma64_active_desc_size() local
354 size_t bytes = desc->length; in idma64_active_desc_size()
360 hw = &desc->hw[i]; in idma64_active_desc_size()
364 } while (++i < desc->ndesc); in idma64_active_desc_size()
370 bytes += desc->hw[--i].len; in idma64_active_desc_size()
390 if (idma64c->desc && cookie == idma64c->desc->vdesc.tx.cookie) { in idma64_tx_status()
393 status = idma64c->desc->status; in idma64_tx_status()
460 if (idma64c->desc && idma64c->desc->status == DMA_IN_PROGRESS) { in idma64_pause()
462 idma64c->desc->status = DMA_PAUSED; in idma64_pause()
475 if (idma64c->desc && idma64c->desc->status == DMA_PAUSED) { in idma64_resume()
476 idma64c->desc->status = DMA_IN_PROGRESS; in idma64_resume()
493 if (idma64c->desc) { in idma64_terminate_all()
494 idma64_vdesc_free(&idma64c->desc->vdesc); in idma64_terminate_all()
495 idma64c->desc = NULL; in idma64_terminate_all()