Lines Matching defs:common

17 static u16 ccu_mux_get_prediv(struct ccu_common *common,
24 if (!((common->features & CCU_FEATURE_FIXED_PREDIV) ||
25 (common->features & CCU_FEATURE_VARIABLE_PREDIV) ||
26 (common->features & CCU_FEATURE_ALL_PREDIV)))
29 if (common->features & CCU_FEATURE_ALL_PREDIV)
30 return common->prediv;
32 reg = readl(common->base + common->reg);
38 if (common->features & CCU_FEATURE_FIXED_PREDIV) {
46 if (common->features & CCU_FEATURE_VARIABLE_PREDIV) {
62 unsigned long ccu_mux_helper_apply_prediv(struct ccu_common *common,
67 return parent_rate / ccu_mux_get_prediv(common, cm, parent_index);
71 static unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common,
76 return parent_rate * ccu_mux_get_prediv(common, cm, parent_index);
79 int ccu_mux_helper_determine_rate(struct ccu_common *common,
90 struct clk_hw *best_parent, *hw = &common->hw;
98 adj_parent_rate = ccu_mux_helper_apply_prediv(common, cm, -1,
109 best_parent_rate = ccu_mux_helper_unapply_prediv(common, cm, -1,
123 parent_rate = ccu_mux_helper_apply_prediv(common, cm, i,
133 parent_rate = ccu_mux_helper_unapply_prediv(common, cm, i,
142 if (ccu_is_better_rate(common, req->rate, tmp_rate, best_rate)) {
160 u8 ccu_mux_helper_get_parent(struct ccu_common *common,
166 reg = readl(common->base + common->reg);
171 int num_parents = clk_hw_get_num_parents(&common->hw);
183 int ccu_mux_helper_set_parent(struct ccu_common *common,
193 spin_lock_irqsave(common->lock, flags);
195 reg = readl(common->base + common->reg);
198 if (common->features & CCU_FEATURE_KEY_FIELD)
202 writel(reg | (index << cm->shift), common->base + common->reg);
204 spin_unlock_irqrestore(common->lock, flags);
214 return ccu_gate_helper_disable(&cm->common, cm->enable);
221 return ccu_gate_helper_enable(&cm->common, cm->enable);
228 return ccu_gate_helper_is_enabled(&cm->common, cm->enable);
235 return ccu_mux_helper_get_parent(&cm->common, &cm->mux);
242 return ccu_mux_helper_set_parent(&cm->common, &cm->mux, index);
250 if (cm->common.features & CCU_FEATURE_CLOSEST_RATE)
261 return ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1,
291 mux->original_index = ccu_mux_helper_get_parent(mux->common,
293 ret = ccu_mux_helper_set_parent(mux->common, mux->cm,
296 ret = ccu_mux_helper_set_parent(mux->common, mux->cm,