mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Tested-by: Jamie Lentin <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
This commit is contained in:
parent
1f80b126d0
commit
c510182b1c
3 changed files with 21 additions and 5 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/memory.h>
|
||||
#include <linux/clk.h>
|
||||
#include <plat/mv_xor.h>
|
||||
|
||||
#include "dmaengine.h"
|
||||
|
|
@ -1307,11 +1308,25 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
|
|||
if (dram)
|
||||
mv_xor_conf_mbus_windows(msp, dram);
|
||||
|
||||
/* Not all platforms can gate the clock, so it is not
|
||||
* an error if the clock does not exists.
|
||||
*/
|
||||
msp->clk = clk_get(&pdev->dev, NULL);
|
||||
if (!IS_ERR(msp->clk))
|
||||
clk_prepare_enable(msp->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mv_xor_shared_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mv_xor_shared_private *msp = platform_get_drvdata(pdev);
|
||||
|
||||
if (!IS_ERR(msp->clk)) {
|
||||
clk_disable_unprepare(msp->clk);
|
||||
clk_put(msp->clk);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
struct mv_xor_shared_private {
|
||||
void __iomem *xor_base;
|
||||
void __iomem *xor_high_base;
|
||||
struct clk *clk;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue