Lines Matching full:pdma
12 * - Chapter 12 "Platform DMA Engine (PDMA)" of
26 #include "sf-pdma.h"
71 desc->xfer_type = desc->chan->pdma->transfer_type; in sf_pdma_fill_desc()
93 dev_err(chan->pdma->dma_dev.dev, in sf_pdma_prep_dma_memcpy()
260 dev_err(chan->pdma->dma_dev.dev, "NULL desc.\n"); in sf_pdma_xfer_desc()
387 * sf_pdma_irq_init() - Init PDMA IRQ Handlers
389 * @pdma: pointer of PDMA engine. Caller should check NULL
401 static int sf_pdma_irq_init(struct platform_device *pdev, struct sf_pdma *pdma) in sf_pdma_irq_init() argument
406 for (i = 0; i < pdma->n_chans; i++) { in sf_pdma_irq_init()
407 chan = &pdma->chans[i]; in sf_pdma_irq_init()
441 * @pdma: pointer of PDMA engine. Caller should check NULL
451 static void sf_pdma_setup_chans(struct sf_pdma *pdma) in sf_pdma_setup_chans() argument
456 INIT_LIST_HEAD(&pdma->dma_dev.channels); in sf_pdma_setup_chans()
458 for (i = 0; i < pdma->n_chans; i++) { in sf_pdma_setup_chans()
459 chan = &pdma->chans[i]; in sf_pdma_setup_chans()
480 chan->pdma = pdma; in sf_pdma_setup_chans()
487 vchan_init(&chan->vchan, &pdma->dma_dev); in sf_pdma_setup_chans()
499 struct sf_pdma *pdma; in sf_pdma_probe() local
517 pdma = devm_kzalloc(&pdev->dev, struct_size(pdma, chans, n_chans), in sf_pdma_probe()
519 if (!pdma) in sf_pdma_probe()
522 pdma->n_chans = n_chans; in sf_pdma_probe()
524 pdma->transfer_type = PDMA_FULL_SPEED | PDMA_STRICT_ORDERING; in sf_pdma_probe()
529 pdma->transfer_type &= ~PDMA_STRICT_ORDERING; in sf_pdma_probe()
532 pdma->membase = devm_platform_ioremap_resource(pdev, 0); in sf_pdma_probe()
533 if (IS_ERR(pdma->membase)) in sf_pdma_probe()
534 return PTR_ERR(pdma->membase); in sf_pdma_probe()
536 ret = sf_pdma_irq_init(pdev, pdma); in sf_pdma_probe()
540 sf_pdma_setup_chans(pdma); in sf_pdma_probe()
542 pdma->dma_dev.dev = &pdev->dev; in sf_pdma_probe()
545 dma_cap_set(DMA_MEMCPY, pdma->dma_dev.cap_mask); in sf_pdma_probe()
546 pdma->dma_dev.copy_align = 2; in sf_pdma_probe()
547 pdma->dma_dev.src_addr_widths = widths; in sf_pdma_probe()
548 pdma->dma_dev.dst_addr_widths = widths; in sf_pdma_probe()
549 pdma->dma_dev.directions = BIT(DMA_MEM_TO_MEM); in sf_pdma_probe()
550 pdma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; in sf_pdma_probe()
551 pdma->dma_dev.descriptor_reuse = true; in sf_pdma_probe()
554 pdma->dma_dev.device_alloc_chan_resources = in sf_pdma_probe()
556 pdma->dma_dev.device_free_chan_resources = in sf_pdma_probe()
558 pdma->dma_dev.device_tx_status = sf_pdma_tx_status; in sf_pdma_probe()
559 pdma->dma_dev.device_prep_dma_memcpy = sf_pdma_prep_dma_memcpy; in sf_pdma_probe()
560 pdma->dma_dev.device_config = sf_pdma_slave_config; in sf_pdma_probe()
561 pdma->dma_dev.device_terminate_all = sf_pdma_terminate_all; in sf_pdma_probe()
562 pdma->dma_dev.device_issue_pending = sf_pdma_issue_pending; in sf_pdma_probe()
564 platform_set_drvdata(pdev, pdma); in sf_pdma_probe()
571 ret = dma_async_device_register(&pdma->dma_dev); in sf_pdma_probe()
579 of_dma_xlate_by_chan_id, pdma); in sf_pdma_probe()
589 dma_async_device_unregister(&pdma->dma_dev); in sf_pdma_probe()
596 struct sf_pdma *pdma = platform_get_drvdata(pdev); in sf_pdma_remove() local
600 for (i = 0; i < pdma->n_chans; i++) { in sf_pdma_remove()
601 ch = &pdma->chans[i]; in sf_pdma_remove()
614 dma_async_device_unregister(&pdma->dma_dev); in sf_pdma_remove()
623 .compatible = "sifive,fu540-c000-pdma",
627 .compatible = "microchip,mpfs-pdma",
638 .name = "sf-pdma",