summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-03-31 18:13:57 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2018-04-03 09:11:41 +0200
commit6eb2ba6f1b206bb7d688036a28c98eb4a89be781 (patch)
tree406665d29146aaadfd6ed696925a37bfebd15b74 /drivers/dma
parent0c7632c0185739214f584987e348e377341b0b99 (diff)
downloadbarebox-6eb2ba6f1b206bb7d688036a28c98eb4a89be781.tar.gz
barebox-6eb2ba6f1b206bb7d688036a28c98eb4a89be781.tar.xz
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 <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/apbh_dma.c13
1 files changed, 13 insertions, 0 deletions
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 <dma/apbh-dma.h>
#include <stmp-device.h>
+#include <linux/clk.h>
#include <linux/list.h>
#include <linux/err.h>
#include <common.h>
@@ -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;