Lines Matching refs:mnp

28 static unsigned int g450_mnp2vco(CPMINFO unsigned int mnp) {  in g450_mnp2vco()  argument
31 m = ((mnp >> 16) & 0x0FF) + 1; in g450_mnp2vco()
32 n = ((mnp >> 7) & 0x1FE) + 4; in g450_mnp2vco()
36 unsigned int g450_mnp2f(CPMINFO unsigned int mnp) { in g450_mnp2f() argument
37 return g450_vco2f(mnp, g450_mnp2vco(PMINFO mnp)); in g450_mnp2f()
52 …nt g450_nextpll(CPMINFO const struct matrox_pll_limits* pi, unsigned int* fvco, unsigned int mnp) { in g450_nextpll() argument
56 m = (mnp >> 16) & 0xFF; in g450_nextpll()
57 p = mnp & 0xFF; in g450_nextpll()
127 static inline unsigned int g450_setpll(CPMINFO unsigned int mnp, unsigned int pll) { in g450_setpll() argument
130 matroxfb_DAC_out(PMINFO M1064_XPIXPLLAM, mnp >> 16); in g450_setpll()
131 matroxfb_DAC_out(PMINFO M1064_XPIXPLLAN, mnp >> 8); in g450_setpll()
132 matroxfb_DAC_out(PMINFO M1064_XPIXPLLAP, mnp); in g450_setpll()
136 matroxfb_DAC_out(PMINFO M1064_XPIXPLLBM, mnp >> 16); in g450_setpll()
137 matroxfb_DAC_out(PMINFO M1064_XPIXPLLBN, mnp >> 8); in g450_setpll()
138 matroxfb_DAC_out(PMINFO M1064_XPIXPLLBP, mnp); in g450_setpll()
142 matroxfb_DAC_out(PMINFO M1064_XPIXPLLCM, mnp >> 16); in g450_setpll()
143 matroxfb_DAC_out(PMINFO M1064_XPIXPLLCN, mnp >> 8); in g450_setpll()
144 matroxfb_DAC_out(PMINFO M1064_XPIXPLLCP, mnp); in g450_setpll()
148 matroxfb_DAC_out(PMINFO DAC1064_XSYSPLLM, mnp >> 16); in g450_setpll()
149 matroxfb_DAC_out(PMINFO DAC1064_XSYSPLLN, mnp >> 8); in g450_setpll()
150 matroxfb_DAC_out(PMINFO DAC1064_XSYSPLLP, mnp); in g450_setpll()
154 matroxfb_DAC_out(PMINFO M1064_XVIDPLLM, mnp >> 16); in g450_setpll()
155 matroxfb_DAC_out(PMINFO M1064_XVIDPLLN, mnp >> 8); in g450_setpll()
156 matroxfb_DAC_out(PMINFO M1064_XVIDPLLP, mnp); in g450_setpll()
162 static inline unsigned int g450_cmppll(CPMINFO unsigned int mnp, unsigned int pll) { in g450_cmppll() argument
163 unsigned char m = mnp >> 16; in g450_cmppll()
164 unsigned char n = mnp >> 8; in g450_cmppll()
165 unsigned char p = mnp; in g450_cmppll()
214 static int g450_testpll(CPMINFO unsigned int mnp, unsigned int pll) { in g450_testpll() argument
215 return g450_isplllocked(PMINFO g450_setpll(PMINFO mnp, pll)); in g450_testpll()
218 static void updatehwstate_clk(struct matrox_hw_state* hw, unsigned int mnp, unsigned int pll) { in updatehwstate_clk() argument
221 hw->DACclk[3] = mnp >> 16; in updatehwstate_clk()
222 hw->DACclk[4] = mnp >> 8; in updatehwstate_clk()
223 hw->DACclk[5] = mnp; in updatehwstate_clk()
228 void matroxfb_g450_setpll_cond(WPMINFO unsigned int mnp, unsigned int pll) { in matroxfb_g450_setpll_cond() argument
229 if (g450_cmppll(PMINFO mnp, pll)) { in matroxfb_g450_setpll_cond()
230 g450_setpll(PMINFO mnp, pll); in matroxfb_g450_setpll_cond()
243 unsigned int mnp; in g450_findworkingpll() local
246 mnp = mnparray[idx]; in g450_findworkingpll()
247 if (mnp & 0x38) { in g450_findworkingpll()
248 *sptr++ = mnp - 8; in g450_findworkingpll()
250 if ((mnp & 0x38) != 0x38) { in g450_findworkingpll()
251 *sptr++ = mnp + 8; in g450_findworkingpll()
253 *sptr = mnp; in g450_findworkingpll()
256 unsigned int mnp = *sptr--; in g450_findworkingpll() local
258 if (g450_testpll(PMINFO mnp - 0x0300, pll) && in g450_findworkingpll()
259 g450_testpll(PMINFO mnp + 0x0300, pll) && in g450_findworkingpll()
260 g450_testpll(PMINFO mnp - 0x0200, pll) && in g450_findworkingpll()
261 g450_testpll(PMINFO mnp + 0x0200, pll) && in g450_findworkingpll()
262 g450_testpll(PMINFO mnp - 0x0100, pll) && in g450_findworkingpll()
263 g450_testpll(PMINFO mnp + 0x0100, pll)) { in g450_findworkingpll()
264 if (g450_testpll(PMINFO mnp, pll)) { in g450_findworkingpll()
265 return mnp; in g450_findworkingpll()
267 } else if (!found && g450_testpll(PMINFO mnp, pll)) { in g450_findworkingpll()
268 mnpfound = mnp; in g450_findworkingpll()
292 unsigned int mnp; in g450_checkcache() local
294 mnp = ci->data[i].mnp_value; in g450_checkcache()
298 ci->data[0].mnp_value = mnp; in g450_checkcache()
300 return mnp; in g450_checkcache()
363 unsigned int mnp; in __g450_setclk() local
372 mnp = matroxfb_DAC_in(PMINFO M1064_XPIXPLLCM) << 16; in __g450_setclk()
373 mnp |= matroxfb_DAC_in(PMINFO M1064_XPIXPLLCN) << 8; in __g450_setclk()
374 pixel_vco = g450_mnp2vco(PMINFO mnp); in __g450_setclk()
386 unsigned int mnp; in __g450_setclk() local
389 …for(mnp = g450_firstpll(PMINFO pi, &xvco, fout); mnp != NO_MORE_MNP; mnp = g450_nextpll(PMINFO pi,… in __g450_setclk()
394 vco = g450_mnp2vco(PMINFO mnp); in __g450_setclk()
414 delta = pll_freq_delta(fout, g450_vco2f(mnp, vco)); in __g450_setclk()
427 mnparray[idx] = mnp; in __g450_setclk()
438 unsigned int mnp; in __g450_setclk() local
441 mnp = g450_checkcache(PMINFO ci, mnparray[0]); in __g450_setclk()
442 if (mnp != NO_MORE_MNP) { in __g450_setclk()
443 matroxfb_g450_setpll_cond(PMINFO mnp, pll); in __g450_setclk()
445 mnp = g450_findworkingpll(PMINFO pll, mnparray, mnpcount); in __g450_setclk()
446 g450_addcache(ci, mnparray[0], mnp); in __g450_setclk()
448 updatehwstate_clk(&ACCESS_FBINFO(hw), mnp, pll); in __g450_setclk()
450 return mnp; in __g450_setclk()