Lines Matching refs:mdesc
262 static void mdc_list_desc_free(struct mdc_tx_desc *mdesc) in mdc_list_desc_free() argument
264 struct mdc_dma *mdma = mdesc->chan->mdma; in mdc_list_desc_free()
268 curr = mdesc->list; in mdc_list_desc_free()
269 curr_phys = mdesc->list_phys; in mdc_list_desc_free()
281 struct mdc_tx_desc *mdesc = to_mdc_desc(&vd->tx); in mdc_desc_free() local
283 mdc_list_desc_free(mdesc); in mdc_desc_free()
284 kfree(mdesc); in mdc_desc_free()
293 struct mdc_tx_desc *mdesc; in mdc_prep_dma_memcpy() local
300 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_dma_memcpy()
301 if (!mdesc) in mdc_prep_dma_memcpy()
303 mdesc->chan = mchan; in mdc_prep_dma_memcpy()
304 mdesc->list_xfer_size = len; in mdc_prep_dma_memcpy()
317 mdesc->list_phys = curr_phys; in mdc_prep_dma_memcpy()
318 mdesc->list = curr; in mdc_prep_dma_memcpy()
329 mdesc->list_len++; in mdc_prep_dma_memcpy()
335 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_dma_memcpy()
338 mdc_desc_free(&mdesc->vd); in mdc_prep_dma_memcpy()
376 struct mdc_tx_desc *mdesc; in mdc_prep_dma_cyclic() local
389 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_dma_cyclic()
390 if (!mdesc) in mdc_prep_dma_cyclic()
392 mdesc->chan = mchan; in mdc_prep_dma_cyclic()
393 mdesc->cyclic = true; in mdc_prep_dma_cyclic()
394 mdesc->list_xfer_size = buf_len; in mdc_prep_dma_cyclic()
395 mdesc->list_period_len = DIV_ROUND_UP(period_len, in mdc_prep_dma_cyclic()
410 mdesc->list_phys = curr_phys; in mdc_prep_dma_cyclic()
411 mdesc->list = curr; in mdc_prep_dma_cyclic()
435 mdesc->list_len++; in mdc_prep_dma_cyclic()
441 prev->node_addr = mdesc->list_phys; in mdc_prep_dma_cyclic()
443 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_dma_cyclic()
446 mdc_desc_free(&mdesc->vd); in mdc_prep_dma_cyclic()
458 struct mdc_tx_desc *mdesc; in mdc_prep_slave_sg() local
473 mdesc = kzalloc(sizeof(*mdesc), GFP_NOWAIT); in mdc_prep_slave_sg()
474 if (!mdesc) in mdc_prep_slave_sg()
476 mdesc->chan = mchan; in mdc_prep_slave_sg()
491 mdesc->list_phys = curr_phys; in mdc_prep_slave_sg()
492 mdesc->list = curr; in mdc_prep_slave_sg()
514 mdesc->list_len++; in mdc_prep_slave_sg()
515 mdesc->list_xfer_size += xfer_size; in mdc_prep_slave_sg()
521 return vchan_tx_prep(&mchan->vc, &mdesc->vd, flags); in mdc_prep_slave_sg()
524 mdc_desc_free(&mdesc->vd); in mdc_prep_slave_sg()
533 struct mdc_tx_desc *mdesc; in mdc_issue_desc() local
542 mdesc = to_mdc_desc(&vd->tx); in mdc_issue_desc()
543 mchan->desc = mdesc; in mdc_issue_desc()
559 mdc_chan_writel(mchan, mdesc->list_phys, MDC_LIST_NODE_ADDRESS); in mdc_issue_desc()
580 struct mdc_tx_desc *mdesc; in mdc_tx_status() local
596 mdesc = to_mdc_desc(&vd->tx); in mdc_tx_status()
597 bytes = mdesc->list_xfer_size; in mdc_tx_status()
603 mdesc = mchan->desc; in mdc_tx_status()
629 if (!mdesc->cmd_loaded) in mdc_tx_status()
632 cmds += mdesc->list_cmds_done; in mdc_tx_status()
634 bytes = mdesc->list_xfer_size; in mdc_tx_status()
635 ldesc = mdesc->list; in mdc_tx_status()
657 struct mdc_tx_desc *mdesc; in mdc_terminate_all() local
666 mdesc = mchan->desc; in mdc_terminate_all()
672 if (mdesc) in mdc_terminate_all()
673 mdc_desc_free(&mdesc->vd); in mdc_terminate_all()
705 struct mdc_tx_desc *mdesc; in mdc_chan_irq() local
735 mdesc = mchan->desc; in mdc_chan_irq()
736 if (!mdesc) { in mdc_chan_irq()
750 if (!mdesc->cmd_loaded) { in mdc_chan_irq()
751 mdesc->cmd_loaded = true; in mdc_chan_irq()
755 mdesc->list_cmds_done++; in mdc_chan_irq()
756 if (mdesc->cyclic) { in mdc_chan_irq()
757 mdesc->list_cmds_done %= mdesc->list_len; in mdc_chan_irq()
758 if (mdesc->list_cmds_done % mdesc->list_period_len == 0) in mdc_chan_irq()
759 vchan_cyclic_callback(&mdesc->vd); in mdc_chan_irq()
760 } else if (mdesc->list_cmds_done == mdesc->list_len) { in mdc_chan_irq()
762 vchan_cookie_complete(&mdesc->vd); in mdc_chan_irq()