Loading drivers/dma/stm32-dma.c +59 −12 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/sched.h> #include <linux/slab.h> Loading Loading @@ -641,12 +642,13 @@ static irqreturn_t stm32_dma_chan_irq(int irq, void *devid) { struct stm32_dma_chan *chan = devid; struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); u32 status, scr; u32 status, scr, sfcr; spin_lock(&chan->vchan.lock); status = stm32_dma_irq_status(chan); scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); sfcr = stm32_dma_read(dmadev, STM32_DMA_SFCR(chan->id)); if (status & STM32_DMA_TCI) { stm32_dma_irq_clear(chan, STM32_DMA_TCI); Loading @@ -661,11 +663,13 @@ static irqreturn_t stm32_dma_chan_irq(int irq, void *devid) if (status & STM32_DMA_FEI) { stm32_dma_irq_clear(chan, STM32_DMA_FEI); status &= ~STM32_DMA_FEI; if (sfcr & STM32_DMA_SFCR_FEIE) { if (!(scr & STM32_DMA_SCR_EN)) dev_err(chan2dev(chan), "FIFO Error\n"); else dev_dbg(chan2dev(chan), "FIFO over/underrun\n"); } } if (status) { stm32_dma_irq_clear(chan, status); dev_err(chan2dev(chan), "DMA error: status=0x%08x\n", status); Loading Loading @@ -1112,15 +1116,14 @@ static int stm32_dma_alloc_chan_resources(struct dma_chan *c) int ret; chan->config_init = false; ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(chan2dev(chan), "clk_prepare_enable failed: %d\n", ret); ret = pm_runtime_get_sync(dmadev->ddev.dev); if (ret < 0) return ret; } ret = stm32_dma_disable_chan(chan); if (ret < 0) clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); return ret; } Loading @@ -1140,7 +1143,7 @@ static void stm32_dma_free_chan_resources(struct dma_chan *c) spin_unlock_irqrestore(&chan->vchan.lock, flags); } clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); vchan_free_chan_resources(to_virt_chan(c)); } Loading Loading @@ -1240,6 +1243,12 @@ static int stm32_dma_probe(struct platform_device *pdev) return PTR_ERR(dmadev->clk); } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(&pdev->dev, "clk_prep_enable error: %d\n", ret); return ret; } dmadev->mem2mem = of_property_read_bool(pdev->dev.of_node, "st,mem2mem"); Loading Loading @@ -1289,7 +1298,7 @@ static int stm32_dma_probe(struct platform_device *pdev) ret = dma_async_device_register(dd); if (ret) return ret; goto clk_free; for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { chan = &dmadev->chan[i]; Loading Loading @@ -1321,20 +1330,58 @@ static int stm32_dma_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dmadev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); pm_runtime_put(&pdev->dev); dev_info(&pdev->dev, "STM32 DMA driver registered\n"); return 0; err_unregister: dma_async_device_unregister(dd); clk_free: clk_disable_unprepare(dmadev->clk); return ret; } #ifdef CONFIG_PM static int stm32_dma_runtime_suspend(struct device *dev) { struct stm32_dma_device *dmadev = dev_get_drvdata(dev); clk_disable_unprepare(dmadev->clk); return 0; } static int stm32_dma_runtime_resume(struct device *dev) { struct stm32_dma_device *dmadev = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(dmadev->clk); if (ret) { dev_err(dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_dma_pm_ops = { SET_RUNTIME_PM_OPS(stm32_dma_runtime_suspend, stm32_dma_runtime_resume, NULL) }; static struct platform_driver stm32_dma_driver = { .driver = { .name = "stm32-dma", .of_match_table = stm32_dma_of_match, .pm = &stm32_dma_pm_ops, }, }; Loading drivers/dma/stm32-dmamux.c +47 −11 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <linux/module.h> #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/slab.h> #include <linux/spinlock.h> Loading Loading @@ -79,8 +80,7 @@ static void stm32_dmamux_free(struct device *dev, void *route_data) stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), 0); clear_bit(mux->chan_id, dmamux->dma_inuse); if (!IS_ERR(dmamux->clk)) clk_disable(dmamux->clk); pm_runtime_put_sync(dev); spin_unlock_irqrestore(&dmamux->lock, flags); Loading Loading @@ -146,14 +146,11 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec, /* Set dma request */ spin_lock_irqsave(&dmamux->lock, flags); if (!IS_ERR(dmamux->clk)) { ret = clk_enable(dmamux->clk); ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { spin_unlock_irqrestore(&dmamux->lock, flags); dev_err(&pdev->dev, "clk_prep_enable issue: %d\n", ret); goto error; } } spin_unlock_irqrestore(&dmamux->lock, flags); mux->request = dma_spec->args[0]; Loading Loading @@ -254,6 +251,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "DMAMUX defaulting on %u requests\n", stm32_dmamux->dmamux_requests); } pm_runtime_get_noresume(&pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); iomem = devm_ioremap_resource(&pdev->dev, res); Loading Loading @@ -282,6 +280,8 @@ static int stm32_dmamux_probe(struct platform_device *pdev) stm32_dmamux->dmarouter.route_free = stm32_dmamux_free; platform_set_drvdata(pdev, stm32_dmamux); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); if (!IS_ERR(stm32_dmamux->clk)) { ret = clk_prepare_enable(stm32_dmamux->clk); Loading @@ -291,17 +291,52 @@ static int stm32_dmamux_probe(struct platform_device *pdev) } } pm_runtime_get_noresume(&pdev->dev); /* Reset the dmamux */ for (i = 0; i < stm32_dmamux->dma_requests; i++) stm32_dmamux_write(stm32_dmamux->iomem, STM32_DMAMUX_CCR(i), 0); if (!IS_ERR(stm32_dmamux->clk)) clk_disable(stm32_dmamux->clk); pm_runtime_put(&pdev->dev); return of_dma_router_register(node, stm32_dmamux_route_allocate, &stm32_dmamux->dmarouter); } #ifdef CONFIG_PM static int stm32_dmamux_runtime_suspend(struct device *dev) { struct platform_device *pdev = container_of(dev, struct platform_device, dev); struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); clk_disable_unprepare(stm32_dmamux->clk); return 0; } static int stm32_dmamux_runtime_resume(struct device *dev) { struct platform_device *pdev = container_of(dev, struct platform_device, dev); struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); int ret; ret = clk_prepare_enable(stm32_dmamux->clk); if (ret) { dev_err(&pdev->dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_dmamux_pm_ops = { SET_RUNTIME_PM_OPS(stm32_dmamux_runtime_suspend, stm32_dmamux_runtime_resume, NULL) }; static const struct of_device_id stm32_dmamux_match[] = { { .compatible = "st,stm32h7-dmamux" }, {}, Loading @@ -312,6 +347,7 @@ static struct platform_driver stm32_dmamux_driver = { .driver = { .name = "stm32-dmamux", .of_match_table = stm32_dmamux_match, .pm = &stm32_dmamux_pm_ops, }, }; Loading drivers/dma/stm32-mdma.c +49 −7 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/slab.h> Loading Loading @@ -1456,15 +1457,13 @@ static int stm32_mdma_alloc_chan_resources(struct dma_chan *c) return -ENOMEM; } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(chan2dev(chan), "clk_prepare_enable failed: %d\n", ret); ret = pm_runtime_get_sync(dmadev->ddev.dev); if (ret < 0) return ret; } ret = stm32_mdma_disable_chan(chan); if (ret < 0) clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); return ret; } Loading @@ -1484,7 +1483,7 @@ static void stm32_mdma_free_chan_resources(struct dma_chan *c) spin_unlock_irqrestore(&chan->vchan.lock, flags); } clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); vchan_free_chan_resources(to_virt_chan(c)); dmam_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; Loading Loading @@ -1579,9 +1578,11 @@ static int stm32_mdma_probe(struct platform_device *pdev) dmadev->nr_channels = nr_channels; dmadev->nr_requests = nr_requests; device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks", ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks", dmadev->ahb_addr_masks, count); if (ret) return ret; dmadev->nr_ahb_addr_masks = count; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); Loading @@ -1597,6 +1598,12 @@ static int stm32_mdma_probe(struct platform_device *pdev) return ret; } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(&pdev->dev, "clk_prep_enable error: %d\n", ret); return ret; } dmadev->rst = devm_reset_control_get(&pdev->dev, NULL); if (!IS_ERR(dmadev->rst)) { reset_control_assert(dmadev->rst); Loading Loading @@ -1668,6 +1675,10 @@ static int stm32_mdma_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, dmadev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); pm_runtime_put(&pdev->dev); dev_info(&pdev->dev, "STM32 MDMA driver registered\n"); Loading @@ -1677,11 +1688,42 @@ static int stm32_mdma_probe(struct platform_device *pdev) return ret; } #ifdef CONFIG_PM static int stm32_mdma_runtime_suspend(struct device *dev) { struct stm32_mdma_device *dmadev = dev_get_drvdata(dev); clk_disable_unprepare(dmadev->clk); return 0; } static int stm32_mdma_runtime_resume(struct device *dev) { struct stm32_mdma_device *dmadev = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(dmadev->clk); if (ret) { dev_err(dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_mdma_pm_ops = { SET_RUNTIME_PM_OPS(stm32_mdma_runtime_suspend, stm32_mdma_runtime_resume, NULL) }; static struct platform_driver stm32_mdma_driver = { .probe = stm32_mdma_probe, .driver = { .name = "stm32-mdma", .of_match_table = stm32_mdma_of_match, .pm = &stm32_mdma_pm_ops, }, }; Loading Loading
drivers/dma/stm32-dma.c +59 −12 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/sched.h> #include <linux/slab.h> Loading Loading @@ -641,12 +642,13 @@ static irqreturn_t stm32_dma_chan_irq(int irq, void *devid) { struct stm32_dma_chan *chan = devid; struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); u32 status, scr; u32 status, scr, sfcr; spin_lock(&chan->vchan.lock); status = stm32_dma_irq_status(chan); scr = stm32_dma_read(dmadev, STM32_DMA_SCR(chan->id)); sfcr = stm32_dma_read(dmadev, STM32_DMA_SFCR(chan->id)); if (status & STM32_DMA_TCI) { stm32_dma_irq_clear(chan, STM32_DMA_TCI); Loading @@ -661,11 +663,13 @@ static irqreturn_t stm32_dma_chan_irq(int irq, void *devid) if (status & STM32_DMA_FEI) { stm32_dma_irq_clear(chan, STM32_DMA_FEI); status &= ~STM32_DMA_FEI; if (sfcr & STM32_DMA_SFCR_FEIE) { if (!(scr & STM32_DMA_SCR_EN)) dev_err(chan2dev(chan), "FIFO Error\n"); else dev_dbg(chan2dev(chan), "FIFO over/underrun\n"); } } if (status) { stm32_dma_irq_clear(chan, status); dev_err(chan2dev(chan), "DMA error: status=0x%08x\n", status); Loading Loading @@ -1112,15 +1116,14 @@ static int stm32_dma_alloc_chan_resources(struct dma_chan *c) int ret; chan->config_init = false; ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(chan2dev(chan), "clk_prepare_enable failed: %d\n", ret); ret = pm_runtime_get_sync(dmadev->ddev.dev); if (ret < 0) return ret; } ret = stm32_dma_disable_chan(chan); if (ret < 0) clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); return ret; } Loading @@ -1140,7 +1143,7 @@ static void stm32_dma_free_chan_resources(struct dma_chan *c) spin_unlock_irqrestore(&chan->vchan.lock, flags); } clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); vchan_free_chan_resources(to_virt_chan(c)); } Loading Loading @@ -1240,6 +1243,12 @@ static int stm32_dma_probe(struct platform_device *pdev) return PTR_ERR(dmadev->clk); } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(&pdev->dev, "clk_prep_enable error: %d\n", ret); return ret; } dmadev->mem2mem = of_property_read_bool(pdev->dev.of_node, "st,mem2mem"); Loading Loading @@ -1289,7 +1298,7 @@ static int stm32_dma_probe(struct platform_device *pdev) ret = dma_async_device_register(dd); if (ret) return ret; goto clk_free; for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { chan = &dmadev->chan[i]; Loading Loading @@ -1321,20 +1330,58 @@ static int stm32_dma_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dmadev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); pm_runtime_put(&pdev->dev); dev_info(&pdev->dev, "STM32 DMA driver registered\n"); return 0; err_unregister: dma_async_device_unregister(dd); clk_free: clk_disable_unprepare(dmadev->clk); return ret; } #ifdef CONFIG_PM static int stm32_dma_runtime_suspend(struct device *dev) { struct stm32_dma_device *dmadev = dev_get_drvdata(dev); clk_disable_unprepare(dmadev->clk); return 0; } static int stm32_dma_runtime_resume(struct device *dev) { struct stm32_dma_device *dmadev = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(dmadev->clk); if (ret) { dev_err(dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_dma_pm_ops = { SET_RUNTIME_PM_OPS(stm32_dma_runtime_suspend, stm32_dma_runtime_resume, NULL) }; static struct platform_driver stm32_dma_driver = { .driver = { .name = "stm32-dma", .of_match_table = stm32_dma_of_match, .pm = &stm32_dma_pm_ops, }, }; Loading
drivers/dma/stm32-dmamux.c +47 −11 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <linux/module.h> #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/slab.h> #include <linux/spinlock.h> Loading Loading @@ -79,8 +80,7 @@ static void stm32_dmamux_free(struct device *dev, void *route_data) stm32_dmamux_write(dmamux->iomem, STM32_DMAMUX_CCR(mux->chan_id), 0); clear_bit(mux->chan_id, dmamux->dma_inuse); if (!IS_ERR(dmamux->clk)) clk_disable(dmamux->clk); pm_runtime_put_sync(dev); spin_unlock_irqrestore(&dmamux->lock, flags); Loading Loading @@ -146,14 +146,11 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec, /* Set dma request */ spin_lock_irqsave(&dmamux->lock, flags); if (!IS_ERR(dmamux->clk)) { ret = clk_enable(dmamux->clk); ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { spin_unlock_irqrestore(&dmamux->lock, flags); dev_err(&pdev->dev, "clk_prep_enable issue: %d\n", ret); goto error; } } spin_unlock_irqrestore(&dmamux->lock, flags); mux->request = dma_spec->args[0]; Loading Loading @@ -254,6 +251,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "DMAMUX defaulting on %u requests\n", stm32_dmamux->dmamux_requests); } pm_runtime_get_noresume(&pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); iomem = devm_ioremap_resource(&pdev->dev, res); Loading Loading @@ -282,6 +280,8 @@ static int stm32_dmamux_probe(struct platform_device *pdev) stm32_dmamux->dmarouter.route_free = stm32_dmamux_free; platform_set_drvdata(pdev, stm32_dmamux); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); if (!IS_ERR(stm32_dmamux->clk)) { ret = clk_prepare_enable(stm32_dmamux->clk); Loading @@ -291,17 +291,52 @@ static int stm32_dmamux_probe(struct platform_device *pdev) } } pm_runtime_get_noresume(&pdev->dev); /* Reset the dmamux */ for (i = 0; i < stm32_dmamux->dma_requests; i++) stm32_dmamux_write(stm32_dmamux->iomem, STM32_DMAMUX_CCR(i), 0); if (!IS_ERR(stm32_dmamux->clk)) clk_disable(stm32_dmamux->clk); pm_runtime_put(&pdev->dev); return of_dma_router_register(node, stm32_dmamux_route_allocate, &stm32_dmamux->dmarouter); } #ifdef CONFIG_PM static int stm32_dmamux_runtime_suspend(struct device *dev) { struct platform_device *pdev = container_of(dev, struct platform_device, dev); struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); clk_disable_unprepare(stm32_dmamux->clk); return 0; } static int stm32_dmamux_runtime_resume(struct device *dev) { struct platform_device *pdev = container_of(dev, struct platform_device, dev); struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); int ret; ret = clk_prepare_enable(stm32_dmamux->clk); if (ret) { dev_err(&pdev->dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_dmamux_pm_ops = { SET_RUNTIME_PM_OPS(stm32_dmamux_runtime_suspend, stm32_dmamux_runtime_resume, NULL) }; static const struct of_device_id stm32_dmamux_match[] = { { .compatible = "st,stm32h7-dmamux" }, {}, Loading @@ -312,6 +347,7 @@ static struct platform_driver stm32_dmamux_driver = { .driver = { .name = "stm32-dmamux", .of_match_table = stm32_dmamux_match, .pm = &stm32_dmamux_pm_ops, }, }; Loading
drivers/dma/stm32-mdma.c +49 −7 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <linux/of_device.h> #include <linux/of_dma.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/slab.h> Loading Loading @@ -1456,15 +1457,13 @@ static int stm32_mdma_alloc_chan_resources(struct dma_chan *c) return -ENOMEM; } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(chan2dev(chan), "clk_prepare_enable failed: %d\n", ret); ret = pm_runtime_get_sync(dmadev->ddev.dev); if (ret < 0) return ret; } ret = stm32_mdma_disable_chan(chan); if (ret < 0) clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); return ret; } Loading @@ -1484,7 +1483,7 @@ static void stm32_mdma_free_chan_resources(struct dma_chan *c) spin_unlock_irqrestore(&chan->vchan.lock, flags); } clk_disable_unprepare(dmadev->clk); pm_runtime_put(dmadev->ddev.dev); vchan_free_chan_resources(to_virt_chan(c)); dmam_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; Loading Loading @@ -1579,9 +1578,11 @@ static int stm32_mdma_probe(struct platform_device *pdev) dmadev->nr_channels = nr_channels; dmadev->nr_requests = nr_requests; device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks", ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks", dmadev->ahb_addr_masks, count); if (ret) return ret; dmadev->nr_ahb_addr_masks = count; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); Loading @@ -1597,6 +1598,12 @@ static int stm32_mdma_probe(struct platform_device *pdev) return ret; } ret = clk_prepare_enable(dmadev->clk); if (ret < 0) { dev_err(&pdev->dev, "clk_prep_enable error: %d\n", ret); return ret; } dmadev->rst = devm_reset_control_get(&pdev->dev, NULL); if (!IS_ERR(dmadev->rst)) { reset_control_assert(dmadev->rst); Loading Loading @@ -1668,6 +1675,10 @@ static int stm32_mdma_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, dmadev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); pm_runtime_put(&pdev->dev); dev_info(&pdev->dev, "STM32 MDMA driver registered\n"); Loading @@ -1677,11 +1688,42 @@ static int stm32_mdma_probe(struct platform_device *pdev) return ret; } #ifdef CONFIG_PM static int stm32_mdma_runtime_suspend(struct device *dev) { struct stm32_mdma_device *dmadev = dev_get_drvdata(dev); clk_disable_unprepare(dmadev->clk); return 0; } static int stm32_mdma_runtime_resume(struct device *dev) { struct stm32_mdma_device *dmadev = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(dmadev->clk); if (ret) { dev_err(dev, "failed to prepare_enable clock\n"); return ret; } return 0; } #endif static const struct dev_pm_ops stm32_mdma_pm_ops = { SET_RUNTIME_PM_OPS(stm32_mdma_runtime_suspend, stm32_mdma_runtime_resume, NULL) }; static struct platform_driver stm32_mdma_driver = { .probe = stm32_mdma_probe, .driver = { .name = "stm32-mdma", .of_match_table = stm32_mdma_of_match, .pm = &stm32_mdma_pm_ops, }, }; Loading