Lines Matching refs:mcf_edma
19 struct fsl_edma_engine *mcf_edma = dev_id; in mcf_edma_tx_handler() local
20 struct edma_regs *regs = &mcf_edma->regs; in mcf_edma_tx_handler()
31 for (ch = 0; ch < mcf_edma->n_chans; ch++) { in mcf_edma_tx_handler()
35 mcf_chan = &mcf_edma->chans[ch]; in mcf_edma_tx_handler()
60 struct fsl_edma_engine *mcf_edma = dev_id; in mcf_edma_err_handler() local
61 struct edma_regs *regs = &mcf_edma->regs; in mcf_edma_err_handler()
70 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
72 mcf_edma->chans[ch].status = DMA_ERROR; in mcf_edma_err_handler()
73 mcf_edma->chans[ch].idle = true; in mcf_edma_err_handler()
83 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
85 mcf_edma->chans[ch].status = DMA_ERROR; in mcf_edma_err_handler()
86 mcf_edma->chans[ch].idle = true; in mcf_edma_err_handler()
94 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_init() argument
105 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
115 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
122 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
130 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
139 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_free() argument
148 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
155 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
160 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
164 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
175 struct fsl_edma_engine *mcf_edma; in mcf_edma_probe() local
188 len = sizeof(*mcf_edma) + sizeof(*mcf_chan) * chans; in mcf_edma_probe()
189 mcf_edma = devm_kzalloc(&pdev->dev, len, GFP_KERNEL); in mcf_edma_probe()
190 if (!mcf_edma) in mcf_edma_probe()
193 mcf_edma->n_chans = chans; in mcf_edma_probe()
196 mcf_edma->drvdata = &mcf_data; in mcf_edma_probe()
197 mcf_edma->big_endian = 1; in mcf_edma_probe()
199 if (!mcf_edma->n_chans) { in mcf_edma_probe()
201 mcf_edma->n_chans = 64; in mcf_edma_probe()
204 mutex_init(&mcf_edma->fsl_edma_mutex); in mcf_edma_probe()
208 mcf_edma->membase = devm_ioremap_resource(&pdev->dev, res); in mcf_edma_probe()
209 if (IS_ERR(mcf_edma->membase)) in mcf_edma_probe()
210 return PTR_ERR(mcf_edma->membase); in mcf_edma_probe()
212 fsl_edma_setup_regs(mcf_edma); in mcf_edma_probe()
213 regs = &mcf_edma->regs; in mcf_edma_probe()
215 INIT_LIST_HEAD(&mcf_edma->dma_dev.channels); in mcf_edma_probe()
216 for (i = 0; i < mcf_edma->n_chans; i++) { in mcf_edma_probe()
217 struct fsl_edma_chan *mcf_chan = &mcf_edma->chans[i]; in mcf_edma_probe()
219 mcf_chan->edma = mcf_edma; in mcf_edma_probe()
224 vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev); in mcf_edma_probe()
231 ret = mcf_edma->drvdata->setup_irq(pdev, mcf_edma); in mcf_edma_probe()
235 dma_cap_set(DMA_PRIVATE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
236 dma_cap_set(DMA_SLAVE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
237 dma_cap_set(DMA_CYCLIC, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
239 mcf_edma->dma_dev.dev = &pdev->dev; in mcf_edma_probe()
240 mcf_edma->dma_dev.device_alloc_chan_resources = in mcf_edma_probe()
242 mcf_edma->dma_dev.device_free_chan_resources = in mcf_edma_probe()
244 mcf_edma->dma_dev.device_config = fsl_edma_slave_config; in mcf_edma_probe()
245 mcf_edma->dma_dev.device_prep_dma_cyclic = in mcf_edma_probe()
247 mcf_edma->dma_dev.device_prep_slave_sg = fsl_edma_prep_slave_sg; in mcf_edma_probe()
248 mcf_edma->dma_dev.device_tx_status = fsl_edma_tx_status; in mcf_edma_probe()
249 mcf_edma->dma_dev.device_pause = fsl_edma_pause; in mcf_edma_probe()
250 mcf_edma->dma_dev.device_resume = fsl_edma_resume; in mcf_edma_probe()
251 mcf_edma->dma_dev.device_terminate_all = fsl_edma_terminate_all; in mcf_edma_probe()
252 mcf_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; in mcf_edma_probe()
254 mcf_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
255 mcf_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
256 mcf_edma->dma_dev.directions = in mcf_edma_probe()
259 mcf_edma->dma_dev.filter.fn = mcf_edma_filter_fn; in mcf_edma_probe()
260 mcf_edma->dma_dev.filter.map = pdata->slave_map; in mcf_edma_probe()
261 mcf_edma->dma_dev.filter.mapcnt = pdata->slavecnt; in mcf_edma_probe()
263 platform_set_drvdata(pdev, mcf_edma); in mcf_edma_probe()
265 ret = dma_async_device_register(&mcf_edma->dma_dev); in mcf_edma_probe()
280 struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev); in mcf_edma_remove() local
282 mcf_edma_irq_free(pdev, mcf_edma); in mcf_edma_remove()
283 fsl_edma_cleanup_vchan(&mcf_edma->dma_dev); in mcf_edma_remove()
284 dma_async_device_unregister(&mcf_edma->dma_dev); in mcf_edma_remove()