Lines Matching refs:cm
16 struct ccu_mux_internal *cm, in ccu_mux_get_prediv() argument
32 parent_index = reg >> cm->shift; in ccu_mux_get_prediv()
33 parent_index &= (1 << cm->width) - 1; in ccu_mux_get_prediv()
39 for (i = 0; i < cm->n_predivs; i++) in ccu_mux_get_prediv()
40 if (parent_index == cm->fixed_predivs[i].index) in ccu_mux_get_prediv()
41 prediv = cm->fixed_predivs[i].div; in ccu_mux_get_prediv()
47 for (i = 0; i < cm->n_var_predivs; i++) in ccu_mux_get_prediv()
48 if (parent_index == cm->var_predivs[i].index) { in ccu_mux_get_prediv()
51 div = reg >> cm->var_predivs[i].shift; in ccu_mux_get_prediv()
52 div &= (1 << cm->var_predivs[i].width) - 1; in ccu_mux_get_prediv()
61 struct ccu_mux_internal *cm, in ccu_mux_helper_apply_prediv() argument
65 return parent_rate / ccu_mux_get_prediv(common, cm, parent_index); in ccu_mux_helper_apply_prediv()
69 struct ccu_mux_internal *cm, in ccu_mux_helper_unapply_prediv() argument
73 return parent_rate * ccu_mux_get_prediv(common, cm, parent_index); in ccu_mux_helper_unapply_prediv()
77 struct ccu_mux_internal *cm, in ccu_mux_helper_determine_rate() argument
95 adj_parent_rate = ccu_mux_helper_apply_prediv(common, cm, -1, in ccu_mux_helper_determine_rate()
98 best_rate = round(cm, best_parent, &adj_parent_rate, in ccu_mux_helper_determine_rate()
106 best_parent_rate = ccu_mux_helper_unapply_prediv(common, cm, -1, in ccu_mux_helper_determine_rate()
120 parent_rate = ccu_mux_helper_apply_prediv(common, cm, i, in ccu_mux_helper_determine_rate()
123 tmp_rate = round(cm, parent, &parent_rate, req->rate, data); in ccu_mux_helper_determine_rate()
130 parent_rate = ccu_mux_helper_unapply_prediv(common, cm, i, in ccu_mux_helper_determine_rate()
157 struct ccu_mux_internal *cm) in ccu_mux_helper_get_parent() argument
163 parent = reg >> cm->shift; in ccu_mux_helper_get_parent()
164 parent &= (1 << cm->width) - 1; in ccu_mux_helper_get_parent()
166 if (cm->table) { in ccu_mux_helper_get_parent()
171 if (cm->table[i] == parent) in ccu_mux_helper_get_parent()
179 struct ccu_mux_internal *cm, in ccu_mux_helper_set_parent() argument
185 if (cm->table) in ccu_mux_helper_set_parent()
186 index = cm->table[index]; in ccu_mux_helper_set_parent()
191 reg &= ~GENMASK(cm->width + cm->shift - 1, cm->shift); in ccu_mux_helper_set_parent()
192 writel(reg | (index << cm->shift), common->base + common->reg); in ccu_mux_helper_set_parent()
201 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_disable() local
203 return ccu_gate_helper_disable(&cm->common, cm->enable); in ccu_mux_disable()
208 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_enable() local
210 return ccu_gate_helper_enable(&cm->common, cm->enable); in ccu_mux_enable()
215 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_is_enabled() local
217 return ccu_gate_helper_is_enabled(&cm->common, cm->enable); in ccu_mux_is_enabled()
222 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_get_parent() local
224 return ccu_mux_helper_get_parent(&cm->common, &cm->mux); in ccu_mux_get_parent()
229 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_set_parent() local
231 return ccu_mux_helper_set_parent(&cm->common, &cm->mux, index); in ccu_mux_set_parent()
237 struct ccu_mux *cm = hw_to_ccu_mux(hw); in ccu_mux_recalc_rate() local
239 return ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1, in ccu_mux_recalc_rate()
269 mux->cm); in ccu_mux_notifier_cb()
270 ret = ccu_mux_helper_set_parent(mux->common, mux->cm, in ccu_mux_notifier_cb()
273 ret = ccu_mux_helper_set_parent(mux->common, mux->cm, in ccu_mux_notifier_cb()