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()
30 for (ch = 0; ch < mcf_edma->n_chans; ch++) { in mcf_edma_tx_handler()
33 fsl_edma_tx_chan_handler(&mcf_edma->chans[ch]); in mcf_edma_tx_handler()
42 struct fsl_edma_engine *mcf_edma = dev_id; in mcf_edma_err_handler() local
43 struct edma_regs *regs = &mcf_edma->regs; in mcf_edma_err_handler()
52 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
54 fsl_edma_err_chan_handler(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
64 fsl_edma_disable_request(&mcf_edma->chans[ch]); in mcf_edma_err_handler()
66 mcf_edma->chans[ch].status = DMA_ERROR; in mcf_edma_err_handler()
74 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_init() argument
85 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
95 ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
102 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
110 0, "eDMA", mcf_edma); in mcf_edma_irq_init()
119 struct fsl_edma_engine *mcf_edma) in mcf_edma_irq_free() argument
128 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
135 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
140 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
144 free_irq(irq, mcf_edma); in mcf_edma_irq_free()
155 struct fsl_edma_engine *mcf_edma; in mcf_edma_probe() local
172 mcf_edma = devm_kzalloc(&pdev->dev, struct_size(mcf_edma, chans, chans), in mcf_edma_probe()
174 if (!mcf_edma) in mcf_edma_probe()
177 mcf_edma->n_chans = chans; in mcf_edma_probe()
180 mcf_edma->drvdata = &mcf_data; in mcf_edma_probe()
181 mcf_edma->big_endian = 1; in mcf_edma_probe()
183 mutex_init(&mcf_edma->fsl_edma_mutex); in mcf_edma_probe()
185 mcf_edma->membase = devm_platform_ioremap_resource(pdev, 0); in mcf_edma_probe()
186 if (IS_ERR(mcf_edma->membase)) in mcf_edma_probe()
187 return PTR_ERR(mcf_edma->membase); in mcf_edma_probe()
189 fsl_edma_setup_regs(mcf_edma); in mcf_edma_probe()
190 regs = &mcf_edma->regs; in mcf_edma_probe()
192 INIT_LIST_HEAD(&mcf_edma->dma_dev.channels); in mcf_edma_probe()
193 for (i = 0; i < mcf_edma->n_chans; i++) { in mcf_edma_probe()
194 struct fsl_edma_chan *mcf_chan = &mcf_edma->chans[i]; in mcf_edma_probe()
196 mcf_chan->edma = mcf_edma; in mcf_edma_probe()
200 vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev); in mcf_edma_probe()
201 mcf_chan->tcd = mcf_edma->membase + EDMA_TCD in mcf_edma_probe()
209 ret = mcf_edma->drvdata->setup_irq(pdev, mcf_edma); in mcf_edma_probe()
213 dma_cap_set(DMA_PRIVATE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
214 dma_cap_set(DMA_SLAVE, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
215 dma_cap_set(DMA_CYCLIC, mcf_edma->dma_dev.cap_mask); in mcf_edma_probe()
217 mcf_edma->dma_dev.dev = &pdev->dev; in mcf_edma_probe()
218 mcf_edma->dma_dev.device_alloc_chan_resources = in mcf_edma_probe()
220 mcf_edma->dma_dev.device_free_chan_resources = in mcf_edma_probe()
222 mcf_edma->dma_dev.device_config = fsl_edma_slave_config; in mcf_edma_probe()
223 mcf_edma->dma_dev.device_prep_dma_cyclic = in mcf_edma_probe()
225 mcf_edma->dma_dev.device_prep_slave_sg = fsl_edma_prep_slave_sg; in mcf_edma_probe()
226 mcf_edma->dma_dev.device_tx_status = fsl_edma_tx_status; in mcf_edma_probe()
227 mcf_edma->dma_dev.device_pause = fsl_edma_pause; in mcf_edma_probe()
228 mcf_edma->dma_dev.device_resume = fsl_edma_resume; in mcf_edma_probe()
229 mcf_edma->dma_dev.device_terminate_all = fsl_edma_terminate_all; in mcf_edma_probe()
230 mcf_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; in mcf_edma_probe()
232 mcf_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
233 mcf_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; in mcf_edma_probe()
234 mcf_edma->dma_dev.directions = in mcf_edma_probe()
237 mcf_edma->dma_dev.filter.fn = mcf_edma_filter_fn; in mcf_edma_probe()
238 mcf_edma->dma_dev.filter.map = pdata->slave_map; in mcf_edma_probe()
239 mcf_edma->dma_dev.filter.mapcnt = pdata->slavecnt; in mcf_edma_probe()
241 platform_set_drvdata(pdev, mcf_edma); in mcf_edma_probe()
243 ret = dma_async_device_register(&mcf_edma->dma_dev); in mcf_edma_probe()
258 struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev); in mcf_edma_remove() local
260 mcf_edma_irq_free(pdev, mcf_edma); in mcf_edma_remove()
261 fsl_edma_cleanup_vchan(&mcf_edma->dma_dev); in mcf_edma_remove()
262 dma_async_device_unregister(&mcf_edma->dma_dev); in mcf_edma_remove()