diff options
author | Andrew Lunn <andrew@lunn.ch> | 2012-02-19 07:30:26 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2012-05-08 19:34:02 -0400 |
commit | c510182b1c68e2f2bf61e69f6c65bcf61a188809 (patch) | |
tree | 3617d1484e75974409f2b00d5d0a2f3836943cc3 /drivers/dma | |
parent | 1f80b126d06cf5c88b7f03a80c79ffd85053688a (diff) |
ARM: Orion: XOR: Add support for clk
Some orion platforms can gate the XOR driver clock. If the clock
exisits, unable/disable it as appropriate.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/mv_xor.c | 15 | ||||
-rw-r--r-- | drivers/dma/mv_xor.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index fa5d55fea46c..0b12e68bf79c 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/memory.h> | 27 | #include <linux/memory.h> |
28 | #include <linux/clk.h> | ||
28 | #include <plat/mv_xor.h> | 29 | #include <plat/mv_xor.h> |
29 | 30 | ||
30 | #include "dmaengine.h" | 31 | #include "dmaengine.h" |
@@ -1307,11 +1308,25 @@ static int mv_xor_shared_probe(struct platform_device *pdev) | |||
1307 | if (dram) | 1308 | if (dram) |
1308 | mv_xor_conf_mbus_windows(msp, dram); | 1309 | mv_xor_conf_mbus_windows(msp, dram); |
1309 | 1310 | ||
1311 | /* Not all platforms can gate the clock, so it is not | ||
1312 | * an error if the clock does not exists. | ||
1313 | */ | ||
1314 | msp->clk = clk_get(&pdev->dev, NULL); | ||
1315 | if (!IS_ERR(msp->clk)) | ||
1316 | clk_prepare_enable(msp->clk); | ||
1317 | |||
1310 | return 0; | 1318 | return 0; |
1311 | } | 1319 | } |
1312 | 1320 | ||
1313 | static int mv_xor_shared_remove(struct platform_device *pdev) | 1321 | static int mv_xor_shared_remove(struct platform_device *pdev) |
1314 | { | 1322 | { |
1323 | struct mv_xor_shared_private *msp = platform_get_drvdata(pdev); | ||
1324 | |||
1325 | if (!IS_ERR(msp->clk)) { | ||
1326 | clk_disable_unprepare(msp->clk); | ||
1327 | clk_put(msp->clk); | ||
1328 | } | ||
1329 | |||
1315 | return 0; | 1330 | return 0; |
1316 | } | 1331 | } |
1317 | 1332 | ||
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h index 654876b7ba1d..a5b422f5a8ab 100644 --- a/drivers/dma/mv_xor.h +++ b/drivers/dma/mv_xor.h | |||
@@ -55,6 +55,7 @@ | |||
55 | struct mv_xor_shared_private { | 55 | struct mv_xor_shared_private { |
56 | void __iomem *xor_base; | 56 | void __iomem *xor_base; |
57 | void __iomem *xor_high_base; | 57 | void __iomem *xor_high_base; |
58 | struct clk *clk; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | 61 | ||