@@ -10,6 +10,7 @@
* published by the Free Software Foundation.
*/
+#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/list.h>
@@ -155,6 +156,7 @@ struct rcar_dmac {
struct dma_device engine;
struct device *dev;
void __iomem *iomem;
+ struct clk *clk;
char *irqname;
unsigned int n_channels;
@@ -1282,8 +1284,16 @@ static int rcar_dmac_suspend(struct device *dev)
static int rcar_dmac_resume(struct device *dev)
{
struct rcar_dmac *dmac = dev_get_drvdata(dev);
+ int ret;
- return rcar_dmac_init(dmac);
+ ret = clk_enable(dmac->clk);
+ if (ret < 0)
+ return ret;
+
+ ret = rcar_dmac_init(dmac);
+
+ clk_disable(dmac->clk);
+ return ret;
}
#endif
@@ -1336,6 +1346,12 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
return ret;
}
+ dmac->clk = clk_get(&pdev->dev, "fck");
+ if (IS_ERR(dmac->clk)) {
+ dev_err(&pdev->dev, "unable to get fck clock\n");
+ return PTR_ERR(dmac->clk);
+ }
+
/*
* Initialize the DMA engine channel and add it to the DMA engine
* channels list.