diff options
author | Chao Xie <chao.xie@marvell.com> | 2014-10-31 03:13:48 +0100 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2014-11-13 01:34:10 +0100 |
commit | ae32a5b321c8484294d129e7980f8fcf35aa42af (patch) | |
tree | 65e22e25fb37606baecdb530d6005d5ab6b19332 /drivers/clk/mmp/reset.h | |
parent | clk: mmp: add basic support functions for DT support (diff) | |
download | linux-ae32a5b321c8484294d129e7980f8fcf35aa42af.tar.xz linux-ae32a5b321c8484294d129e7980f8fcf35aa42af.zip |
clk: mmp: add reset support
Some clock control regsiter has bit to reset the cotroller.
So before enable the clock, we need deassert the reset pin.
Make use of reset controller framework to export reset interface
for device drivers, then device driver can control the reset action.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/mmp/reset.h')
-rw-r--r-- | drivers/clk/mmp/reset.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/clk/mmp/reset.h b/drivers/clk/mmp/reset.h new file mode 100644 index 000000000000..be8b1a7000f7 --- /dev/null +++ b/drivers/clk/mmp/reset.h @@ -0,0 +1,31 @@ +#ifndef __MACH_MMP_CLK_RESET_H +#define __MACH_MMP_CLK_RESET_H + +#include <linux/reset-controller.h> + +#define MMP_RESET_INVERT 1 + +struct mmp_clk_reset_cell { + unsigned int clk_id; + void __iomem *reg; + u32 bits; + unsigned int flags; + spinlock_t *lock; +}; + +struct mmp_clk_reset_unit { + struct reset_controller_dev rcdev; + struct mmp_clk_reset_cell *cells; +}; + +#ifdef CONFIG_RESET_CONTROLLER +void mmp_clk_reset_register(struct device_node *np, + struct mmp_clk_reset_cell *cells, int nr_resets); +#else +static inline void mmp_clk_reset_register(struct device_node *np, + struct mmp_clk_reset_cell *cells, int nr_resets) +{ +} +#endif + +#endif |