Lines Matching refs:gate
49 struct clk_gate *gate = to_clk_gate(clk); in clk_gate_endisable() local
50 int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in clk_gate_endisable()
55 if (gate->flags & CLK_GATE_HIWORD_MASK) { in clk_gate_endisable()
56 reg = BIT(gate->bit_idx + 16); in clk_gate_endisable()
58 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
61 reg = gate->io_gate_val; in clk_gate_endisable()
63 reg = readl(gate->reg); in clk_gate_endisable()
67 reg |= BIT(gate->bit_idx); in clk_gate_endisable()
69 reg &= ~BIT(gate->bit_idx); in clk_gate_endisable()
72 writel(reg, gate->reg); in clk_gate_endisable()
91 struct clk_gate *gate = to_clk_gate(clk); in clk_gate_is_enabled() local
95 reg = gate->io_gate_val; in clk_gate_is_enabled()
97 reg = readl(gate->reg); in clk_gate_is_enabled()
101 if (gate->flags & CLK_GATE_SET_TO_DISABLE) in clk_gate_is_enabled()
102 reg ^= BIT(gate->bit_idx); in clk_gate_is_enabled()
104 reg &= BIT(gate->bit_idx); in clk_gate_is_enabled()
120 struct clk_gate *gate; in clk_register_gate() local
132 gate = kzalloc(sizeof(*gate), GFP_KERNEL); in clk_register_gate()
133 if (!gate) in clk_register_gate()
137 gate->reg = reg; in clk_register_gate()
138 gate->bit_idx = bit_idx; in clk_register_gate()
139 gate->flags = clk_gate_flags; in clk_register_gate()
141 gate->io_gate_val = *(u32 *)reg; in clk_register_gate()
144 clk = &gate->clk; in clk_register_gate()
149 kfree(gate); in clk_register_gate()