Lines Matching defs:common
15 static u16 ccu_mux_get_prediv(struct ccu_common *common,
22 if (!((common->features & CCU_FEATURE_FIXED_PREDIV) ||
23 (common->features & CCU_FEATURE_VARIABLE_PREDIV) ||
24 (common->features & CCU_FEATURE_ALL_PREDIV)))
27 if (common->features & CCU_FEATURE_ALL_PREDIV)
28 return common->prediv;
30 reg = readl(common->base + common->reg);
36 if (common->features & CCU_FEATURE_FIXED_PREDIV) {
44 if (common->features & CCU_FEATURE_VARIABLE_PREDIV) {
60 unsigned long ccu_mux_helper_apply_prediv(struct ccu_common *common,
65 return parent_rate / ccu_mux_get_prediv(common, cm, parent_index);
68 static unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common,
73 return parent_rate * ccu_mux_get_prediv(common, cm, parent_index);
76 int ccu_mux_helper_determine_rate(struct ccu_common *common,
87 struct clk_hw *best_parent, *hw = &common->hw;
95 adj_parent_rate = ccu_mux_helper_apply_prediv(common, cm, -1,
106 best_parent_rate = ccu_mux_helper_unapply_prediv(common, cm, -1,
120 parent_rate = ccu_mux_helper_apply_prediv(common, cm, i,
130 parent_rate = ccu_mux_helper_unapply_prediv(common, cm, i,
156 u8 ccu_mux_helper_get_parent(struct ccu_common *common,
162 reg = readl(common->base + common->reg);
167 int num_parents = clk_hw_get_num_parents(&common->hw);
178 int ccu_mux_helper_set_parent(struct ccu_common *common,
188 spin_lock_irqsave(common->lock, flags);
190 reg = readl(common->base + common->reg);
192 writel(reg | (index << cm->shift), common->base + common->reg);
194 spin_unlock_irqrestore(common->lock, flags);
203 return ccu_gate_helper_disable(&cm->common, cm->enable);
210 return ccu_gate_helper_enable(&cm->common, cm->enable);
217 return ccu_gate_helper_is_enabled(&cm->common, cm->enable);
224 return ccu_mux_helper_get_parent(&cm->common, &cm->mux);
231 return ccu_mux_helper_set_parent(&cm->common, &cm->mux, index);
239 return ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1,
268 mux->original_index = ccu_mux_helper_get_parent(mux->common,
270 ret = ccu_mux_helper_set_parent(mux->common, mux->cm,
273 ret = ccu_mux_helper_set_parent(mux->common, mux->cm,