Lines Matching +full:dma +full:- +full:maxburst
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * DMA driver for STMicroelectronics STi FDMA controller
35 struct st_fdma_dev *fdev = fchan->fdev; in st_fdma_dreq_get()
36 u32 req_line_cfg = fchan->cfg.req_line; in st_fdma_dreq_get()
46 if (fdev->dreq_mask == ~0L) { in st_fdma_dreq_get()
47 dev_err(fdev->dev, "No req lines available\n"); in st_fdma_dreq_get()
48 return -EINVAL; in st_fdma_dreq_get()
52 dev_err(fdev->dev, "Invalid or used req line\n"); in st_fdma_dreq_get()
53 return -EINVAL; in st_fdma_dreq_get()
59 } while (test_and_set_bit(dreq_line, &fdev->dreq_mask)); in st_fdma_dreq_get()
61 dev_dbg(fdev->dev, "get dreq_line:%d mask:%#lx\n", in st_fdma_dreq_get()
62 dreq_line, fdev->dreq_mask); in st_fdma_dreq_get()
69 struct st_fdma_dev *fdev = fchan->fdev; in st_fdma_dreq_put()
71 dev_dbg(fdev->dev, "put dreq_line:%#x\n", fchan->dreq_line); in st_fdma_dreq_put()
72 clear_bit(fchan->dreq_line, &fdev->dreq_mask); in st_fdma_dreq_put()
80 vdesc = vchan_next_desc(&fchan->vchan); in st_fdma_xfer_desc()
84 fchan->fdesc = to_st_fdma_desc(vdesc); in st_fdma_xfer_desc()
85 nbytes = fchan->fdesc->node[0].desc->nbytes; in st_fdma_xfer_desc()
86 cmd = FDMA_CMD_START(fchan->vchan.chan.chan_id); in st_fdma_xfer_desc()
87 ch_cmd = fchan->fdesc->node[0].pdesc | FDMA_CH_CMD_STA_START; in st_fdma_xfer_desc()
93 fchan->fdev->slim_rproc->peri + FDMA_CMD_SET_OFST); in st_fdma_xfer_desc()
95 dev_dbg(fchan->fdev->dev, "start chan:%d\n", fchan->vchan.chan.chan_id); in st_fdma_xfer_desc()
102 int ch_id = fchan->vchan.chan.chan_id; in st_fdma_ch_sta_update()
103 struct st_fdma_dev *fdev = fchan->fdev; in st_fdma_ch_sta_update()
110 dev_warn(fdev->dev, "chan:%d, error:%ld\n", ch_id, ch_err); in st_fdma_ch_sta_update()
111 fchan->status = DMA_ERROR; in st_fdma_ch_sta_update()
117 fchan->status = DMA_PAUSED; in st_fdma_ch_sta_update()
121 fchan->status = DMA_IN_PROGRESS; in st_fdma_ch_sta_update()
130 struct st_fdma_chan *fchan = &fdev->chans[0]; in st_fdma_irq_handler()
140 spin_lock(&fchan->vchan.lock); in st_fdma_irq_handler()
143 if (fchan->fdesc) { in st_fdma_irq_handler()
144 if (!fchan->fdesc->iscyclic) { in st_fdma_irq_handler()
145 list_del(&fchan->fdesc->vdesc.node); in st_fdma_irq_handler()
146 vchan_cookie_complete(&fchan->fdesc->vdesc); in st_fdma_irq_handler()
147 fchan->fdesc = NULL; in st_fdma_irq_handler()
148 fchan->status = DMA_COMPLETE; in st_fdma_irq_handler()
150 vchan_cyclic_callback(&fchan->fdesc->vdesc); in st_fdma_irq_handler()
154 if (!fchan->fdesc) in st_fdma_irq_handler()
158 spin_unlock(&fchan->vchan.lock); in st_fdma_irq_handler()
170 struct st_fdma_dev *fdev = ofdma->of_dma_data; in st_fdma_of_xlate()
175 if (dma_spec->args_count < 1) in st_fdma_of_xlate()
176 return ERR_PTR(-EINVAL); in st_fdma_of_xlate()
178 if (fdev->dma_device.dev->of_node != dma_spec->np) in st_fdma_of_xlate()
179 return ERR_PTR(-EINVAL); in st_fdma_of_xlate()
181 ret = rproc_boot(fdev->slim_rproc->rproc); in st_fdma_of_xlate()
182 if (ret == -ENOENT) in st_fdma_of_xlate()
183 return ERR_PTR(-EPROBE_DEFER); in st_fdma_of_xlate()
187 chan = dma_get_any_slave_channel(&fdev->dma_device); in st_fdma_of_xlate()
193 fchan->cfg.of_node = dma_spec->np; in st_fdma_of_xlate()
194 fchan->cfg.req_line = dma_spec->args[0]; in st_fdma_of_xlate()
195 fchan->cfg.req_ctrl = 0; in st_fdma_of_xlate()
196 fchan->cfg.type = ST_FDMA_TYPE_FREE_RUN; in st_fdma_of_xlate()
198 if (dma_spec->args_count > 1) in st_fdma_of_xlate()
199 fchan->cfg.req_ctrl = dma_spec->args[1] in st_fdma_of_xlate()
202 if (dma_spec->args_count > 2) in st_fdma_of_xlate()
203 fchan->cfg.type = dma_spec->args[2]; in st_fdma_of_xlate()
205 if (fchan->cfg.type == ST_FDMA_TYPE_FREE_RUN) { in st_fdma_of_xlate()
206 fchan->dreq_line = 0; in st_fdma_of_xlate()
208 fchan->dreq_line = st_fdma_dreq_get(fchan); in st_fdma_of_xlate()
209 if (IS_ERR_VALUE(fchan->dreq_line)) { in st_fdma_of_xlate()
210 chan = ERR_PTR(fchan->dreq_line); in st_fdma_of_xlate()
215 dev_dbg(fdev->dev, "xlate req_line:%d type:%d req_ctrl:%#lx\n", in st_fdma_of_xlate()
216 fchan->cfg.req_line, fchan->cfg.type, fchan->cfg.req_ctrl); in st_fdma_of_xlate()
221 rproc_shutdown(fdev->slim_rproc->rproc); in st_fdma_of_xlate()
232 for (i = 0; i < fdesc->n_nodes; i++) in st_fdma_free_desc()
233 dma_pool_free(fdesc->fchan->node_pool, fdesc->node[i].desc, in st_fdma_free_desc()
234 fdesc->node[i].pdesc); in st_fdma_free_desc()
248 fdesc->fchan = fchan; in st_fdma_alloc_desc()
249 fdesc->n_nodes = sg_len; in st_fdma_alloc_desc()
251 fdesc->node[i].desc = dma_pool_alloc(fchan->node_pool, in st_fdma_alloc_desc()
252 GFP_NOWAIT, &fdesc->node[i].pdesc); in st_fdma_alloc_desc()
253 if (!fdesc->node[i].desc) in st_fdma_alloc_desc()
259 while (--i >= 0) in st_fdma_alloc_desc()
260 dma_pool_free(fchan->node_pool, fdesc->node[i].desc, in st_fdma_alloc_desc()
261 fdesc->node[i].pdesc); in st_fdma_alloc_desc()
270 /* Create the dma pool for descriptor allocation */ in st_fdma_alloc_chan_res()
271 fchan->node_pool = dma_pool_create(dev_name(&chan->dev->device), in st_fdma_alloc_chan_res()
272 fchan->fdev->dev, in st_fdma_alloc_chan_res()
277 if (!fchan->node_pool) { in st_fdma_alloc_chan_res()
278 dev_err(fchan->fdev->dev, "unable to allocate desc pool\n"); in st_fdma_alloc_chan_res()
279 return -ENOMEM; in st_fdma_alloc_chan_res()
282 dev_dbg(fchan->fdev->dev, "alloc ch_id:%d type:%d\n", in st_fdma_alloc_chan_res()
283 fchan->vchan.chan.chan_id, fchan->cfg.type); in st_fdma_alloc_chan_res()
291 struct rproc *rproc = fchan->fdev->slim_rproc->rproc; in st_fdma_free_chan_res()
294 dev_dbg(fchan->fdev->dev, "%s: freeing chan:%d\n", in st_fdma_free_chan_res()
295 __func__, fchan->vchan.chan.chan_id); in st_fdma_free_chan_res()
297 if (fchan->cfg.type != ST_FDMA_TYPE_FREE_RUN) in st_fdma_free_chan_res()
300 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_free_chan_res()
301 fchan->fdesc = NULL; in st_fdma_free_chan_res()
302 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_free_chan_res()
304 dma_pool_destroy(fchan->node_pool); in st_fdma_free_chan_res()
305 fchan->node_pool = NULL; in st_fdma_free_chan_res()
306 memset(&fchan->cfg, 0, sizeof(struct st_fdma_cfg)); in st_fdma_free_chan_res()
327 dev_err(fchan->fdev->dev, "no memory for desc\n"); in st_fdma_prep_dma_memcpy()
331 hw_node = fdesc->node[0].desc; in st_fdma_prep_dma_memcpy()
332 hw_node->next = 0; in st_fdma_prep_dma_memcpy()
333 hw_node->control = FDMA_NODE_CTRL_REQ_MAP_FREE_RUN; in st_fdma_prep_dma_memcpy()
334 hw_node->control |= FDMA_NODE_CTRL_SRC_INCR; in st_fdma_prep_dma_memcpy()
335 hw_node->control |= FDMA_NODE_CTRL_DST_INCR; in st_fdma_prep_dma_memcpy()
336 hw_node->control |= FDMA_NODE_CTRL_INT_EON; in st_fdma_prep_dma_memcpy()
337 hw_node->nbytes = len; in st_fdma_prep_dma_memcpy()
338 hw_node->saddr = src; in st_fdma_prep_dma_memcpy()
339 hw_node->daddr = dst; in st_fdma_prep_dma_memcpy()
340 hw_node->generic.length = len; in st_fdma_prep_dma_memcpy()
341 hw_node->generic.sstride = 0; in st_fdma_prep_dma_memcpy()
342 hw_node->generic.dstride = 0; in st_fdma_prep_dma_memcpy()
344 return vchan_tx_prep(&fchan->vchan, &fdesc->vdesc, flags); in st_fdma_prep_dma_memcpy()
350 u32 maxburst = 0, addr = 0; in config_reqctrl() local
352 int ch_id = fchan->vchan.chan.chan_id; in config_reqctrl()
353 struct st_fdma_dev *fdev = fchan->fdev; in config_reqctrl()
358 fchan->cfg.req_ctrl &= ~FDMA_REQ_CTRL_WNR; in config_reqctrl()
359 maxburst = fchan->scfg.src_maxburst; in config_reqctrl()
360 width = fchan->scfg.src_addr_width; in config_reqctrl()
361 addr = fchan->scfg.src_addr; in config_reqctrl()
365 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_WNR; in config_reqctrl()
366 maxburst = fchan->scfg.dst_maxburst; in config_reqctrl()
367 width = fchan->scfg.dst_addr_width; in config_reqctrl()
368 addr = fchan->scfg.dst_addr; in config_reqctrl()
372 return -EINVAL; in config_reqctrl()
375 fchan->cfg.req_ctrl &= ~FDMA_REQ_CTRL_OPCODE_MASK; in config_reqctrl()
380 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_OPCODE_LD_ST1; in config_reqctrl()
384 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_OPCODE_LD_ST2; in config_reqctrl()
388 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_OPCODE_LD_ST4; in config_reqctrl()
392 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_OPCODE_LD_ST8; in config_reqctrl()
396 return -EINVAL; in config_reqctrl()
399 fchan->cfg.req_ctrl &= ~FDMA_REQ_CTRL_NUM_OPS_MASK; in config_reqctrl()
400 fchan->cfg.req_ctrl |= FDMA_REQ_CTRL_NUM_OPS(maxburst-1); in config_reqctrl()
401 dreq_write(fchan, fchan->cfg.req_ctrl, FDMA_REQ_CTRL_OFST); in config_reqctrl()
403 fchan->cfg.dev_addr = addr; in config_reqctrl()
404 fchan->cfg.dir = direction; in config_reqctrl()
406 dev_dbg(fdev->dev, "chan:%d config_reqctrl:%#x req_ctrl:%#lx\n", in config_reqctrl()
407 ch_id, addr, fchan->cfg.req_ctrl); in config_reqctrl()
417 hw_node->control |= FDMA_NODE_CTRL_SRC_INCR; in fill_hw_node()
418 hw_node->control |= FDMA_NODE_CTRL_DST_STATIC; in fill_hw_node()
419 hw_node->daddr = fchan->cfg.dev_addr; in fill_hw_node()
421 hw_node->control |= FDMA_NODE_CTRL_SRC_STATIC; in fill_hw_node()
422 hw_node->control |= FDMA_NODE_CTRL_DST_INCR; in fill_hw_node()
423 hw_node->saddr = fchan->cfg.dev_addr; in fill_hw_node()
426 hw_node->generic.sstride = 0; in fill_hw_node()
427 hw_node->generic.dstride = 0; in fill_hw_node()
441 dev_err(fchan->fdev->dev, "bad direction?\n"); in st_fdma_prep_common()
465 dev_err(fchan->fdev->dev, "bad width or direction\n"); in st_fdma_prep_dma_cyclic()
471 dev_err(fchan->fdev->dev, "len is not multiple of period\n"); in st_fdma_prep_dma_cyclic()
478 dev_err(fchan->fdev->dev, "no memory for desc\n"); in st_fdma_prep_dma_cyclic()
482 fdesc->iscyclic = true; in st_fdma_prep_dma_cyclic()
485 struct st_fdma_hw_node *hw_node = fdesc->node[i].desc; in st_fdma_prep_dma_cyclic()
487 hw_node->next = fdesc->node[(i + 1) % sg_len].pdesc; in st_fdma_prep_dma_cyclic()
489 hw_node->control = in st_fdma_prep_dma_cyclic()
490 FDMA_NODE_CTRL_REQ_MAP_DREQ(fchan->dreq_line); in st_fdma_prep_dma_cyclic()
491 hw_node->control |= FDMA_NODE_CTRL_INT_EON; in st_fdma_prep_dma_cyclic()
496 hw_node->saddr = buf_addr + (i * period_len); in st_fdma_prep_dma_cyclic()
498 hw_node->daddr = buf_addr + (i * period_len); in st_fdma_prep_dma_cyclic()
500 hw_node->nbytes = period_len; in st_fdma_prep_dma_cyclic()
501 hw_node->generic.length = period_len; in st_fdma_prep_dma_cyclic()
504 return vchan_tx_prep(&fchan->vchan, &fdesc->vdesc, flags); in st_fdma_prep_dma_cyclic()
527 dev_err(fchan->fdev->dev, "no memory for desc\n"); in st_fdma_prep_slave_sg()
531 fdesc->iscyclic = false; in st_fdma_prep_slave_sg()
534 hw_node = fdesc->node[i].desc; in st_fdma_prep_slave_sg()
536 hw_node->next = fdesc->node[(i + 1) % sg_len].pdesc; in st_fdma_prep_slave_sg()
537 hw_node->control = FDMA_NODE_CTRL_REQ_MAP_DREQ(fchan->dreq_line); in st_fdma_prep_slave_sg()
542 hw_node->saddr = sg_dma_address(sg); in st_fdma_prep_slave_sg()
544 hw_node->daddr = sg_dma_address(sg); in st_fdma_prep_slave_sg()
546 hw_node->nbytes = sg_dma_len(sg); in st_fdma_prep_slave_sg()
547 hw_node->generic.length = sg_dma_len(sg); in st_fdma_prep_slave_sg()
551 hw_node->control |= FDMA_NODE_CTRL_INT_EON; in st_fdma_prep_slave_sg()
553 return vchan_tx_prep(&fchan->vchan, &fdesc->vdesc, flags); in st_fdma_prep_slave_sg()
560 struct st_fdma_desc *fdesc = fchan->fdesc; in st_fdma_desc_residue()
570 for (i = fchan->fdesc->n_nodes - 1 ; i >= 0; i--) { in st_fdma_desc_residue()
571 if (cur_addr == fdesc->node[i].pdesc) { in st_fdma_desc_residue()
575 residue += fdesc->node[i].desc->nbytes; in st_fdma_desc_residue()
594 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_tx_status()
595 vd = vchan_find_desc(&fchan->vchan, cookie); in st_fdma_tx_status()
596 if (fchan->fdesc && cookie == fchan->fdesc->vdesc.tx.cookie) in st_fdma_tx_status()
597 txstate->residue = st_fdma_desc_residue(fchan, vd, true); in st_fdma_tx_status()
599 txstate->residue = st_fdma_desc_residue(fchan, vd, false); in st_fdma_tx_status()
601 txstate->residue = 0; in st_fdma_tx_status()
603 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_tx_status()
613 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_issue_pending()
615 if (vchan_issue_pending(&fchan->vchan) && !fchan->fdesc) in st_fdma_issue_pending()
618 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_issue_pending()
625 int ch_id = fchan->vchan.chan.chan_id; in st_fdma_pause()
628 dev_dbg(fchan->fdev->dev, "pause chan:%d\n", ch_id); in st_fdma_pause()
630 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_pause()
631 if (fchan->fdesc) in st_fdma_pause()
632 fdma_write(fchan->fdev, cmd, FDMA_CMD_SET_OFST); in st_fdma_pause()
633 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_pause()
643 int ch_id = fchan->vchan.chan.chan_id; in st_fdma_resume()
645 dev_dbg(fchan->fdev->dev, "resume chan:%d\n", ch_id); in st_fdma_resume()
647 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_resume()
648 if (fchan->fdesc) { in st_fdma_resume()
653 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_resume()
663 int ch_id = fchan->vchan.chan.chan_id; in st_fdma_terminate_all()
666 dev_dbg(fchan->fdev->dev, "terminate chan:%d\n", ch_id); in st_fdma_terminate_all()
668 spin_lock_irqsave(&fchan->vchan.lock, flags); in st_fdma_terminate_all()
669 fdma_write(fchan->fdev, cmd, FDMA_CMD_SET_OFST); in st_fdma_terminate_all()
670 fchan->fdesc = NULL; in st_fdma_terminate_all()
671 vchan_get_all_descriptors(&fchan->vchan, &head); in st_fdma_terminate_all()
672 spin_unlock_irqrestore(&fchan->vchan.lock, flags); in st_fdma_terminate_all()
673 vchan_dma_desc_free_list(&fchan->vchan, &head); in st_fdma_terminate_all()
683 memcpy(&fchan->scfg, slave_cfg, sizeof(fchan->scfg)); in st_fdma_slave_config()
703 { .compatible = "st,stih407-fdma-mpe31-11"
705 { .compatible = "st,stih407-fdma-mpe31-12"
707 { .compatible = "st,stih407-fdma-mpe31-13"
717 snprintf(fdev->fw_name, FW_NAME_SIZE, "fdma_%s_%d.elf", in st_fdma_parse_dt()
718 drvdata->name, drvdata->id); in st_fdma_parse_dt()
720 return of_property_read_u32(pdev->dev.of_node, "dma-channels", in st_fdma_parse_dt()
721 &fdev->nr_channels); in st_fdma_parse_dt()
733 for (i = 0; i < fdev->nr_channels; i++) { in st_fdma_free()
734 fchan = &fdev->chans[i]; in st_fdma_free()
735 list_del(&fchan->vchan.chan.device_node); in st_fdma_free()
736 tasklet_kill(&fchan->vchan.task); in st_fdma_free()
743 struct device_node *np = pdev->dev.of_node; in st_fdma_probe()
747 drvdata = device_get_match_data(&pdev->dev); in st_fdma_probe()
749 fdev = devm_kzalloc(&pdev->dev, sizeof(*fdev), GFP_KERNEL); in st_fdma_probe()
751 return -ENOMEM; in st_fdma_probe()
755 dev_err(&pdev->dev, "unable to find platform data\n"); in st_fdma_probe()
759 fdev->chans = devm_kcalloc(&pdev->dev, fdev->nr_channels, in st_fdma_probe()
761 if (!fdev->chans) in st_fdma_probe()
762 return -ENOMEM; in st_fdma_probe()
764 fdev->dev = &pdev->dev; in st_fdma_probe()
765 fdev->drvdata = drvdata; in st_fdma_probe()
768 fdev->irq = platform_get_irq(pdev, 0); in st_fdma_probe()
769 if (fdev->irq < 0) in st_fdma_probe()
770 return -EINVAL; in st_fdma_probe()
772 ret = devm_request_irq(&pdev->dev, fdev->irq, st_fdma_irq_handler, 0, in st_fdma_probe()
773 dev_name(&pdev->dev), fdev); in st_fdma_probe()
775 dev_err(&pdev->dev, "Failed to request irq (%d)\n", ret); in st_fdma_probe()
779 fdev->slim_rproc = st_slim_rproc_alloc(pdev, fdev->fw_name); in st_fdma_probe()
780 if (IS_ERR(fdev->slim_rproc)) { in st_fdma_probe()
781 ret = PTR_ERR(fdev->slim_rproc); in st_fdma_probe()
782 dev_err(&pdev->dev, "slim_rproc_alloc failed (%d)\n", ret); in st_fdma_probe()
787 INIT_LIST_HEAD(&fdev->dma_device.channels); in st_fdma_probe()
788 for (i = 0; i < fdev->nr_channels; i++) { in st_fdma_probe()
789 struct st_fdma_chan *fchan = &fdev->chans[i]; in st_fdma_probe()
791 fchan->fdev = fdev; in st_fdma_probe()
792 fchan->vchan.desc_free = st_fdma_free_desc; in st_fdma_probe()
793 vchan_init(&fchan->vchan, &fdev->dma_device); in st_fdma_probe()
797 fdev->dreq_mask = BIT(0) | BIT(31); in st_fdma_probe()
799 dma_cap_set(DMA_SLAVE, fdev->dma_device.cap_mask); in st_fdma_probe()
800 dma_cap_set(DMA_CYCLIC, fdev->dma_device.cap_mask); in st_fdma_probe()
801 dma_cap_set(DMA_MEMCPY, fdev->dma_device.cap_mask); in st_fdma_probe()
803 fdev->dma_device.dev = &pdev->dev; in st_fdma_probe()
804 fdev->dma_device.device_alloc_chan_resources = st_fdma_alloc_chan_res; in st_fdma_probe()
805 fdev->dma_device.device_free_chan_resources = st_fdma_free_chan_res; in st_fdma_probe()
806 fdev->dma_device.device_prep_dma_cyclic = st_fdma_prep_dma_cyclic; in st_fdma_probe()
807 fdev->dma_device.device_prep_slave_sg = st_fdma_prep_slave_sg; in st_fdma_probe()
808 fdev->dma_device.device_prep_dma_memcpy = st_fdma_prep_dma_memcpy; in st_fdma_probe()
809 fdev->dma_device.device_tx_status = st_fdma_tx_status; in st_fdma_probe()
810 fdev->dma_device.device_issue_pending = st_fdma_issue_pending; in st_fdma_probe()
811 fdev->dma_device.device_terminate_all = st_fdma_terminate_all; in st_fdma_probe()
812 fdev->dma_device.device_config = st_fdma_slave_config; in st_fdma_probe()
813 fdev->dma_device.device_pause = st_fdma_pause; in st_fdma_probe()
814 fdev->dma_device.device_resume = st_fdma_resume; in st_fdma_probe()
816 fdev->dma_device.src_addr_widths = FDMA_DMA_BUSWIDTHS; in st_fdma_probe()
817 fdev->dma_device.dst_addr_widths = FDMA_DMA_BUSWIDTHS; in st_fdma_probe()
818 fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in st_fdma_probe()
819 fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in st_fdma_probe()
821 ret = dmaenginem_async_device_register(&fdev->dma_device); in st_fdma_probe()
823 dev_err(&pdev->dev, in st_fdma_probe()
824 "Failed to register DMA device (%d)\n", ret); in st_fdma_probe()
830 dev_err(&pdev->dev, in st_fdma_probe()
835 dev_info(&pdev->dev, "ST FDMA engine driver, irq:%d\n", fdev->irq); in st_fdma_probe()
841 st_slim_rproc_put(fdev->slim_rproc); in st_fdma_probe()
850 devm_free_irq(&pdev->dev, fdev->irq, fdev); in st_fdma_remove()
851 st_slim_rproc_put(fdev->slim_rproc); in st_fdma_remove()
852 of_dma_controller_free(pdev->dev.of_node); in st_fdma_remove()