Lines Matching full:cd
19 struct ccu_div *cd = data; in ccu_div_round_rate() local
21 if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) in ccu_div_round_rate()
22 rate *= cd->fixed_post_div; in ccu_div_round_rate()
24 rate = divider_round_rate_parent(&cd->common.hw, parent, in ccu_div_round_rate()
26 cd->div.table, cd->div.width, in ccu_div_round_rate()
27 cd->div.flags); in ccu_div_round_rate()
29 if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) in ccu_div_round_rate()
30 rate /= cd->fixed_post_div; in ccu_div_round_rate()
37 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_disable() local
39 return ccu_gate_helper_disable(&cd->common, cd->enable); in ccu_div_disable()
44 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_enable() local
46 return ccu_gate_helper_enable(&cd->common, cd->enable); in ccu_div_enable()
51 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_is_enabled() local
53 return ccu_gate_helper_is_enabled(&cd->common, cd->enable); in ccu_div_is_enabled()
59 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_recalc_rate() local
63 reg = readl(cd->common.base + cd->common.reg); in ccu_div_recalc_rate()
64 val = reg >> cd->div.shift; in ccu_div_recalc_rate()
65 val &= (1 << cd->div.width) - 1; in ccu_div_recalc_rate()
67 parent_rate = ccu_mux_helper_apply_prediv(&cd->common, &cd->mux, -1, in ccu_div_recalc_rate()
70 val = divider_recalc_rate(hw, parent_rate, val, cd->div.table, in ccu_div_recalc_rate()
71 cd->div.flags, cd->div.width); in ccu_div_recalc_rate()
73 if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) in ccu_div_recalc_rate()
74 val /= cd->fixed_post_div; in ccu_div_recalc_rate()
82 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_determine_rate() local
84 return ccu_mux_helper_determine_rate(&cd->common, &cd->mux, in ccu_div_determine_rate()
85 req, ccu_div_round_rate, cd); in ccu_div_determine_rate()
91 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_set_rate() local
96 parent_rate = ccu_mux_helper_apply_prediv(&cd->common, &cd->mux, -1, in ccu_div_set_rate()
99 if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) in ccu_div_set_rate()
100 rate *= cd->fixed_post_div; in ccu_div_set_rate()
102 val = divider_get_val(rate, parent_rate, cd->div.table, cd->div.width, in ccu_div_set_rate()
103 cd->div.flags); in ccu_div_set_rate()
105 spin_lock_irqsave(cd->common.lock, flags); in ccu_div_set_rate()
107 reg = readl(cd->common.base + cd->common.reg); in ccu_div_set_rate()
108 reg &= ~GENMASK(cd->div.width + cd->div.shift - 1, cd->div.shift); in ccu_div_set_rate()
110 writel(reg | (val << cd->div.shift), in ccu_div_set_rate()
111 cd->common.base + cd->common.reg); in ccu_div_set_rate()
113 spin_unlock_irqrestore(cd->common.lock, flags); in ccu_div_set_rate()
120 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_get_parent() local
122 return ccu_mux_helper_get_parent(&cd->common, &cd->mux); in ccu_div_get_parent()
127 struct ccu_div *cd = hw_to_ccu_div(hw); in ccu_div_set_parent() local
129 return ccu_mux_helper_set_parent(&cd->common, &cd->mux, index); in ccu_div_set_parent()