Lines Matching refs:conf
59 const struct s5_pll_conf *conf) in s5_calc_freq() argument
61 unsigned long rate = parent_rate / conf->div; in s5_calc_freq()
63 if (conf->rot_ena) { in s5_calc_freq()
64 int sign = conf->rot_dir ? -1 : 1; in s5_calc_freq()
65 int divt = sel_rates[conf->rot_sel] * (1 + conf->pre_div); in s5_calc_freq()
78 struct s5_pll_conf *conf) in s5_search_fractional() argument
84 memset(conf, 0, sizeof(*conf)); in s5_search_fractional()
85 conf->div = div; in s5_search_fractional()
86 conf->rot_ena = 1; /* Fractional rate */ in s5_search_fractional()
89 conf->rot_dir = !!d; in s5_search_fractional()
91 conf->pre_div = i; in s5_search_fractional()
93 conf->rot_sel = j; in s5_search_fractional()
94 conf->freq = s5_calc_freq(parent_rate, conf); in s5_search_fractional()
95 cur_offset = abs(rate - conf->freq); in s5_search_fractional()
98 best = *conf; in s5_search_fractional()
105 *conf = best; in s5_search_fractional()
110 struct s5_pll_conf *conf) in s5_calc_params() argument
121 *conf = alt1; in s5_calc_params()
131 *conf = alt1; in s5_calc_params()
133 *conf = alt2; in s5_calc_params()
138 memset(conf, 0, sizeof(*conf)); in s5_calc_params()
139 conf->div = parent_rate / rate; in s5_calc_params()
142 return conf->freq; in s5_calc_params()
170 struct s5_pll_conf conf; in s5_pll_set_rate() local
174 eff_rate = s5_calc_params(rate, parent_rate, &conf); in s5_pll_set_rate()
179 val |= FIELD_PREP(PLL_DIV, conf.div); in s5_pll_set_rate()
180 if (conf.rot_ena) { in s5_pll_set_rate()
182 val |= FIELD_PREP(PLL_ROT_SEL, conf.rot_sel); in s5_pll_set_rate()
183 val |= FIELD_PREP(PLL_PRE_DIV, conf.pre_div); in s5_pll_set_rate()
184 if (conf.rot_dir) in s5_pll_set_rate()
196 struct s5_pll_conf conf; in s5_pll_recalc_rate() local
202 conf.div = FIELD_GET(PLL_DIV, val); in s5_pll_recalc_rate()
203 conf.pre_div = FIELD_GET(PLL_PRE_DIV, val); in s5_pll_recalc_rate()
204 conf.rot_ena = FIELD_GET(PLL_ROT_ENA, val); in s5_pll_recalc_rate()
205 conf.rot_dir = FIELD_GET(PLL_ROT_DIR, val); in s5_pll_recalc_rate()
206 conf.rot_sel = FIELD_GET(PLL_ROT_SEL, val); in s5_pll_recalc_rate()
208 conf.freq = s5_calc_freq(parent_rate, &conf); in s5_pll_recalc_rate()
210 conf.freq = 0; in s5_pll_recalc_rate()
213 return conf.freq; in s5_pll_recalc_rate()
219 struct s5_pll_conf conf; in s5_pll_round_rate() local
221 return s5_calc_params(rate, *parent_rate, &conf); in s5_pll_round_rate()