Lines Matching refs:gate
19 * DOC: basic gateable clock which can gate and ungate its output
43 struct clk_gate2 *gate = to_clk_gate2(hw);
46 reg = readl(gate->reg);
47 reg &= ~(gate->cgr_mask << gate->bit_idx);
49 reg |= (gate->cgr_val & gate->cgr_mask) << gate->bit_idx;
50 writel(reg, gate->reg);
55 struct clk_gate2 *gate = to_clk_gate2(hw);
58 spin_lock_irqsave(gate->lock, flags);
60 if (gate->share_count && (*gate->share_count)++ > 0)
65 spin_unlock_irqrestore(gate->lock, flags);
72 struct clk_gate2 *gate = to_clk_gate2(hw);
75 spin_lock_irqsave(gate->lock, flags);
77 if (gate->share_count) {
78 if (WARN_ON(*gate->share_count == 0))
80 else if (--(*gate->share_count) > 0)
86 spin_unlock_irqrestore(gate->lock, flags);
102 struct clk_gate2 *gate = to_clk_gate2(hw);
106 spin_lock_irqsave(gate->lock, flags);
108 ret = clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx,
109 gate->cgr_val, gate->cgr_mask);
111 spin_unlock_irqrestore(gate->lock, flags);
118 struct clk_gate2 *gate = to_clk_gate2(hw);
121 spin_lock_irqsave(gate->lock, flags);
123 if (!gate->share_count || *gate->share_count == 0)
126 spin_unlock_irqrestore(gate->lock, flags);
142 struct clk_gate2 *gate;
147 gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL);
148 if (!gate)
152 gate->reg = reg;
153 gate->bit_idx = bit_idx;
154 gate->cgr_val = cgr_val;
155 gate->cgr_mask = cgr_mask;
156 gate->flags = clk_gate2_flags;
157 gate->lock = lock;
158 gate->share_count = share_count;
166 gate->hw.init = &init;
167 hw = &gate->hw;
171 kfree(gate);