Lines Matching refs:mdesc

260 static void mdc_list_desc_free(struct mdc_tx_desc *mdesc)  in mdc_list_desc_free()  argument
262 struct mdc_dma *mdma = mdesc->chan->mdma; in mdc_list_desc_free()
266 curr = mdesc->list; in mdc_list_desc_free()
267 curr_phys = mdesc->list_phys; in mdc_list_desc_free()
279 struct mdc_tx_desc *mdesc = to_mdc_desc(&vd->tx); in mdc_desc_free() local
281 mdc_list_desc_free(mdesc); in mdc_desc_free()
282 kfree(mdesc); in mdc_desc_free()
291 struct mdc_tx_desc *mdesc; in mdc_prep_dma_memcpy() local
298 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_dma_memcpy()
299 if (!mdesc) in mdc_prep_dma_memcpy()
301 mdesc->chan = mchan; in mdc_prep_dma_memcpy()
302 mdesc->list_xfer_size = len; in mdc_prep_dma_memcpy()
315 mdesc->list_phys = curr_phys; in mdc_prep_dma_memcpy()
316 mdesc->list = curr; in mdc_prep_dma_memcpy()
326 mdesc->list_len++; in mdc_prep_dma_memcpy()
332 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_dma_memcpy()
335 mdc_desc_free(&mdesc->vd); in mdc_prep_dma_memcpy()
373 struct mdc_tx_desc *mdesc; in mdc_prep_dma_cyclic() local
386 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_dma_cyclic()
387 if (!mdesc) in mdc_prep_dma_cyclic()
389 mdesc->chan = mchan; in mdc_prep_dma_cyclic()
390 mdesc->cyclic = true; in mdc_prep_dma_cyclic()
391 mdesc->list_xfer_size = buf_len; in mdc_prep_dma_cyclic()
392 mdesc->list_period_len = DIV_ROUND_UP(period_len, in mdc_prep_dma_cyclic()
407 mdesc->list_phys = curr_phys; in mdc_prep_dma_cyclic()
408 mdesc->list = curr; in mdc_prep_dma_cyclic()
431 mdesc->list_len++; in mdc_prep_dma_cyclic()
437 prev->node_addr = mdesc->list_phys; in mdc_prep_dma_cyclic()
439 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_dma_cyclic()
442 mdc_desc_free(&mdesc->vd); in mdc_prep_dma_cyclic()
454 struct mdc_tx_desc *mdesc; in mdc_prep_slave_sg() local
469 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_slave_sg()
470 if (!mdesc) in mdc_prep_slave_sg()
472 mdesc->chan = mchan; in mdc_prep_slave_sg()
487 mdesc->list_phys = curr_phys; in mdc_prep_slave_sg()
488 mdesc->list = curr; in mdc_prep_slave_sg()
509 mdesc->list_len++; in mdc_prep_slave_sg()
510 mdesc->list_xfer_size += xfer_size; in mdc_prep_slave_sg()
516 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_slave_sg()
519 mdc_desc_free(&mdesc->vd); in mdc_prep_slave_sg()
528 struct mdc_tx_desc *mdesc; in mdc_issue_desc() local
537 mdesc = to_mdc_desc(&vd->tx); in mdc_issue_desc()
538 mchan->desc = mdesc; in mdc_issue_desc()
554 mdc_chan_writel(mchan, mdesc->list_phys, MDC_LIST_NODE_ADDRESS); in mdc_issue_desc()
575 struct mdc_tx_desc *mdesc; in mdc_tx_status() local
591 mdesc = to_mdc_desc(&vd->tx); in mdc_tx_status()
592 bytes = mdesc->list_xfer_size; in mdc_tx_status()
598 mdesc = mchan->desc; in mdc_tx_status()
624 if (!mdesc->cmd_loaded) in mdc_tx_status()
627 cmds += mdesc->list_cmds_done; in mdc_tx_status()
629 bytes = mdesc->list_xfer_size; in mdc_tx_status()
630 ldesc = mdesc->list; in mdc_tx_status()
759 struct mdc_tx_desc *mdesc; in mdc_chan_irq() local
771 mdesc = mchan->desc; in mdc_chan_irq()
772 if (!mdesc) { in mdc_chan_irq()
785 if (!mdesc->cmd_loaded) { in mdc_chan_irq()
786 mdesc->cmd_loaded = true; in mdc_chan_irq()
790 mdesc->list_cmds_done++; in mdc_chan_irq()
791 if (mdesc->cyclic) { in mdc_chan_irq()
792 mdesc->list_cmds_done %= mdesc->list_len; in mdc_chan_irq()
793 if (mdesc->list_cmds_done % mdesc->list_period_len == 0) in mdc_chan_irq()
794 vchan_cyclic_callback(&mdesc->vd); in mdc_chan_irq()
795 } else if (mdesc->list_cmds_done == mdesc->list_len) { in mdc_chan_irq()
797 vchan_cookie_complete(&mdesc->vd); in mdc_chan_irq()