Lines Matching refs:cmp
101 struct ccu_mp *cmp = data;
105 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
106 rate *= cmp->fixed_post_div;
108 max_m = cmp->m.max ?: 1 << cmp->m.width;
109 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
111 if (!clk_hw_can_set_rate_parent(&cmp->common.hw)) {
119 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
120 rate /= cmp->fixed_post_div;
127 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
129 return ccu_gate_helper_disable(&cmp->common, cmp->enable);
134 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
136 return ccu_gate_helper_enable(&cmp->common, cmp->enable);
141 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
143 return ccu_gate_helper_is_enabled(&cmp->common, cmp->enable);
149 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
155 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
158 reg = readl(cmp->common.base + cmp->common.reg);
160 m = reg >> cmp->m.shift;
161 m &= (1 << cmp->m.width) - 1;
162 m += cmp->m.offset;
166 p = reg >> cmp->p.shift;
167 p &= (1 << cmp->p.width) - 1;
170 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
171 rate /= cmp->fixed_post_div;
179 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
181 return ccu_mux_helper_determine_rate(&cmp->common, &cmp->mux,
182 req, ccu_mp_round_rate, cmp);
188 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
195 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
198 max_m = cmp->m.max ?: 1 << cmp->m.width;
199 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
202 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
203 rate = rate * cmp->fixed_post_div;
207 spin_lock_irqsave(cmp->common.lock, flags);
209 reg = readl(cmp->common.base + cmp->common.reg);
210 reg &= ~GENMASK(cmp->m.width + cmp->m.shift - 1, cmp->m.shift);
211 reg &= ~GENMASK(cmp->p.width + cmp->p.shift - 1, cmp->p.shift);
212 reg |= (m - cmp->m.offset) << cmp->m.shift;
213 reg |= ilog2(p) << cmp->p.shift;
215 writel(reg, cmp->common.base + cmp->common.reg);
217 spin_unlock_irqrestore(cmp->common.lock, flags);
224 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
226 return ccu_mux_helper_get_parent(&cmp->common, &cmp->mux);
231 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
233 return ccu_mux_helper_set_parent(&cmp->common, &cmp->mux, index);