Lines Matching refs:cmp

103 	struct ccu_mp *cmp = data;
107 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
108 rate *= cmp->fixed_post_div;
110 max_m = cmp->m.max ?: 1 << cmp->m.width;
111 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
113 if (!clk_hw_can_set_rate_parent(&cmp->common.hw)) {
120 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
121 rate /= cmp->fixed_post_div;
128 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
130 return ccu_gate_helper_disable(&cmp->common, cmp->enable);
135 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
137 return ccu_gate_helper_enable(&cmp->common, cmp->enable);
142 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
144 return ccu_gate_helper_is_enabled(&cmp->common, cmp->enable);
150 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
156 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
159 reg = readl(cmp->common.base + cmp->common.reg);
161 m = reg >> cmp->m.shift;
162 m &= (1 << cmp->m.width) - 1;
163 m += cmp->m.offset;
167 p = reg >> cmp->p.shift;
168 p &= (1 << cmp->p.width) - 1;
171 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
172 rate /= cmp->fixed_post_div;
180 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
182 return ccu_mux_helper_determine_rate(&cmp->common, &cmp->mux,
183 req, ccu_mp_round_rate, cmp);
189 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
196 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1,
199 max_m = cmp->m.max ?: 1 << cmp->m.width;
200 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
203 if (cmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
204 rate = rate * cmp->fixed_post_div;
208 spin_lock_irqsave(cmp->common.lock, flags);
210 reg = readl(cmp->common.base + cmp->common.reg);
211 reg &= ~GENMASK(cmp->m.width + cmp->m.shift - 1, cmp->m.shift);
212 reg &= ~GENMASK(cmp->p.width + cmp->p.shift - 1, cmp->p.shift);
213 reg |= (m - cmp->m.offset) << cmp->m.shift;
214 reg |= ilog2(p) << cmp->p.shift;
216 writel(reg, cmp->common.base + cmp->common.reg);
218 spin_unlock_irqrestore(cmp->common.lock, flags);
225 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
227 return ccu_mux_helper_get_parent(&cmp->common, &cmp->mux);
232 struct ccu_mp *cmp = hw_to_ccu_mp(hw);
234 return ccu_mux_helper_set_parent(&cmp->common, &cmp->mux, index);