Lines Matching refs:dmadev
256 static u32 stm32_dma_read(struct stm32_dma_device *dmadev, u32 reg) in stm32_dma_read() argument
258 return readl_relaxed(dmadev->base + reg); in stm32_dma_read()
261 static void stm32_dma_write(struct stm32_dma_device *dmadev, u32 reg, u32 val) in stm32_dma_write() argument
263 writel_relaxed(val, dmadev->base + reg); in stm32_dma_write()
418 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_irq_status() local
426 dma_isr = stm32_dma_read(dmadev, STM32_DMA_ISR(chan->id)); in stm32_dma_irq_status()
434 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_irq_clear() local
444 stm32_dma_write(dmadev, STM32_DMA_IFCR(chan->id), dma_ifcr); in stm32_dma_irq_clear()
449 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_disable_chan() local
454 dma_scr = stm32_dma_read(dmadev, reg); in stm32_dma_disable_chan()
458 stm32_dma_write(dmadev, reg, dma_scr); in stm32_dma_disable_chan()
460 return readl_relaxed_poll_timeout_atomic(dmadev->base + reg, in stm32_dma_disable_chan()
470 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_stop() local
475 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); in stm32_dma_stop()
477 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), dma_scr); in stm32_dma_stop()
478 dma_sfcr = stm32_dma_read(dmadev, STM32_DMA_SFCR(chan->id)); in stm32_dma_stop()
480 stm32_dma_write(dmadev, STM32_DMA_SFCR(chan->id), dma_sfcr); in stm32_dma_stop()
531 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_dump_reg() local
532 u32 scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); in stm32_dma_dump_reg()
533 u32 ndtr = stm32_dma_read(dmadev, STM32_DMA_SNDTR(chan->id)); in stm32_dma_dump_reg()
534 u32 spar = stm32_dma_read(dmadev, STM32_DMA_SPAR(chan->id)); in stm32_dma_dump_reg()
535 u32 sm0ar = stm32_dma_read(dmadev, STM32_DMA_SM0AR(chan->id)); in stm32_dma_dump_reg()
536 u32 sm1ar = stm32_dma_read(dmadev, STM32_DMA_SM1AR(chan->id)); in stm32_dma_dump_reg()
537 u32 sfcr = stm32_dma_read(dmadev, STM32_DMA_SFCR(chan->id)); in stm32_dma_dump_reg()
558 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_start_transfer() local
591 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), reg->dma_scr); in stm32_dma_start_transfer()
592 stm32_dma_write(dmadev, STM32_DMA_SPAR(chan->id), reg->dma_spar); in stm32_dma_start_transfer()
593 stm32_dma_write(dmadev, STM32_DMA_SM0AR(chan->id), reg->dma_sm0ar); in stm32_dma_start_transfer()
594 stm32_dma_write(dmadev, STM32_DMA_SFCR(chan->id), reg->dma_sfcr); in stm32_dma_start_transfer()
595 stm32_dma_write(dmadev, STM32_DMA_SM1AR(chan->id), reg->dma_sm1ar); in stm32_dma_start_transfer()
596 stm32_dma_write(dmadev, STM32_DMA_SNDTR(chan->id), reg->dma_sndtr); in stm32_dma_start_transfer()
614 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), reg->dma_scr); in stm32_dma_start_transfer()
621 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_configure_next_sg() local
626 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); in stm32_dma_configure_next_sg()
632 stm32_dma_write(dmadev, STM32_DMA_SM0AR(id), dma_sm0ar); in stm32_dma_configure_next_sg()
634 stm32_dma_read(dmadev, STM32_DMA_SM0AR(id))); in stm32_dma_configure_next_sg()
637 stm32_dma_write(dmadev, STM32_DMA_SM1AR(id), dma_sm1ar); in stm32_dma_configure_next_sg()
639 stm32_dma_read(dmadev, STM32_DMA_SM1AR(id))); in stm32_dma_configure_next_sg()
645 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_handle_chan_paused() local
652 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); in stm32_dma_handle_chan_paused()
672 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), dma_scr); in stm32_dma_handle_chan_paused()
675 chan->chan_reg.dma_sndtr = stm32_dma_read(dmadev, STM32_DMA_SNDTR(chan->id)); in stm32_dma_handle_chan_paused()
684 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_post_resume_reconfigure() local
689 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); in stm32_dma_post_resume_reconfigure()
702 stm32_dma_write(dmadev, STM32_DMA_SNDTR(chan->id), sg_req->chan_reg.dma_sndtr); in stm32_dma_post_resume_reconfigure()
705 stm32_dma_write(dmadev, STM32_DMA_SPAR(id), sg_req->chan_reg.dma_spar); in stm32_dma_post_resume_reconfigure()
708 stm32_dma_write(dmadev, STM32_DMA_SM0AR(id), sg_req->chan_reg.dma_sm0ar); in stm32_dma_post_resume_reconfigure()
709 stm32_dma_write(dmadev, STM32_DMA_SM1AR(id), sg_req->chan_reg.dma_sm1ar); in stm32_dma_post_resume_reconfigure()
722 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), dma_scr); in stm32_dma_post_resume_reconfigure()
729 stm32_dma_write(dmadev, STM32_DMA_SCR(chan->id), dma_scr); in stm32_dma_post_resume_reconfigure()
763 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_chan_irq() local
769 scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); in stm32_dma_chan_irq()
770 sfcr = stm32_dma_read(dmadev, STM32_DMA_SFCR(chan->id)); in stm32_dma_chan_irq()
853 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_resume() local
862 scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); in stm32_dma_resume()
886 stm32_dma_write(dmadev, STM32_DMA_SPAR(id), spar + offset); in stm32_dma_resume()
888 stm32_dma_write(dmadev, STM32_DMA_SPAR(id), spar); in stm32_dma_resume()
899 stm32_dma_write(dmadev, STM32_DMA_SM1AR(id), sm1ar + offset); in stm32_dma_resume()
901 stm32_dma_write(dmadev, STM32_DMA_SM0AR(id), sm0ar + offset); in stm32_dma_resume()
904 stm32_dma_write(dmadev, STM32_DMA_SNDTR(id), chan_reg.dma_sndtr); in stm32_dma_resume()
921 stm32_dma_write(dmadev, STM32_DMA_SCR(id), chan_reg.dma_scr); in stm32_dma_resume()
1298 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_get_remaining_bytes() local
1300 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); in stm32_dma_get_remaining_bytes()
1302 ndtr = stm32_dma_read(dmadev, STM32_DMA_SNDTR(chan->id)); in stm32_dma_get_remaining_bytes()
1321 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_is_current_sg() local
1326 dma_scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); in stm32_dma_is_current_sg()
1337 dma_smar = stm32_dma_read(dmadev, STM32_DMA_SM0AR(id)); in stm32_dma_is_current_sg()
1346 dma_smar = stm32_dma_read(dmadev, STM32_DMA_SM1AR(id)); in stm32_dma_is_current_sg()
1459 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_alloc_chan_resources() local
1464 ret = pm_runtime_resume_and_get(dmadev->ddev.dev); in stm32_dma_alloc_chan_resources()
1470 pm_runtime_put(dmadev->ddev.dev); in stm32_dma_alloc_chan_resources()
1478 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); in stm32_dma_free_chan_resources() local
1490 pm_runtime_put(dmadev->ddev.dev); in stm32_dma_free_chan_resources()
1524 struct stm32_dma_device *dmadev = ofdma->of_dma_data; in stm32_dma_of_xlate() local
1525 struct device *dev = dmadev->ddev.dev; in stm32_dma_of_xlate()
1546 chan = &dmadev->chan[cfg.channel_id]; in stm32_dma_of_xlate()
1568 struct stm32_dma_device *dmadev; in stm32_dma_probe() local
1574 dmadev = devm_kzalloc(&pdev->dev, sizeof(*dmadev), GFP_KERNEL); in stm32_dma_probe()
1575 if (!dmadev) in stm32_dma_probe()
1578 dd = &dmadev->ddev; in stm32_dma_probe()
1580 dmadev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in stm32_dma_probe()
1581 if (IS_ERR(dmadev->base)) in stm32_dma_probe()
1582 return PTR_ERR(dmadev->base); in stm32_dma_probe()
1584 dmadev->clk = devm_clk_get(&pdev->dev, NULL); in stm32_dma_probe()
1585 if (IS_ERR(dmadev->clk)) in stm32_dma_probe()
1586 return dev_err_probe(&pdev->dev, PTR_ERR(dmadev->clk), "Can't get clock\n"); in stm32_dma_probe()
1588 ret = clk_prepare_enable(dmadev->clk); in stm32_dma_probe()
1594 dmadev->mem2mem = of_property_read_bool(pdev->dev.of_node, in stm32_dma_probe()
1639 if (dmadev->mem2mem) { in stm32_dma_probe()
1646 chan = &dmadev->chan[i]; in stm32_dma_probe()
1663 chan = &dmadev->chan[i]; in stm32_dma_probe()
1681 stm32_dma_of_xlate, dmadev); in stm32_dma_probe()
1688 platform_set_drvdata(pdev, dmadev); in stm32_dma_probe()
1702 clk_disable_unprepare(dmadev->clk); in stm32_dma_probe()
1710 struct stm32_dma_device *dmadev = dev_get_drvdata(dev); in stm32_dma_runtime_suspend() local
1712 clk_disable_unprepare(dmadev->clk); in stm32_dma_runtime_suspend()
1719 struct stm32_dma_device *dmadev = dev_get_drvdata(dev); in stm32_dma_runtime_resume() local
1722 ret = clk_prepare_enable(dmadev->clk); in stm32_dma_runtime_resume()
1735 struct stm32_dma_device *dmadev = dev_get_drvdata(dev); in stm32_dma_pm_suspend() local
1743 scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); in stm32_dma_pm_suspend()