diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-07-31 07:01:34 +0000 |
---|---|---|
committer | Lukasz Majewski <lukma@denx.de> | 2019-07-31 09:20:51 +0200 |
commit | 1c643303187c595eb6782329529d2aec3731e473 (patch) | |
tree | 0271e1afbab7edf01f63f484abd97ef0c8ebc79c /include/linux | |
parent | 1b0d09cddb6d6b4d30f561dc8e4fb2ce904a5b58 (diff) |
clk: add clk-gate support
Import clk-gate support from Linux Kernel 5.1-rc5
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/clk-provider.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 6d62f862d2..8b04ecd7a5 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -69,6 +69,24 @@ struct clk_mux { extern const struct clk_ops clk_mux_ops; u8 clk_mux_get_parent(struct clk *clk); +struct clk_gate { + struct clk clk; + void __iomem *reg; + u8 bit_idx; + u8 flags; +}; + +#define to_clk_gate(_clk) container_of(_clk, struct clk_gate, clk) + +#define CLK_GATE_SET_TO_DISABLE BIT(0) +#define CLK_GATE_HIWORD_MASK BIT(1) + +extern const struct clk_ops clk_gate_ops; +struct clk *clk_register_gate(struct device *dev, const char *name, + const char *parent_name, unsigned long flags, + void __iomem *reg, u8 bit_idx, + u8 clk_gate_flags, spinlock_t *lock); + struct clk_div_table { unsigned int val; unsigned int div; |