Re: [PATCH v5 4/5] dmaengine: arm-dma350: Support integration clocks and resets
From: Frank Li
Date: Wed Nov 04 2026 - 15:20:27 EST
On Wed, Nov 04, 2026 at 08:44:10PM +0800, Jelly Jia wrote:
> DMA-350 integrations may gate the controller with a clock or hold it in
> reset. Enable an optional clock and deassert an optional reset before
> accessing the controller registers.
>
> Use the deasserted reset helper rather than requesting a reset pulse.
> This also supports reset controllers that only implement assert and
> deassert operations.
>
> Both resources remain optional, so existing integrations without them
> are unchanged.
>
> Signed-off-by: Jelly Jia <Jelly.Jia@xxxxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> drivers/dma/arm-dma350.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
> index cfe3bacfab68..2f22f8a0ab47 100644
> --- a/drivers/dma/arm-dma350.c
> +++ b/drivers/dma/arm-dma350.c
> @@ -4,6 +4,7 @@
>
> #include <linux/bitfield.h>
> #include <linux/bitops.h>
> +#include <linux/clk.h>
> #include <linux/dmaengine.h>
> #include <linux/dma-mapping.h>
> #include <linux/dmapool.h>
> @@ -14,6 +15,7 @@
> #include <linux/module.h>
> #include <linux/overflow.h>
> #include <linux/platform_device.h>
> +#include <linux/reset.h>
> #include <linux/scatterlist.h>
> #include <linux/slab.h>
>
> @@ -1247,12 +1249,24 @@ static void d350_free_chan_resources(struct dma_chan *chan)
> static int d350_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> + struct reset_control *reset;
> + struct clk *clk;
> struct d350 *dmac;
> void __iomem *base;
> u32 reg;
> int ret, nchan, dw, aw, r, p;
> bool coherent, memset;
>
> + clk = devm_clk_get_optional_enabled(dev, NULL);
> + if (IS_ERR(clk))
> + return dev_err_probe(dev, PTR_ERR(clk),
> + "failed to enable clock\n");
> +
> + reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
> + if (IS_ERR(reset))
> + return dev_err_probe(dev, PTR_ERR(reset),
> + "failed to deassert reset\n");
> +
> base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(base))
> return PTR_ERR(base);
> --
> 2.54.0
>