Lines Matching +full:1 +full:p1

23 	unsigned int p1;  in aptina_pll_calculate()  local
40 /* Compute the multiplier M and combined N*P1 divisor. */ in aptina_pll_calculate()
45 /* We now have the smallest M and N*P1 values that will result in the in aptina_pll_calculate()
53 * - minimum/maximum combined N*P1 divisor in aptina_pll_calculate()
66 dev_err(dev, "pll: no valid combined N*P1 divisor.\n"); in aptina_pll_calculate()
71 * We're looking for the highest acceptable P1 value for which a in aptina_pll_calculate()
74 * 1. p1 is in the [p1_min, p1_max] range given by the limits and is in aptina_pll_calculate()
77 * 3. div * mf is a multiple of p1, in order to compute in aptina_pll_calculate()
78 * n = div * mf / p1 in aptina_pll_calculate()
85 * The first naive approach is to iterate over all p1 values acceptable in aptina_pll_calculate()
86 * according to (1) and all mf values acceptable according to (2), and in aptina_pll_calculate()
94 * mf_inc = p1 / gcd(div, p1) (6) in aptina_pll_calculate()
100 * acceptable p1 and mf values by modifying the minimum and maximum in aptina_pll_calculate()
103 * ext_clock / (div * mf / p1) * m * mf >= out_clock_min in aptina_pll_calculate()
104 * ext_clock / (div * mf / p1) * m * mf <= out_clock_max in aptina_pll_calculate()
108 * p1 >= out_clock_min * div / (ext_clock * m) (7) in aptina_pll_calculate()
109 * p1 <= out_clock_max * div / (ext_clock * m) in aptina_pll_calculate()
113 * mf >= ext_clock * p1 / (int_clock_max * div) (8) in aptina_pll_calculate()
114 * mf <= ext_clock * p1 / (int_clock_min * div) in aptina_pll_calculate()
116 * We can thus iterate over the restricted p1 range defined by the in aptina_pll_calculate()
117 * combination of (1) and (7), and then compute the restricted mf range in aptina_pll_calculate()
120 * select the mf lwoer bound and the corresponding p1 value. in aptina_pll_calculate()
123 dev_err(dev, "pll: P1 minimum value must be >0.\n"); in aptina_pll_calculate()
132 for (p1 = p1_max & ~1; p1 >= p1_min; p1 -= 2) { in aptina_pll_calculate()
133 unsigned int mf_inc = p1 / gcd(div, p1); in aptina_pll_calculate()
137 mf_low = roundup(max(mf_min, DIV_ROUND_UP(pll->ext_clock * p1, in aptina_pll_calculate()
139 mf_high = min(mf_max, pll->ext_clock * p1 / in aptina_pll_calculate()
145 pll->n = div * mf_low / p1; in aptina_pll_calculate()
147 pll->p1 = p1; in aptina_pll_calculate()
148 dev_dbg(dev, "PLL: N %u M %u P1 %u\n", pll->n, pll->m, pll->p1); in aptina_pll_calculate()
152 dev_err(dev, "pll: no valid N and P1 divisors found.\n"); in aptina_pll_calculate()