Lines Matching refs:cm
38 struct ccu_mult *cm = data; in ccu_mult_round_rate() local
41 _cm.min = cm->mult.min; in ccu_mult_round_rate()
43 if (cm->mult.max) in ccu_mult_round_rate()
44 _cm.max = cm->mult.max; in ccu_mult_round_rate()
46 _cm.max = (1 << cm->mult.width) + cm->mult.offset - 1; in ccu_mult_round_rate()
55 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_disable() local
57 return ccu_gate_helper_disable(&cm->common, cm->enable); in ccu_mult_disable()
62 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_enable() local
64 return ccu_gate_helper_enable(&cm->common, cm->enable); in ccu_mult_enable()
69 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_is_enabled() local
71 return ccu_gate_helper_is_enabled(&cm->common, cm->enable); in ccu_mult_is_enabled()
77 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_recalc_rate() local
81 if (ccu_frac_helper_is_enabled(&cm->common, &cm->frac)) in ccu_mult_recalc_rate()
82 return ccu_frac_helper_read_rate(&cm->common, &cm->frac); in ccu_mult_recalc_rate()
84 reg = readl(cm->common.base + cm->common.reg); in ccu_mult_recalc_rate()
85 val = reg >> cm->mult.shift; in ccu_mult_recalc_rate()
86 val &= (1 << cm->mult.width) - 1; in ccu_mult_recalc_rate()
88 parent_rate = ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1, in ccu_mult_recalc_rate()
91 return parent_rate * (val + cm->mult.offset); in ccu_mult_recalc_rate()
97 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_determine_rate() local
99 return ccu_mux_helper_determine_rate(&cm->common, &cm->mux, in ccu_mult_determine_rate()
100 req, ccu_mult_round_rate, cm); in ccu_mult_determine_rate()
106 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_set_rate() local
111 if (ccu_frac_helper_has_rate(&cm->common, &cm->frac, rate)) { in ccu_mult_set_rate()
112 ccu_frac_helper_enable(&cm->common, &cm->frac); in ccu_mult_set_rate()
114 return ccu_frac_helper_set_rate(&cm->common, &cm->frac, in ccu_mult_set_rate()
115 rate, cm->lock); in ccu_mult_set_rate()
117 ccu_frac_helper_disable(&cm->common, &cm->frac); in ccu_mult_set_rate()
120 parent_rate = ccu_mux_helper_apply_prediv(&cm->common, &cm->mux, -1, in ccu_mult_set_rate()
123 _cm.min = cm->mult.min; in ccu_mult_set_rate()
125 if (cm->mult.max) in ccu_mult_set_rate()
126 _cm.max = cm->mult.max; in ccu_mult_set_rate()
128 _cm.max = (1 << cm->mult.width) + cm->mult.offset - 1; in ccu_mult_set_rate()
132 spin_lock_irqsave(cm->common.lock, flags); in ccu_mult_set_rate()
134 reg = readl(cm->common.base + cm->common.reg); in ccu_mult_set_rate()
135 reg &= ~GENMASK(cm->mult.width + cm->mult.shift - 1, cm->mult.shift); in ccu_mult_set_rate()
136 reg |= ((_cm.mult - cm->mult.offset) << cm->mult.shift); in ccu_mult_set_rate()
138 writel(reg, cm->common.base + cm->common.reg); in ccu_mult_set_rate()
140 spin_unlock_irqrestore(cm->common.lock, flags); in ccu_mult_set_rate()
142 ccu_helper_wait_for_lock(&cm->common, cm->lock); in ccu_mult_set_rate()
149 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_get_parent() local
151 return ccu_mux_helper_get_parent(&cm->common, &cm->mux); in ccu_mult_get_parent()
156 struct ccu_mult *cm = hw_to_ccu_mult(hw); in ccu_mult_set_parent() local
158 return ccu_mux_helper_set_parent(&cm->common, &cm->mux, index); in ccu_mult_set_parent()