Lines Matching full:gate
21 * DOC: basic gatable clock which can gate and ungate it's ouput
30 static inline u32 clk_gate_readl(struct clk_gate *gate) in clk_gate_readl() argument
32 if (gate->flags & CLK_GATE_BIG_ENDIAN) in clk_gate_readl()
33 return ioread32be(gate->reg); in clk_gate_readl()
35 return readl(gate->reg); in clk_gate_readl()
38 static inline void clk_gate_writel(struct clk_gate *gate, u32 val) in clk_gate_writel() argument
40 if (gate->flags & CLK_GATE_BIG_ENDIAN) in clk_gate_writel()
41 iowrite32be(val, gate->reg); in clk_gate_writel()
43 writel(val, gate->reg); in clk_gate_writel()
61 struct clk_gate *gate = to_clk_gate(hw); in clk_gate_endisable() local
62 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in clk_gate_endisable()
71 if (gate->lock) in clk_gate_endisable()
72 spin_lock_irqsave(gate->lock, flags); in clk_gate_endisable()
74 __acquire(gate->lock); in clk_gate_endisable()
76 if (gate->flags & CLK_GATE_HIWORD_MASK) { in clk_gate_endisable()
77 reg = BIT(gate->bit_idx + 16); in clk_gate_endisable()
79 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
81 reg = clk_gate_readl(gate); in clk_gate_endisable()
84 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
86 reg &= ~BIT(gate->bit_idx); in clk_gate_endisable()
89 clk_gate_writel(gate, reg); in clk_gate_endisable()
91 if (gate->lock) in clk_gate_endisable()
92 spin_unlock_irqrestore(gate->lock, flags); in clk_gate_endisable()
94 __release(gate->lock); in clk_gate_endisable()
112 struct clk_gate *gate = to_clk_gate(hw); in clk_gate_is_enabled() local
114 reg = clk_gate_readl(gate); in clk_gate_is_enabled()
117 if (gate->flags & CLK_GATE_SET_TO_DISABLE) in clk_gate_is_enabled()
118 reg ^= BIT(gate->bit_idx); in clk_gate_is_enabled()
120 reg &= BIT(gate->bit_idx); in clk_gate_is_enabled()
141 struct clk_gate *gate; in __clk_hw_register_gate() local
148 pr_err("gate bit exceeds LOWORD field\n"); in __clk_hw_register_gate()
153 /* allocate the gate */ in __clk_hw_register_gate()
154 gate = kzalloc(sizeof(*gate), GFP_KERNEL); in __clk_hw_register_gate()
155 if (!gate) in __clk_hw_register_gate()
170 gate->reg = reg; in __clk_hw_register_gate()
171 gate->bit_idx = bit_idx; in __clk_hw_register_gate()
172 gate->flags = clk_gate_flags; in __clk_hw_register_gate()
173 gate->lock = lock; in __clk_hw_register_gate()
174 gate->hw.init = &init; in __clk_hw_register_gate()
176 hw = &gate->hw; in __clk_hw_register_gate()
182 kfree(gate); in __clk_hw_register_gate()
208 struct clk_gate *gate; in clk_unregister_gate() local
215 gate = to_clk_gate(hw); in clk_unregister_gate()
218 kfree(gate); in clk_unregister_gate()
224 struct clk_gate *gate; in clk_hw_unregister_gate() local
226 gate = to_clk_gate(hw); in clk_hw_unregister_gate()
229 kfree(gate); in clk_hw_unregister_gate()