Lines Matching refs:desc

118  * @desc: pointer to the ls2x sw dma descriptor.
119 * @pool: hw desc table
125 struct ls2x_dma_desc *desc;
172 struct ls2x_dma_desc *desc = to_ldma_desc(vdesc);
175 for (i = 0; i < desc->desc_num; i++) {
176 if (desc->sg[i].hw)
177 dma_pool_free(lchan->pool, desc->sg[i].hw,
178 desc->sg[i].llp);
181 kfree(desc);
204 lchan->desc = NULL;
209 lchan->desc = to_ldma_desc(vdesc);
210 ldma_sg = &lchan->desc->sg[0];
240 struct ls2x_dma_desc *desc)
242 struct ls2x_dma_sg *ldma_sg = &desc->sg[sg_index];
245 if (desc->direction == DMA_MEM_TO_DEV) {
257 num_segments = DIV_ROUND_UP((ldma_sg->len + 3) >> 2, desc->burst_size);
267 desc->sg[sg_index - 1].hw->ndesc_addr = ldma_sg->llp | LDMA_DESC_EN;
268 desc->sg[sg_index - 1].hw->high_ndesc_addr = upper_32_bits(ldma_sg->llp);
326 struct ls2x_dma_desc *desc;
338 desc = kzalloc(struct_size(desc, sg, sg_len), GFP_NOWAIT);
339 if (!desc)
342 desc->desc_num = sg_len;
343 desc->direction = direction;
344 desc->burst_size = burst_size;
347 struct ls2x_dma_sg *ldma_sg = &desc->sg[i];
352 desc->desc_num = i;
353 ls2x_dma_desc_free(&desc->vdesc);
360 ls2x_dma_fill_desc(lchan, i, desc);
364 desc->sg[sg_len - 1].hw->ndesc_addr &= ~LDMA_DESC_EN;
365 desc->status = DMA_IN_PROGRESS;
367 return vchan_tx_prep(&lchan->vchan, &desc->vdesc, flags);
387 struct ls2x_dma_desc *desc;
403 desc = kzalloc(struct_size(desc, sg, num_periods), GFP_NOWAIT);
404 if (!desc)
407 desc->desc_num = num_periods;
408 desc->direction = direction;
409 desc->burst_size = burst_size;
413 struct ls2x_dma_sg *ldma_sg = &desc->sg[i];
418 desc->desc_num = i;
419 ls2x_dma_desc_free(&desc->vdesc);
426 ls2x_dma_fill_desc(lchan, i, desc);
430 desc->sg[num_periods - 1].hw->ndesc_addr = desc->sg[0].llp | LDMA_DESC_EN;
431 desc->sg[num_periods - 1].hw->high_ndesc_addr = upper_32_bits(desc->sg[0].llp);
432 desc->cyclic = true;
433 desc->status = DMA_IN_PROGRESS;
435 return vchan_tx_prep(&lchan->vchan, &desc->vdesc, flags);
467 if (vchan_issue_pending(&lchan->vchan) && !lchan->desc)
487 if (lchan->desc) {
488 vchan_terminate_vdesc(&lchan->desc->vdesc);
489 lchan->desc = NULL;
517 if (lchan->desc && lchan->desc->status == DMA_IN_PROGRESS) {
519 lchan->desc->status = DMA_PAUSED;
532 if (lchan->desc && lchan->desc->status == DMA_PAUSED) {
533 lchan->desc->status = DMA_IN_PROGRESS;
551 struct ls2x_dma_desc *desc;
554 desc = lchan->desc;
555 if (desc) {
556 if (desc->cyclic) {
557 vchan_cyclic_callback(&desc->vdesc);
559 desc->status = DMA_COMPLETE;
560 vchan_cookie_complete(&desc->vdesc);
564 /* ls2x_dma_start_transfer() updates lchan->desc */
565 if (!lchan->desc)