Lines Matching +full:edma +full:- +full:err
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * drivers/dma/fsl-edma.c
5 * Copyright 2013-2014 Freescale Semiconductor, Inc.
7 * Driver for the Freescale eDMA engine with flexible channel multiplexing
8 * capability for DMA request sources. The eDMA block can be found on some
12 #include <dt-bindings/dma/fsl-edma.h>
22 #include <linux/dma-mapping.h>
26 #include "fsl-edma-common.h"
32 vchan_synchronize(&fsl_chan->vchan); in fsl_edma_synchronize()
39 struct edma_regs *regs = &fsl_edma->regs; in fsl_edma_tx_handler()
41 intr = edma_readl(fsl_edma, regs->intl); in fsl_edma_tx_handler()
45 for (ch = 0; ch < fsl_edma->n_chans; ch++) { in fsl_edma_tx_handler()
47 edma_writeb(fsl_edma, EDMA_CINT_CINT(ch), regs->cint); in fsl_edma_tx_handler()
48 fsl_edma_tx_chan_handler(&fsl_edma->chans[ch]); in fsl_edma_tx_handler()
73 unsigned int err, ch; in fsl_edma_err_handler() local
74 struct edma_regs *regs = &fsl_edma->regs; in fsl_edma_err_handler()
76 err = edma_readl(fsl_edma, regs->errl); in fsl_edma_err_handler()
77 if (!err) in fsl_edma_err_handler()
80 for (ch = 0; ch < fsl_edma->n_chans; ch++) { in fsl_edma_err_handler()
81 if (err & (0x1 << ch)) { in fsl_edma_err_handler()
82 fsl_edma_disable_request(&fsl_edma->chans[ch]); in fsl_edma_err_handler()
83 edma_writeb(fsl_edma, EDMA_CERR_CERR(ch), regs->cerr); in fsl_edma_err_handler()
84 fsl_edma_err_chan_handler(&fsl_edma->chans[ch]); in fsl_edma_err_handler()
101 struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data; in fsl_edma_xlate()
104 u32 dmamux_nr = fsl_edma->drvdata->dmamuxs; in fsl_edma_xlate()
105 unsigned long chans_per_mux = fsl_edma->n_chans / dmamux_nr; in fsl_edma_xlate()
107 if (dma_spec->args_count != 2) in fsl_edma_xlate()
110 mutex_lock(&fsl_edma->fsl_edma_mutex); in fsl_edma_xlate()
111 list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, device_node) { in fsl_edma_xlate()
112 if (chan->client_count) in fsl_edma_xlate()
114 if ((chan->chan_id / chans_per_mux) == dma_spec->args[0]) { in fsl_edma_xlate()
117 chan->device->privatecnt++; in fsl_edma_xlate()
119 fsl_chan->slave_id = dma_spec->args[1]; in fsl_edma_xlate()
120 fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, in fsl_edma_xlate()
122 mutex_unlock(&fsl_edma->fsl_edma_mutex); in fsl_edma_xlate()
127 mutex_unlock(&fsl_edma->fsl_edma_mutex); in fsl_edma_xlate()
134 struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data; in fsl_edma3_xlate()
140 if (dma_spec->args_count != 3) in fsl_edma3_xlate()
143 b_chmux = !!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_HAS_CHMUX); in fsl_edma3_xlate()
145 mutex_lock(&fsl_edma->fsl_edma_mutex); in fsl_edma3_xlate()
146 list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, in fsl_edma3_xlate()
149 if (chan->client_count) in fsl_edma3_xlate()
153 i = fsl_chan - fsl_edma->chans; in fsl_edma3_xlate()
155 fsl_chan->priority = dma_spec->args[1]; in fsl_edma3_xlate()
156 fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX; in fsl_edma3_xlate()
157 fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE; in fsl_edma3_xlate()
158 fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO; in fsl_edma3_xlate()
160 if ((dma_spec->args[2] & FSL_EDMA_EVEN_CH) && (i & 0x1)) in fsl_edma3_xlate()
163 if ((dma_spec->args[2] & FSL_EDMA_ODD_CH) && !(i & 0x1)) in fsl_edma3_xlate()
166 if (!b_chmux && i == dma_spec->args[0]) { in fsl_edma3_xlate()
168 chan->device->privatecnt++; in fsl_edma3_xlate()
169 mutex_unlock(&fsl_edma->fsl_edma_mutex); in fsl_edma3_xlate()
171 } else if (b_chmux && !fsl_chan->srcid) { in fsl_edma3_xlate()
174 chan->device->privatecnt++; in fsl_edma3_xlate()
175 fsl_chan->srcid = dma_spec->args[0]; in fsl_edma3_xlate()
176 mutex_unlock(&fsl_edma->fsl_edma_mutex); in fsl_edma3_xlate()
180 mutex_unlock(&fsl_edma->fsl_edma_mutex); in fsl_edma3_xlate()
189 edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); in fsl_edma_irq_init()
191 fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx"); in fsl_edma_irq_init()
192 if (fsl_edma->txirq < 0) in fsl_edma_irq_init()
193 return fsl_edma->txirq; in fsl_edma_irq_init()
195 fsl_edma->errirq = platform_get_irq_byname(pdev, "edma-err"); in fsl_edma_irq_init()
196 if (fsl_edma->errirq < 0) in fsl_edma_irq_init()
197 return fsl_edma->errirq; in fsl_edma_irq_init()
199 if (fsl_edma->txirq == fsl_edma->errirq) { in fsl_edma_irq_init()
200 ret = devm_request_irq(&pdev->dev, fsl_edma->txirq, in fsl_edma_irq_init()
201 fsl_edma_irq_handler, 0, "eDMA", fsl_edma); in fsl_edma_irq_init()
203 dev_err(&pdev->dev, "Can't register eDMA IRQ.\n"); in fsl_edma_irq_init()
207 ret = devm_request_irq(&pdev->dev, fsl_edma->txirq, in fsl_edma_irq_init()
208 fsl_edma_tx_handler, 0, "eDMA tx", fsl_edma); in fsl_edma_irq_init()
210 dev_err(&pdev->dev, "Can't register eDMA tx IRQ.\n"); in fsl_edma_irq_init()
214 ret = devm_request_irq(&pdev->dev, fsl_edma->errirq, in fsl_edma_irq_init()
215 fsl_edma_err_handler, 0, "eDMA err", fsl_edma); in fsl_edma_irq_init()
217 dev_err(&pdev->dev, "Can't register eDMA err IRQ.\n"); in fsl_edma_irq_init()
230 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma3_irq_init()
232 struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; in fsl_edma3_irq_init()
234 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma3_irq_init()
238 fsl_chan->txirq = platform_get_irq(pdev, i); in fsl_edma3_irq_init()
239 if (fsl_chan->txirq < 0) { in fsl_edma3_irq_init()
240 dev_err(&pdev->dev, "Can't get chan %d's irq.\n", i); in fsl_edma3_irq_init()
241 return -EINVAL; in fsl_edma3_irq_init()
244 ret = devm_request_irq(&pdev->dev, fsl_chan->txirq, in fsl_edma3_irq_init()
246 fsl_chan->chan_name, fsl_chan); in fsl_edma3_irq_init()
248 dev_err(&pdev->dev, "Can't register chan%d's IRQ.\n", i); in fsl_edma3_irq_init()
249 return -EINVAL; in fsl_edma3_irq_init()
263 edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); in fsl_edma2_irq_init()
266 dev_dbg(&pdev->dev, "%s Found %d interrupts\r\n", __func__, count); in fsl_edma2_irq_init()
268 dev_err(&pdev->dev, "Interrupts in DTS not correct.\n"); in fsl_edma2_irq_init()
269 return -EINVAL; in fsl_edma2_irq_init()
280 return -ENXIO; in fsl_edma2_irq_init()
282 /* The last IRQ is for eDMA err */ in fsl_edma2_irq_init()
283 if (i == count - 1) in fsl_edma2_irq_init()
284 ret = devm_request_irq(&pdev->dev, irq, in fsl_edma2_irq_init()
286 0, "eDMA2-ERR", fsl_edma); in fsl_edma2_irq_init()
288 ret = devm_request_irq(&pdev->dev, irq, in fsl_edma2_irq_init()
290 fsl_edma->chans[i].chan_name, in fsl_edma2_irq_init()
302 if (fsl_edma->txirq == fsl_edma->errirq) { in fsl_edma_irq_exit()
303 devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); in fsl_edma_irq_exit()
305 devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); in fsl_edma_irq_exit()
306 devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma); in fsl_edma_irq_exit()
315 clk_disable_unprepare(fsl_edma->muxclk[i]); in fsl_disable_clocks()
376 { .compatible = "fsl,vf610-edma", .data = &vf610_data},
377 { .compatible = "fsl,ls1028a-edma", .data = &ls1028a_data},
378 { .compatible = "fsl,imx7ulp-edma", .data = &imx7ulp_data},
379 { .compatible = "fsl,imx8qm-edma", .data = &imx8qm_data},
380 { .compatible = "fsl,imx8ulp-edma", .data = &imx8ulp_data},
381 { .compatible = "fsl,imx93-edma3", .data = &imx93_data3},
382 { .compatible = "fsl,imx93-edma4", .data = &imx93_data4},
392 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma3_detach_pd()
393 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma3_detach_pd()
395 fsl_chan = &fsl_edma->chans[i]; in fsl_edma3_detach_pd()
396 if (fsl_chan->pd_dev_link) in fsl_edma3_detach_pd()
397 device_link_del(fsl_chan->pd_dev_link); in fsl_edma3_detach_pd()
398 if (fsl_chan->pd_dev) { in fsl_edma3_detach_pd()
399 dev_pm_domain_detach(fsl_chan->pd_dev, false); in fsl_edma3_detach_pd()
400 pm_runtime_dont_use_autosuspend(fsl_chan->pd_dev); in fsl_edma3_detach_pd()
401 pm_runtime_set_suspended(fsl_chan->pd_dev); in fsl_edma3_detach_pd()
418 dev = &pdev->dev; in fsl_edma3_attach_pd()
420 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma3_attach_pd()
421 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma3_attach_pd()
424 fsl_chan = &fsl_edma->chans[i]; in fsl_edma3_attach_pd()
432 fsl_chan->pd_dev_link = device_link_add(dev, pd_chan, DL_FLAG_STATELESS | in fsl_edma3_attach_pd()
435 if (!fsl_chan->pd_dev_link) { in fsl_edma3_attach_pd()
441 fsl_chan->pd_dev = pd_chan; in fsl_edma3_attach_pd()
443 pm_runtime_use_autosuspend(fsl_chan->pd_dev); in fsl_edma3_attach_pd()
444 pm_runtime_set_autosuspend_delay(fsl_chan->pd_dev, 200); in fsl_edma3_attach_pd()
445 pm_runtime_set_active(fsl_chan->pd_dev); in fsl_edma3_attach_pd()
452 return -EINVAL; in fsl_edma3_attach_pd()
458 of_match_device(fsl_edma_dt_ids, &pdev->dev); in fsl_edma_probe()
459 struct device_node *np = pdev->dev.of_node; in fsl_edma_probe()
469 drvdata = of_id->data; in fsl_edma_probe()
471 dev_err(&pdev->dev, "unable to find driver data\n"); in fsl_edma_probe()
472 return -EINVAL; in fsl_edma_probe()
475 ret = of_property_read_u32(np, "dma-channels", &chans); in fsl_edma_probe()
477 dev_err(&pdev->dev, "Can't get dma-channels.\n"); in fsl_edma_probe()
481 fsl_edma = devm_kzalloc(&pdev->dev, struct_size(fsl_edma, chans, chans), in fsl_edma_probe()
484 return -ENOMEM; in fsl_edma_probe()
486 fsl_edma->drvdata = drvdata; in fsl_edma_probe()
487 fsl_edma->n_chans = chans; in fsl_edma_probe()
488 mutex_init(&fsl_edma->fsl_edma_mutex); in fsl_edma_probe()
490 fsl_edma->membase = devm_platform_ioremap_resource(pdev, 0); in fsl_edma_probe()
491 if (IS_ERR(fsl_edma->membase)) in fsl_edma_probe()
492 return PTR_ERR(fsl_edma->membase); in fsl_edma_probe()
494 if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) { in fsl_edma_probe()
496 regs = &fsl_edma->regs; in fsl_edma_probe()
499 if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { in fsl_edma_probe()
500 fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma"); in fsl_edma_probe()
501 if (IS_ERR(fsl_edma->dmaclk)) { in fsl_edma_probe()
502 dev_err(&pdev->dev, "Missing DMA block clock.\n"); in fsl_edma_probe()
503 return PTR_ERR(fsl_edma->dmaclk); in fsl_edma_probe()
507 if (drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) { in fsl_edma_probe()
508 fsl_edma->chclk = devm_clk_get_enabled(&pdev->dev, "mp"); in fsl_edma_probe()
509 if (IS_ERR(fsl_edma->chclk)) { in fsl_edma_probe()
510 dev_err(&pdev->dev, "Missing MP block clock.\n"); in fsl_edma_probe()
511 return PTR_ERR(fsl_edma->chclk); in fsl_edma_probe()
515 ret = of_property_read_variable_u32_array(np, "dma-channel-mask", chan_mask, 1, 2); in fsl_edma_probe()
518 fsl_edma->chan_masked = chan_mask[1]; in fsl_edma_probe()
519 fsl_edma->chan_masked <<= 32; in fsl_edma_probe()
520 fsl_edma->chan_masked |= chan_mask[0]; in fsl_edma_probe()
523 for (i = 0; i < fsl_edma->drvdata->dmamuxs; i++) { in fsl_edma_probe()
527 if (drvdata->flags & FSL_EDMA_DRV_SPLIT_REG) in fsl_edma_probe()
530 fsl_edma->muxbase[i] = devm_platform_ioremap_resource(pdev, in fsl_edma_probe()
532 if (IS_ERR(fsl_edma->muxbase[i])) { in fsl_edma_probe()
535 return PTR_ERR(fsl_edma->muxbase[i]); in fsl_edma_probe()
539 fsl_edma->muxclk[i] = devm_clk_get_enabled(&pdev->dev, clkname); in fsl_edma_probe()
540 if (IS_ERR(fsl_edma->muxclk[i])) { in fsl_edma_probe()
541 dev_err(&pdev->dev, "Missing DMAMUX block clock.\n"); in fsl_edma_probe()
543 return PTR_ERR(fsl_edma->muxclk[i]); in fsl_edma_probe()
547 fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); in fsl_edma_probe()
549 if (drvdata->flags & FSL_EDMA_DRV_HAS_PD) { in fsl_edma_probe()
553 ret = devm_add_action_or_reset(&pdev->dev, devm_fsl_edma3_detach_pd, fsl_edma); in fsl_edma_probe()
558 INIT_LIST_HEAD(&fsl_edma->dma_dev.channels); in fsl_edma_probe()
559 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma_probe()
560 struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; in fsl_edma_probe()
563 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma_probe()
566 snprintf(fsl_chan->chan_name, sizeof(fsl_chan->chan_name), "%s-CH%02d", in fsl_edma_probe()
567 dev_name(&pdev->dev), i); in fsl_edma_probe()
569 fsl_chan->edma = fsl_edma; in fsl_edma_probe()
570 fsl_chan->pm_state = RUNNING; in fsl_edma_probe()
571 fsl_chan->slave_id = 0; in fsl_edma_probe()
572 fsl_chan->idle = true; in fsl_edma_probe()
573 fsl_chan->dma_dir = DMA_NONE; in fsl_edma_probe()
574 fsl_chan->vchan.desc_free = fsl_edma_free_desc; in fsl_edma_probe()
576 len = (drvdata->flags & FSL_EDMA_DRV_SPLIT_REG) ? in fsl_edma_probe()
578 fsl_chan->tcd = fsl_edma->membase in fsl_edma_probe()
579 + i * drvdata->chreg_space_sz + drvdata->chreg_off + len; in fsl_edma_probe()
580 fsl_chan->mux_addr = fsl_edma->membase + drvdata->mux_off + i * drvdata->mux_skip; in fsl_edma_probe()
582 if (drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) { in fsl_edma_probe()
584 fsl_chan->clk = devm_clk_get_enabled(&pdev->dev, in fsl_edma_probe()
587 if (IS_ERR(fsl_chan->clk)) in fsl_edma_probe()
588 return PTR_ERR(fsl_chan->clk); in fsl_edma_probe()
590 fsl_chan->pdev = pdev; in fsl_edma_probe()
591 vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); in fsl_edma_probe()
595 if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) in fsl_edma_probe()
596 clk_disable_unprepare(fsl_chan->clk); in fsl_edma_probe()
599 ret = fsl_edma->drvdata->setup_irq(pdev, fsl_edma); in fsl_edma_probe()
603 dma_cap_set(DMA_PRIVATE, fsl_edma->dma_dev.cap_mask); in fsl_edma_probe()
604 dma_cap_set(DMA_SLAVE, fsl_edma->dma_dev.cap_mask); in fsl_edma_probe()
605 dma_cap_set(DMA_CYCLIC, fsl_edma->dma_dev.cap_mask); in fsl_edma_probe()
606 dma_cap_set(DMA_MEMCPY, fsl_edma->dma_dev.cap_mask); in fsl_edma_probe()
608 fsl_edma->dma_dev.dev = &pdev->dev; in fsl_edma_probe()
609 fsl_edma->dma_dev.device_alloc_chan_resources in fsl_edma_probe()
611 fsl_edma->dma_dev.device_free_chan_resources in fsl_edma_probe()
613 fsl_edma->dma_dev.device_tx_status = fsl_edma_tx_status; in fsl_edma_probe()
614 fsl_edma->dma_dev.device_prep_slave_sg = fsl_edma_prep_slave_sg; in fsl_edma_probe()
615 fsl_edma->dma_dev.device_prep_dma_cyclic = fsl_edma_prep_dma_cyclic; in fsl_edma_probe()
616 fsl_edma->dma_dev.device_prep_dma_memcpy = fsl_edma_prep_memcpy; in fsl_edma_probe()
617 fsl_edma->dma_dev.device_config = fsl_edma_slave_config; in fsl_edma_probe()
618 fsl_edma->dma_dev.device_pause = fsl_edma_pause; in fsl_edma_probe()
619 fsl_edma->dma_dev.device_resume = fsl_edma_resume; in fsl_edma_probe()
620 fsl_edma->dma_dev.device_terminate_all = fsl_edma_terminate_all; in fsl_edma_probe()
621 fsl_edma->dma_dev.device_synchronize = fsl_edma_synchronize; in fsl_edma_probe()
622 fsl_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; in fsl_edma_probe()
624 fsl_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; in fsl_edma_probe()
625 fsl_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; in fsl_edma_probe()
627 if (drvdata->flags & FSL_EDMA_DRV_BUS_8BYTE) { in fsl_edma_probe()
628 fsl_edma->dma_dev.src_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); in fsl_edma_probe()
629 fsl_edma->dma_dev.dst_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); in fsl_edma_probe()
632 fsl_edma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in fsl_edma_probe()
633 if (drvdata->flags & FSL_EDMA_DRV_DEV_TO_DEV) in fsl_edma_probe()
634 fsl_edma->dma_dev.directions |= BIT(DMA_DEV_TO_DEV); in fsl_edma_probe()
636 fsl_edma->dma_dev.copy_align = drvdata->flags & FSL_EDMA_DRV_ALIGN_64BYTE ? in fsl_edma_probe()
641 dma_set_max_seg_size(fsl_edma->dma_dev.dev, in fsl_edma_probe()
644 fsl_edma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; in fsl_edma_probe()
648 ret = dma_async_device_register(&fsl_edma->dma_dev); in fsl_edma_probe()
650 dev_err(&pdev->dev, in fsl_edma_probe()
651 "Can't register Freescale eDMA engine. (%d)\n", ret); in fsl_edma_probe()
656 drvdata->flags & FSL_EDMA_DRV_SPLIT_REG ? fsl_edma3_xlate : fsl_edma_xlate, in fsl_edma_probe()
659 dev_err(&pdev->dev, in fsl_edma_probe()
660 "Can't register Freescale eDMA of_dma. (%d)\n", ret); in fsl_edma_probe()
661 dma_async_device_unregister(&fsl_edma->dma_dev); in fsl_edma_probe()
666 if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) in fsl_edma_probe()
667 edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); in fsl_edma_probe()
674 struct device_node *np = pdev->dev.of_node; in fsl_edma_remove()
678 fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); in fsl_edma_remove()
680 dma_async_device_unregister(&fsl_edma->dma_dev); in fsl_edma_remove()
681 fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); in fsl_edma_remove()
693 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma_suspend_late()
694 fsl_chan = &fsl_edma->chans[i]; in fsl_edma_suspend_late()
695 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma_suspend_late()
697 spin_lock_irqsave(&fsl_chan->vchan.lock, flags); in fsl_edma_suspend_late()
699 if (unlikely(!fsl_chan->idle)) { in fsl_edma_suspend_late()
700 dev_warn(dev, "WARN: There is non-idle channel."); in fsl_edma_suspend_late()
705 fsl_chan->pm_state = SUSPENDED; in fsl_edma_suspend_late()
706 spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); in fsl_edma_suspend_late()
716 struct edma_regs *regs = &fsl_edma->regs; in fsl_edma_resume_early()
719 for (i = 0; i < fsl_edma->n_chans; i++) { in fsl_edma_resume_early()
720 fsl_chan = &fsl_edma->chans[i]; in fsl_edma_resume_early()
721 if (fsl_edma->chan_masked & BIT(i)) in fsl_edma_resume_early()
723 fsl_chan->pm_state = RUNNING; in fsl_edma_resume_early()
725 if (fsl_chan->slave_id != 0) in fsl_edma_resume_early()
726 fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); in fsl_edma_resume_early()
729 if (!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) in fsl_edma_resume_early()
730 edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); in fsl_edma_resume_early()
736 * eDMA provides the service to others, so it should be suspend late
737 * and resume early. When eDMA suspend, all of the clients should stop
747 .name = "fsl-edma",
767 MODULE_ALIAS("platform:fsl-edma");
768 MODULE_DESCRIPTION("Freescale eDMA engine driver");