Lines Matching refs:gate

18  * DOC: basic gatable clock which can gate and ungate its output
27 static inline u32 clk_gate_readl(struct clk_gate *gate)
29 if (gate->flags & CLK_GATE_BIG_ENDIAN)
30 return ioread32be(gate->reg);
32 return readl(gate->reg);
35 static inline void clk_gate_writel(struct clk_gate *gate, u32 val)
37 if (gate->flags & CLK_GATE_BIG_ENDIAN)
38 iowrite32be(val, gate->reg);
40 writel(val, gate->reg);
58 struct clk_gate *gate = to_clk_gate(hw);
59 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0;
65 if (gate->lock)
66 spin_lock_irqsave(gate->lock, flags);
68 __acquire(gate->lock);
70 if (gate->flags & CLK_GATE_HIWORD_MASK) {
71 reg = BIT(gate->bit_idx + 16);
73 reg |= BIT(gate->bit_idx);
75 reg = clk_gate_readl(gate);
78 reg |= BIT(gate->bit_idx);
80 reg &= ~BIT(gate->bit_idx);
83 clk_gate_writel(gate, reg);
85 if (gate->lock)
86 spin_unlock_irqrestore(gate->lock, flags);
88 __release(gate->lock);
106 struct clk_gate *gate = to_clk_gate(hw);
108 reg = clk_gate_readl(gate);
111 if (gate->flags & CLK_GATE_SET_TO_DISABLE)
112 reg ^= BIT(gate->bit_idx);
114 reg &= BIT(gate->bit_idx);
135 struct clk_gate *gate;
142 pr_err("gate bit exceeds LOWORD field\n");
147 /* allocate the gate */
148 gate = kzalloc(sizeof(*gate), GFP_KERNEL);
149 if (!gate)
164 gate->reg = reg;
165 gate->bit_idx = bit_idx;
166 gate->flags = clk_gate_flags;
167 gate->lock = lock;
168 gate->hw.init = &init;
170 hw = &gate->hw;
176 kfree(gate);
202 struct clk_gate *gate;
209 gate = to_clk_gate(hw);
212 kfree(gate);
218 struct clk_gate *gate;
220 gate = to_clk_gate(hw);
223 kfree(gate);