Lines Matching refs:gate

46 	struct clk_gate *gate = to_clk_gate(hw);  in clk_gate_endisable()  local
47 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in clk_gate_endisable()
53 if (gate->lock) in clk_gate_endisable()
54 spin_lock_irqsave(gate->lock, flags); 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()
90 struct clk_gate *gate = to_clk_gate(hw); in clk_gate_is_enabled() local
92 reg = clk_readl(gate->reg); in clk_gate_is_enabled()
95 if (gate->flags & CLK_GATE_SET_TO_DISABLE) in clk_gate_is_enabled()
96 reg ^= BIT(gate->bit_idx); in clk_gate_is_enabled()
98 reg &= BIT(gate->bit_idx); in clk_gate_is_enabled()
126 struct clk_gate *gate; in clk_register_gate() local
138 gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); in clk_register_gate()
139 if (!gate) { in clk_register_gate()
151 gate->reg = reg; in clk_register_gate()
152 gate->bit_idx = bit_idx; in clk_register_gate()
153 gate->flags = clk_gate_flags; in clk_register_gate()
154 gate->lock = lock; in clk_register_gate()
155 gate->hw.init = &init; in clk_register_gate()
157 clk = clk_register(dev, &gate->hw); in clk_register_gate()
160 kfree(gate); in clk_register_gate()
168 struct clk_gate *gate; in clk_unregister_gate() local
175 gate = to_clk_gate(hw); in clk_unregister_gate()
178 kfree(gate); in clk_unregister_gate()