Lines Matching refs:cd

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