Lines Matching refs:gate
49 struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
52 val = readl(gate->reg + AUTHEN_OFFSET);
55 writel(val, gate->reg + LPM_CUR_OFFSET);
57 val = readl(gate->reg + DIRECT_OFFSET);
58 val &= ~(gate->mask << gate->bit_idx);
60 val |= (gate->val & gate->mask) << gate->bit_idx;
61 writel(val, gate->reg + DIRECT_OFFSET);
67 struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
70 spin_lock_irqsave(gate->lock, flags);
72 if (gate->share_count && (*gate->share_count)++ > 0)
77 spin_unlock_irqrestore(gate->lock, flags);
84 struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
87 spin_lock_irqsave(gate->lock, flags);
89 if (gate->share_count) {
90 if (WARN_ON(*gate->share_count == 0))
92 else if (--(*gate->share_count) > 0)
98 spin_unlock_irqrestore(gate->lock, flags);
101 static int imx93_clk_gate_reg_is_enabled(struct imx93_clk_gate *gate)
103 u32 val = readl(gate->reg + AUTHEN_OFFSET);
106 val = readl(gate->reg + LPM_CUR_OFFSET);
110 val = readl(gate->reg);
111 if (((val >> gate->bit_idx) & gate->mask) == gate->val)
120 struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
124 spin_lock_irqsave(gate->lock, flags);
126 ret = imx93_clk_gate_reg_is_enabled(gate);
128 spin_unlock_irqrestore(gate->lock, flags);
135 struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
138 spin_lock_irqsave(gate->lock, flags);
140 if (!gate->share_count || *gate->share_count == 0)
143 spin_unlock_irqrestore(gate->lock, flags);
161 struct imx93_clk_gate *gate;
167 gate = kzalloc(sizeof(struct imx93_clk_gate), GFP_KERNEL);
168 if (!gate)
171 gate->reg = reg;
172 gate->lock = &imx_ccm_lock;
173 gate->bit_idx = bit_idx;
174 gate->val = val;
175 gate->mask = mask;
176 gate->share_count = share_count;
184 gate->hw.init = &init;
185 hw = &gate->hw;
193 kfree(gate);