1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

clk: add clk-gate support

Import clk-gate support from Linux Kernel 5.1-rc5

Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan
2019-07-31 07:01:34 +00:00
committed by Lukasz Majewski
parent 1b0d09cddb
commit 1c64330318
3 changed files with 167 additions and 1 deletions

View File

@@ -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;