Lines Matching full:fref
3443 static int madera_find_sync_fratio(unsigned int fref, int *fratio) in madera_find_sync_fratio() argument
3448 if (fll_sync_fratios[i].min <= fref && in madera_find_sync_fratio()
3449 fref <= fll_sync_fratios[i].max) { in madera_find_sync_fratio()
3460 static int madera_find_main_fratio(unsigned int fref, unsigned int fout, in madera_find_main_fratio() argument
3465 while ((fout / (ratio * fref)) > MADERA_FLL_MAX_N) in madera_find_main_fratio()
3474 static int madera_find_fratio(struct madera_fll *fll, unsigned int fref, in madera_find_fratio() argument
3482 return madera_find_sync_fratio(fref, fratio); in madera_find_fratio()
3485 return madera_find_sync_fratio(fref, fratio); in madera_find_fratio()
3487 return madera_find_main_fratio(fref, in madera_find_fratio()
3495 return madera_find_sync_fratio(fref, fratio); in madera_find_fratio()
3498 return madera_find_sync_fratio(fref, fratio); in madera_find_fratio()
3500 return madera_find_main_fratio(fref, fll->fout, fratio); in madera_find_fratio()
3506 unsigned int fref, bool sync) in madera_calc_fratio() argument
3511 /* fref must be <=13.5MHz, find initial refdiv */ in madera_calc_fratio()
3514 while (fref > MADERA_FLL_MAX_FREF) { in madera_calc_fratio()
3516 fref /= 2; in madera_calc_fratio()
3524 init_ratio = madera_find_fratio(fll, fref, sync, &cfg->fratio); in madera_calc_fratio()
3526 madera_fll_err(fll, "Unable to find FRATIO for fref=%uHz\n", in madera_calc_fratio()
3527 fref); in madera_calc_fratio()
3566 if (fll->fout % (ratio * fref)) { in madera_calc_fratio()
3576 (MADERA_FLL_VCO_MULT * ratio) < fref) in madera_calc_fratio()
3579 if (fref > pseudo_fref_max[ratio - 1]) in madera_calc_fratio()
3582 if (fll->fout % (ratio * fref)) { in madera_calc_fratio()
3590 fref /= 2; in madera_calc_fratio()
3592 init_ratio = madera_find_fratio(fll, fref, sync, NULL); in madera_calc_fratio()
3602 unsigned int fref, in madera_find_fll_gain() argument
3609 if (gains[i].min <= fref && fref <= gains[i].max) { in madera_find_fll_gain()
3616 madera_fll_err(fll, "Unable to find gain for fref=%uHz\n", fref); in madera_find_fll_gain()
3623 unsigned int fref, bool sync) in madera_calc_fll() argument
3630 madera_fll_dbg(fll, "fref=%u Fout=%u fvco=%u\n", in madera_calc_fll()
3631 fref, fll->fout, fll->fout * MADERA_FLL_VCO_MULT); in madera_calc_fll()
3634 ratio = madera_calc_fratio(fll, cfg, fref, sync); in madera_calc_fll()
3639 fref = fref / (1 << cfg->refdiv); in madera_calc_fll()
3641 cfg->n = fll->fout / (ratio * fref); in madera_calc_fll()
3643 if (fll->fout % (ratio * fref)) { in madera_calc_fll()
3644 gcd_fll = gcd(fll->fout, ratio * fref); in madera_calc_fll()
3647 cfg->theta = (fll->fout - (cfg->n * ratio * fref)) in madera_calc_fll()
3649 cfg->lambda = (ratio * fref) / gcd_fll; in madera_calc_fll()
3701 ret = madera_find_fll_gain(fll, cfg, fref, gains, n_gains); in madera_calc_fll()
4123 unsigned int fref, unsigned int fout) in madera_set_fll_syncclk() argument
4131 if (fll->sync_src == source && fll->sync_freq == fref) in madera_set_fll_syncclk()
4135 fll->sync_freq = fref; in madera_set_fll_syncclk()
4142 unsigned int fref, unsigned int fout) in madera_set_fll_refclk() argument
4147 fll->ref_freq == fref && fll->fout == fout) in madera_set_fll_refclk()
4166 fll->ref_freq = fref; in madera_set_fll_refclk()
4423 int refdiv, fref, fout, lockdet_thr, fbdiv, hp, fast_clk, fllgcd; in madera_fllhj_apply() local
4434 fref = fin / (1 << refdiv); in madera_fllhj_apply()
4441 frac = fout % fref; in madera_fllhj_apply()
4443 if (fref < MADERA_FLLHJ_LOW_THRESH) { in madera_fllhj_apply()
4450 } else if (fref < MADERA_FLLHJ_MID_THRESH) { in madera_fllhj_apply()
4477 ratio = fout / fref; in madera_fllhj_apply()
4479 madera_fll_dbg(fll, "refdiv=%d, fref=%d, frac:%d\n", in madera_fllhj_apply()
4480 refdiv, fref, frac); in madera_fllhj_apply()
4501 fllgcd = gcd(fout, fbdiv * fref); in madera_fllhj_apply()
4503 lambda = (fref * fbdiv) / fllgcd; in madera_fllhj_apply()