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()
67 struct fsl_edma_engine *mcf_edma = dev_id; in mcf_edma_err_handler() local
68 struct edma_regs *regs = &mcf_edma->regs; in mcf_edma_err_handler()
77 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
79 mcf_edma->chans[ch].status = DMA_ERROR; in mcf_edma_err_handler()
80 mcf_edma->chans[ch].idle = true; in mcf_edma_err_handler()
90 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
92 mcf_edma->chans[ch].status = DMA_ERROR; in mcf_edma_err_handler()
93 mcf_edma->chans[ch].idle = true; in mcf_edma_err_handler()
101 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_init() argument
112 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
122 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
129 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
137 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
146 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_free() argument
155 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
162 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
167 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
171 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
182 struct fsl_edma_engine *mcf_edma; in mcf_edma_probe() local
195 len = sizeof(*mcf_edma) + sizeof(*mcf_chan) * chans; in mcf_edma_probe()
196 mcf_edma = devm_kzalloc(&pdev->dev, len, GFP_KERNEL); in mcf_edma_probe()
197 if (!mcf_edma) in mcf_edma_probe()
200 mcf_edma->n_chans = chans; in mcf_edma_probe()
203 mcf_edma->drvdata = &mcf_data; in mcf_edma_probe()
204 mcf_edma->big_endian = 1; in mcf_edma_probe()
206 if (!mcf_edma->n_chans) { in mcf_edma_probe()
208 mcf_edma->n_chans = 64; in mcf_edma_probe()
211 mutex_init(&mcf_edma->fsl_edma_mutex); in mcf_edma_probe()
215 mcf_edma->membase = devm_ioremap_resource(&pdev->dev, res); in mcf_edma_probe()
216 if (IS_ERR(mcf_edma->membase)) in mcf_edma_probe()
217 return PTR_ERR(mcf_edma->membase); in mcf_edma_probe()
219 fsl_edma_setup_regs(mcf_edma); in mcf_edma_probe()
220 regs = &mcf_edma->regs; in mcf_edma_probe()
222 INIT_LIST_HEAD(&mcf_edma->dma_dev.channels); in mcf_edma_probe()
223 for (i = 0; i < mcf_edma->n_chans; i++) { in mcf_edma_probe()
224 struct fsl_edma_chan *mcf_chan = &mcf_edma->chans[i]; in mcf_edma_probe()
226 mcf_chan->edma = mcf_edma; in mcf_edma_probe()
231 vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev); in mcf_edma_probe()
238 ret = mcf_edma->drvdata->setup_irq(pdev, mcf_edma); in mcf_edma_probe()
242 dma_cap_set(DMA_PRIVATE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
243 dma_cap_set(DMA_SLAVE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
244 dma_cap_set(DMA_CYCLIC, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
246 mcf_edma->dma_dev.dev = &pdev->dev; in mcf_edma_probe()
247 mcf_edma->dma_dev.device_alloc_chan_resources = in mcf_edma_probe()
249 mcf_edma->dma_dev.device_free_chan_resources = in mcf_edma_probe()
251 mcf_edma->dma_dev.device_config = fsl_edma_slave_config; in mcf_edma_probe()
252 mcf_edma->dma_dev.device_prep_dma_cyclic = in mcf_edma_probe()
254 mcf_edma->dma_dev.device_prep_slave_sg = fsl_edma_prep_slave_sg; in mcf_edma_probe()
255 mcf_edma->dma_dev.device_tx_status = fsl_edma_tx_status; in mcf_edma_probe()
256 mcf_edma->dma_dev.device_pause = fsl_edma_pause; in mcf_edma_probe()
257 mcf_edma->dma_dev.device_resume = fsl_edma_resume; in mcf_edma_probe()
258 mcf_edma->dma_dev.device_terminate_all = fsl_edma_terminate_all; in mcf_edma_probe()
259 mcf_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; in mcf_edma_probe()
261 mcf_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
262 mcf_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
263 mcf_edma->dma_dev.directions = in mcf_edma_probe()
266 mcf_edma->dma_dev.filter.fn = mcf_edma_filter_fn; in mcf_edma_probe()
267 mcf_edma->dma_dev.filter.map = pdata->slave_map; in mcf_edma_probe()
268 mcf_edma->dma_dev.filter.mapcnt = pdata->slavecnt; in mcf_edma_probe()
270 platform_set_drvdata(pdev, mcf_edma); in mcf_edma_probe()
272 ret = dma_async_device_register(&mcf_edma->dma_dev); in mcf_edma_probe()
287 struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev); in mcf_edma_remove() local
289 mcf_edma_irq_free(pdev, mcf_edma); in mcf_edma_remove()
290 fsl_edma_cleanup_vchan(&mcf_edma->dma_dev); in mcf_edma_remove()
291 dma_async_device_unregister(&mcf_edma->dma_dev); in mcf_edma_remove()