diff options
author | Chao Xie <chao.xie@marvell.com> | 2014-10-31 10:13:46 +0800 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2014-11-12 16:34:00 -0800 |
commit | cdce35460f5bd929cbcb75a8f436776bd0112f49 (patch) | |
tree | 00f8559dd38991327e643c86701c83faf5ceff4c /drivers/clk/mmp/clk.h | |
parent | ee81f4ee2a3632a2d7928f680c4af8243a18762f (diff) | |
download | linux-cdce35460f5bd929cbcb75a8f436776bd0112f49.tar.bz2 |
clk: mmp: add mmp private gate clock
Some SOCes have this kind of the gate clock
1. There are some bits to control the gate not only one bit.
2. It is not always that "1" is to enable while "0" is to disable
when write register.
So we have to define the "mask", "enable_val", "disable_val" for
this kind of gate clock.
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/clk.h')
-rw-r--r-- | drivers/clk/mmp/clk.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h index 26b24699ccd7..23371062072b 100644 --- a/drivers/clk/mmp/clk.h +++ b/drivers/clk/mmp/clk.h @@ -103,6 +103,27 @@ extern struct clk *mmp_clk_register_mix(struct device *dev, spinlock_t *lock); +/* Clock type "gate". MMP private gate */ +#define MMP_CLK_GATE_NEED_DELAY BIT(0) + +struct mmp_clk_gate { + struct clk_hw hw; + void __iomem *reg; + u32 mask; + u32 val_enable; + u32 val_disable; + unsigned int flags; + spinlock_t *lock; +}; + +extern const struct clk_ops mmp_clk_gate_ops; +extern struct clk *mmp_clk_register_gate(struct device *dev, const char *name, + const char *parent_name, unsigned long flags, + void __iomem *reg, u32 mask, u32 val_enable, + u32 val_disable, unsigned int gate_flags, + spinlock_t *lock); + + extern struct clk *mmp_clk_register_pll2(const char *name, const char *parent_name, unsigned long flags); extern struct clk *mmp_clk_register_apbc(const char *name, |