Lines Matching refs:dpaa2_qdma
32 struct dpaa2_qdma_engine *dpaa2_qdma = dpaa2_chan->qdma; in dpaa2_qdma_alloc_chan_resources() local
33 struct device *dev = &dpaa2_qdma->priv->dpdmai_dev->dev; in dpaa2_qdma_alloc_chan_resources()
56 return dpaa2_qdma->desc_allocated++; in dpaa2_qdma_alloc_chan_resources()
68 struct dpaa2_qdma_engine *dpaa2_qdma = dpaa2_chan->qdma; in dpaa2_qdma_free_chan_resources() local
85 dpaa2_qdma->desc_allocated--; in dpaa2_qdma_free_chan_resources()
245 struct dpaa2_qdma_engine *dpaa2_qdma; in dpaa2_qdma_prep_memcpy() local
250 dpaa2_qdma = dpaa2_chan->qdma; in dpaa2_qdma_prep_memcpy()
255 wrt_changed = (bool)dpaa2_qdma->qdma_wrtype_fixup; in dpaa2_qdma_prep_memcpy()
396 u32 n_chans = priv->dpaa2_qdma->n_chans; in dpaa2_qdma_fqdan_cb()
429 qchan = &priv->dpaa2_qdma->chans[i]; in dpaa2_qdma_fqdan_cb()
605 static void dpaa2_dpdmai_free_channels(struct dpaa2_qdma_engine *dpaa2_qdma) in dpaa2_dpdmai_free_channels() argument
610 num = dpaa2_qdma->n_chans; in dpaa2_dpdmai_free_channels()
612 qchan = &dpaa2_qdma->chans[i]; in dpaa2_dpdmai_free_channels()
634 static int dpaa2_dpdmai_init_channels(struct dpaa2_qdma_engine *dpaa2_qdma) in dpaa2_dpdmai_init_channels() argument
636 struct dpaa2_qdma_priv *priv = dpaa2_qdma->priv; in dpaa2_dpdmai_init_channels()
641 INIT_LIST_HEAD(&dpaa2_qdma->dma_dev.channels); in dpaa2_dpdmai_init_channels()
642 for (i = 0; i < dpaa2_qdma->n_chans; i++) { in dpaa2_dpdmai_init_channels()
643 dpaa2_chan = &dpaa2_qdma->chans[i]; in dpaa2_dpdmai_init_channels()
644 dpaa2_chan->qdma = dpaa2_qdma; in dpaa2_dpdmai_init_channels()
647 vchan_init(&dpaa2_chan->vchan, &dpaa2_qdma->dma_dev); in dpaa2_dpdmai_init_channels()
658 struct dpaa2_qdma_engine *dpaa2_qdma; in dpaa2_qdma_probe() local
710 dpaa2_qdma = kzalloc(sizeof(*dpaa2_qdma), GFP_KERNEL); in dpaa2_qdma_probe()
711 if (!dpaa2_qdma) { in dpaa2_qdma_probe()
716 priv->dpaa2_qdma = dpaa2_qdma; in dpaa2_qdma_probe()
717 dpaa2_qdma->priv = priv; in dpaa2_qdma_probe()
719 dpaa2_qdma->desc_allocated = 0; in dpaa2_qdma_probe()
720 dpaa2_qdma->n_chans = NUM_CH; in dpaa2_qdma_probe()
722 dpaa2_dpdmai_init_channels(dpaa2_qdma); in dpaa2_qdma_probe()
725 dpaa2_qdma->qdma_wrtype_fixup = true; in dpaa2_qdma_probe()
727 dpaa2_qdma->qdma_wrtype_fixup = false; in dpaa2_qdma_probe()
729 dma_cap_set(DMA_PRIVATE, dpaa2_qdma->dma_dev.cap_mask); in dpaa2_qdma_probe()
730 dma_cap_set(DMA_SLAVE, dpaa2_qdma->dma_dev.cap_mask); in dpaa2_qdma_probe()
731 dma_cap_set(DMA_MEMCPY, dpaa2_qdma->dma_dev.cap_mask); in dpaa2_qdma_probe()
733 dpaa2_qdma->dma_dev.dev = dev; in dpaa2_qdma_probe()
734 dpaa2_qdma->dma_dev.device_alloc_chan_resources = in dpaa2_qdma_probe()
736 dpaa2_qdma->dma_dev.device_free_chan_resources = in dpaa2_qdma_probe()
738 dpaa2_qdma->dma_dev.device_tx_status = dma_cookie_status; in dpaa2_qdma_probe()
739 dpaa2_qdma->dma_dev.device_prep_dma_memcpy = dpaa2_qdma_prep_memcpy; in dpaa2_qdma_probe()
740 dpaa2_qdma->dma_dev.device_issue_pending = dpaa2_qdma_issue_pending; in dpaa2_qdma_probe()
742 err = dma_async_device_register(&dpaa2_qdma->dma_dev); in dpaa2_qdma_probe()
751 kfree(dpaa2_qdma); in dpaa2_qdma_probe()
772 struct dpaa2_qdma_engine *dpaa2_qdma; in dpaa2_qdma_remove() local
778 dpaa2_qdma = priv->dpaa2_qdma; in dpaa2_qdma_remove()
787 dpaa2_dpdmai_free_channels(dpaa2_qdma); in dpaa2_qdma_remove()
789 dma_async_device_unregister(&dpaa2_qdma->dma_dev); in dpaa2_qdma_remove()
791 kfree(dpaa2_qdma); in dpaa2_qdma_remove()