From 6eb2ba6f1b206bb7d688036a28c98eb4a89be781 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 31 Mar 2018 18:13:57 -0700 Subject: dma: apbh: Enable clock as a part of probing Enable clock as a part of probing in order to avoid problems on SoCs that do not have this block ungated out of reset (e.g. i.MX7). Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/dma/apbh_dma.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/dma') diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c index b84c0f7985..79f25109f9 100644 --- a/drivers/dma/apbh_dma.c +++ b/drivers/dma/apbh_dma.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,7 @@ enum mxs_dma_id { struct apbh_dma { void __iomem *regs; + struct clk *clk; enum mxs_dma_id id; }; @@ -606,6 +608,17 @@ static int apbh_dma_probe(struct device_d *dev) apbh->id = id; + apbh->clk = clk_get(dev, NULL); + if (IS_ERR(apbh->clk)) + return PTR_ERR(apbh->clk); + + ret = clk_enable(apbh->clk); + if (ret) { + dev_err(dev, "Failed to enable clock: %s\n", + strerror(ret)); + return ret; + } + ret = stmp_reset_block(apbh->regs, 0); if (ret) return ret; -- cgit v1.2.3