[PATCH 07/10] dmaengine: mcf-edma: enable edma clock
From: Angelo Dureghello
Date: Tue Dec 01 2026 - 17:40:52 EST
Enable edma clock on probe for ColdFire (mcf) edma.
Actually, the edma clock was default-enable from the ColdFire arch init.
To be sure that module clock is always enabled, whatever defaults are and
could be in the future, enabling it.
Signed-off-by: Angelo Dureghello <angelo@xxxxxxxxxxxxxxxx>
---
drivers/dma/mcf-edma-main.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
index 4ed0ce644e37..4e46110a2a98 100644
--- a/drivers/dma/mcf-edma-main.c
+++ b/drivers/dma/mcf-edma-main.c
@@ -3,6 +3,7 @@
// Copyright (c) 2013-2014 Freescale Semiconductor, Inc
// Copyright (c) 2017 Sysam, Angelo Dureghello <angelo@xxxxxxxx>
+#include <linux/clk.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/dmaengine.h>
@@ -145,7 +146,7 @@ static void mcf_edma_irq_free(struct platform_device *pdev,
}
static struct fsl_edma_drvdata mcf_data = {
- .flags = FSL_EDMA_DRV_EDMA64,
+ .flags = FSL_EDMA_DRV_EDMA64 | FSL_EDMA_DRV_HAS_DMACLK,
.setup_irq = mcf_edma_irq_init,
};
@@ -186,6 +187,14 @@ static int mcf_edma_probe(struct platform_device *pdev)
if (IS_ERR(mcf_edma->membase))
return PTR_ERR(mcf_edma->membase);
+ if (mcf_edma->drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) {
+ mcf_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "edma");
+ if (IS_ERR(mcf_edma->dmaclk))
+ return dev_err_probe(&pdev->dev,
+ PTR_ERR(mcf_edma->dmaclk),
+ "Missing DMA block clock.\n");
+ }
+
fsl_edma_setup_regs(mcf_edma);
regs = &mcf_edma->regs;
@@ -262,12 +271,19 @@ static void mcf_edma_remove(struct platform_device *pdev)
dma_async_device_unregister(&mcf_edma->dma_dev);
}
+static const struct platform_device_id mcf_edma_ids[] = {
+ { .name = "mcfedma" },
+ { }
+};
+MODULE_DEVICE_TABLE(platform, mcf_edma_ids);
+
static struct platform_driver mcf_edma_driver = {
.driver = {
.name = "mcf-edma",
},
.probe = mcf_edma_probe,
.remove = mcf_edma_remove,
+ .id_table = mcf_edma_ids,
};
bool mcf_edma_filter_fn(struct dma_chan *chan, void *param)
--
2.56.1