Lines Matching refs:gate

17  * DOC: basic gatable clock which can gate and ungate it's ouput
26 static inline u32 clk_gate_readl(struct clk_gate *gate)
28 if (gate->flags & CLK_GATE_BIG_ENDIAN)
29 return ioread32be(gate->reg);
31 return readl(gate->reg);
34 static inline void clk_gate_writel(struct clk_gate *gate, u32 val)
36 if (gate->flags & CLK_GATE_BIG_ENDIAN)
37 iowrite32be(val, gate->reg);
39 writel(val, gate->reg);
57 struct clk_gate *gate = to_clk_gate(hw);
58 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0;
64 if (gate->lock)
65 spin_lock_irqsave(gate->lock, flags);
67 __acquire(gate->lock);
69 if (gate->flags & CLK_GATE_HIWORD_MASK) {
70 reg = BIT(gate->bit_idx + 16);
72 reg |= BIT(gate->bit_idx);
74 reg = clk_gate_readl(gate);
77 reg |= BIT(gate->bit_idx);
79 reg &= ~BIT(gate->bit_idx);
82 clk_gate_writel(gate, reg);
84 if (gate->lock)
85 spin_unlock_irqrestore(gate->lock, flags);
87 __release(gate->lock);
105 struct clk_gate *gate = to_clk_gate(hw);
107 reg = clk_gate_readl(gate);
110 if (gate->flags & CLK_GATE_SET_TO_DISABLE)
111 reg ^= BIT(gate->bit_idx);
113 reg &= BIT(gate->bit_idx);
134 struct clk_gate *gate;
141 pr_err("gate bit exceeds LOWORD field\n");
146 /* allocate the gate */
147 gate = kzalloc(sizeof(*gate), GFP_KERNEL);
148 if (!gate)
163 gate->reg = reg;
164 gate->bit_idx = bit_idx;
165 gate->flags = clk_gate_flags;
166 gate->lock = lock;
167 gate->hw.init = &init;
169 hw = &gate->hw;
175 kfree(gate);
201 struct clk_gate *gate;
208 gate = to_clk_gate(hw);
211 kfree(gate);
217 struct clk_gate *gate;
219 gate = to_clk_gate(hw);
222 kfree(gate);