• Home
  • Raw
  • Download

Lines Matching full:gate

20  * DOC: basic gatable clock which can gate and ungate it's ouput
44 struct clk_gate *gate = to_clk_gate(hw); in clk_gate_endisable() local
45 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in clk_gate_endisable()
51 if (gate->lock) in clk_gate_endisable()
52 spin_lock_irqsave(gate->lock, flags); in clk_gate_endisable()
54 __acquire(gate->lock); in clk_gate_endisable()
56 if (gate->flags & CLK_GATE_HIWORD_MASK) { in clk_gate_endisable()
57 reg = BIT(gate->bit_idx + 16); in clk_gate_endisable()
59 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
61 reg = clk_readl(gate->reg); in clk_gate_endisable()
64 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
66 reg &= ~BIT(gate->bit_idx); in clk_gate_endisable()
69 clk_writel(reg, gate->reg); in clk_gate_endisable()
71 if (gate->lock) in clk_gate_endisable()
72 spin_unlock_irqrestore(gate->lock, flags); in clk_gate_endisable()
74 __release(gate->lock); in clk_gate_endisable()
92 struct clk_gate *gate = to_clk_gate(hw); in clk_gate_is_enabled() local
94 reg = clk_readl(gate->reg); in clk_gate_is_enabled()
97 if (gate->flags & CLK_GATE_SET_TO_DISABLE) in clk_gate_is_enabled()
98 reg ^= BIT(gate->bit_idx); in clk_gate_is_enabled()
100 reg &= BIT(gate->bit_idx); in clk_gate_is_enabled()
114 * clk_hw_register_gate - register a gate clock with the clock framework
121 * @clk_gate_flags: gate-specific flags for this clock
129 struct clk_gate *gate; in clk_hw_register_gate() local
136 pr_err("gate bit exceeds LOWORD field\n"); in clk_hw_register_gate()
141 /* allocate the gate */ in clk_hw_register_gate()
142 gate = kzalloc(sizeof(*gate), GFP_KERNEL); in clk_hw_register_gate()
143 if (!gate) in clk_hw_register_gate()
153 gate->reg = reg; in clk_hw_register_gate()
154 gate->bit_idx = bit_idx; in clk_hw_register_gate()
155 gate->flags = clk_gate_flags; in clk_hw_register_gate()
156 gate->lock = lock; in clk_hw_register_gate()
157 gate->hw.init = &init; in clk_hw_register_gate()
159 hw = &gate->hw; in clk_hw_register_gate()
162 kfree(gate); in clk_hw_register_gate()
187 struct clk_gate *gate; in clk_unregister_gate() local
194 gate = to_clk_gate(hw); in clk_unregister_gate()
197 kfree(gate); in clk_unregister_gate()
203 struct clk_gate *gate; in clk_hw_unregister_gate() local
205 gate = to_clk_gate(hw); in clk_hw_unregister_gate()
208 kfree(gate); in clk_hw_unregister_gate()