17 #include <linux/module.h>
18 #include <linux/kernel.h>
32 return p->
ref * 2 * (vco.
v + 8) / ((vco.
r + 2) * p->
s2div[vco.
s]);
48 struct icst_vco vco = { .
s = 1, .v = p->vd_max, .
r = p->rd_max };
50 unsigned int i = 0,
rd, best = (
unsigned int)-1;
57 f =
freq * p->s2div[p->idx2s[
i]];
59 if (f > p->vco_min && f <= p->vco_max)
72 for (
rd = p->rd_min; rd <= p->rd_max;
rd++) {
73 unsigned long fref_div, f_pll;
77 fref_div = (2 * p->ref) /
rd;
79 vd = (f + fref_div / 2) / fref_div;
80 if (vd < p->vd_min || vd > p->vd_max)
83 f_pll = fref_div * vd;
88 if ((
unsigned)f_diff < best) {