/linux/sound/soc/codecs/ |
H A D | arizona.c | 2106 unsigned int Fref, in arizona_validate_fll() argument 2117 if (Fref / ARIZONA_FLL_MAX_REFDIV > ARIZONA_FLL_MAX_FREF) { in arizona_validate_fll() 2120 Fref); in arizona_validate_fll() 2134 static int arizona_find_fratio(unsigned int Fref, int *fratio) in arizona_find_fratio() argument 2140 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in arizona_find_fratio() 2153 unsigned int Fref, bool sync) in arizona_calc_fratio() argument 2158 /* Fref must be <=13.5MHz, find initial refdiv */ in arizona_calc_fratio() 2161 while (Fref > ARIZONA_FLL_MAX_FREF) { in arizona_calc_fratio() 2163 Fref /= 2; in arizona_calc_fratio() 2171 init_ratio = arizona_find_fratio(Fref, &cfg->fratio); in arizona_calc_fratio() [all …]
|
H A D | madera.c | 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() [all …]
|
H A D | wm9081.c | 462 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 470 /* Fref must be <=13.5MHz */ in fll_factors() 472 while ((Fref / div) > 13500000) { in fll_factors() 477 Fref); in fll_factors() 483 pr_debug("Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 486 Fref /= div; in fll_factors() 506 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 513 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() 518 Ndiv = target / Fref; in fll_factors() 521 Nmod = target % Fref; in fll_factors() [all …]
|
H A D | wm8993.c | 382 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 390 /* Fref must be <=13.5MHz */ in fll_factors() 393 while ((Fref / div) > 13500000) { in fll_factors() 399 Fref); in fll_factors() 404 pr_debug("Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 407 Fref /= div; in fll_factors() 427 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 434 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() 439 Ndiv = target / Fref; in fll_factors() 442 Nmod = target % Fref; in fll_factors() [all …]
|
H A D | wm5100.c | 45 int fref; member 1680 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 1688 /* Fref must be <=13.5MHz */ in fll_factors() 1691 while ((Fref / div) > 13500000) { in fll_factors() 1697 Fref); in fll_factors() 1702 pr_debug("FLL Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 1705 Fref /= div; in fll_factors() 1724 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 1731 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() 1735 fll_div->n = target / (fratio * Fref); in fll_factors() [all …]
|
H A D | wm8904.c | 1584 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 1592 /* Fref must be <=13.5MHz */ in fll_factors() 1595 while ((Fref / div) > 13500000) { in fll_factors() 1601 Fref); in fll_factors() 1606 pr_debug("Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 1609 Fref /= div; in fll_factors() 1628 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 1635 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() 1640 Ndiv = target / Fref; in fll_factors() 1643 Nmod = target % Fref; in fll_factors() [all …]
|
H A D | wm8996.c | 1914 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 1922 /* Fref must be <=13.5MHz */ in fll_factors() 1925 while ((Fref / div) > 13500000) { in fll_factors() 1931 Fref); in fll_factors() 1936 pr_debug("FLL Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 1939 Fref /= div; in fll_factors() 1941 if (Fref >= 3000000) in fll_factors() 1946 if (Fref >= 48000) in fll_factors() 1968 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 1975 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() [all …]
|
H A D | nau8540.c | 664 unsigned int fref, i, fvco_sel; in nau8540_calc_fll_param() local 666 /* Ensure the reference clock frequency (FREF) is <= 13.5MHz by dividing in nau8540_calc_fll_param() 668 * FREF = freq_in / NAU8540_FLL_REF_DIV_MASK in nau8540_calc_fll_param() 671 fref = fll_in / fll_pre_scalar[i].param; in nau8540_calc_fll_param() 672 if (fref <= NAU_FREF_MAX) in nau8540_calc_fll_param() 679 /* Choose the FLL ratio based on FREF */ in nau8540_calc_fll_param() 681 if (fref >= fll_ratio[i].param) in nau8540_calc_fll_param() 708 * input based on FDCO, FREF and FLL ratio. in nau8540_calc_fll_param() 710 fvco = div_u64(fvco_max << 16, fref * fll_param->ratio); in nau8540_calc_fll_param()
|
H A D | wm8900.c | 679 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 699 printk(KERN_WARNING "wm8900: FLL rate %u out of range, Fref=%u" in fll_factors() 700 " Fout=%u\n", target, Fref, Fout); in fll_factors() 703 "Fref=%u, Fout=%u, target=%u\n", in fll_factors() 704 div, Fref, Fout, target); in fll_factors() 710 if (Fref < 48000) in fll_factors() 715 Ndiv = target / Fref; in fll_factors() 717 if (Fref < 1000000) in fll_factors() 723 Nmod = (target / fll_div->fll_ratio) % Fref; in fll_factors() 728 do_div(Kpart, Fref); in fll_factors() [all …]
|
H A D | wm2200.c | 1847 static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, in fll_factors() argument 1855 /* Fref must be <=13.5MHz */ in fll_factors() 1858 while ((Fref / div) > 13500000) { in fll_factors() 1864 Fref); in fll_factors() 1869 pr_debug("FLL Fref=%u Fout=%u\n", Fref, Fout); in fll_factors() 1872 Fref /= div; in fll_factors() 1891 if (fll_fratios[i].min <= Fref && Fref <= fll_fratios[i].max) { in fll_factors() 1898 pr_err("Unable to find FLL_FRATIO for Fref=%uHz\n", Fref); in fll_factors() 1902 fll_div->n = target / (fratio * Fref); in fll_factors() 1904 if (target % Fref == 0) { in fll_factors() [all …]
|
H A D | wm8400.c | 853 unsigned int Fref, unsigned int Fout) in fll_factors() argument 872 if (Fref < 48000) in fll_factors() 877 if (Fref < 1000000) in fll_factors() 884 if (Fref < 1000000) in fll_factors() 895 factors->n = target / (Fref * factors->fratio); in fll_factors() 896 Nmod = target % (Fref * factors->fratio); in fll_factors() 902 do_div(Kpart, (Fref * factors->fratio)); in fll_factors() 913 "FLL: Fref=%u Fout=%u N=%x K=%x, FRATIO=%x OUTDIV=%x\n", in fll_factors() 914 Fref, Fout, in fll_factors()
|
H A D | wm8955.c | 144 int Fref, int Fout, struct pll_factors *pll) in wm8955_pll_factors() argument 149 dev_dbg(dev, "Fref=%u Fout=%u\n", Fref, Fout); in wm8955_pll_factors() 168 Ndiv = target / Fref; in wm8955_pll_factors() 171 Nmod = target % Fref; in wm8955_pll_factors() 177 do_div(Kpart, Fref); in wm8955_pll_factors()
|
/linux/drivers/clk/pistachio/ |
H A D | clk-pll.c | 129 pll_get_params(struct pistachio_clk_pll *pll, unsigned long fref, in pll_get_params() argument 135 if (pll->rates[i].fref == fref && pll->rates[i].fout == fout) in pll_get_params() 149 if (i > 0 && pll->rates[i].fref == *parent_rate && in pll_round_rate() 210 vco = params->fref; in pll_gf40lp_frac_set_rate() 218 val = div64_u64(params->fref, params->refdiv); in pll_gf40lp_frac_set_rate() 366 vco = div_u64(params->fref * params->fbdiv, params->refdiv); in pll_gf40lp_laint_set_rate() 371 val = div_u64(params->fref, params->refdiv); in pll_gf40lp_laint_set_rate()
|
/linux/drivers/media/dvb-frontends/ |
H A D | dib0070.c | 372 u32 FBDiv, Rest, FREF, VCOF_kHz; in dib0070_tune_digital() local 395 FREF = state->cfg->clock_khz / REFDIV; in dib0070_tune_digital() 401 FBDiv = (VCOF_kHz / state->current_tune_table_index->presc / FREF); in dib0070_tune_digital() 402 Rest = (VCOF_kHz / state->current_tune_table_index->presc) - FBDiv * FREF; in dib0070_tune_digital() 408 FBDiv = (freq / (FREF / 2)); in dib0070_tune_digital() 409 Rest = 2 * freq - FBDiv * FREF; in dib0070_tune_digital() 417 else if (Rest > (FREF - LPF)) { in dib0070_tune_digital() 420 } else if (Rest > (FREF - 2 * LPF)) in dib0070_tune_digital() 421 Rest = FREF - 2 * LPF; in dib0070_tune_digital() 422 Rest = (Rest * 6528) / (FREF / 10); in dib0070_tune_digital() [all …]
|
/linux/drivers/video/fbdev/ |
H A D | asiliantfb.c | 47 static const unsigned Fref = 14318180; variable 131 ratio = Ftarget / Fref; in asiliant_calc_dclk2() 132 remainder = Ftarget % Fref; in asiliant_calc_dclk2() 134 /* This expresses the constraint that 150kHz <= Fref/n <= 5Mhz, in asiliant_calc_dclk2() 137 unsigned m = n * ratio + (n * remainder) / Fref; in asiliant_calc_dclk2() 141 unsigned new_error = Ftarget * n >= Fref * m ? in asiliant_calc_dclk2() 142 ((Ftarget * n) - (Fref * m)) : ((Fref * m) - (Ftarget * n)); in asiliant_calc_dclk2() 153 unsigned new_error = Ftarget * n >= Fref * (m & ~3) ? in asiliant_calc_dclk2() 154 ((Ftarget * n) - (Fref * (m & ~3))) : ((Fref * (m & ~3)) - (Ftarget * n)); in asiliant_calc_dclk2()
|
/linux/arch/m68k/coldfire/ |
H A D | m53xx.c | 251 #define FREF 16000 /* KHz */ macro 472 int fref, temp, fout, mfd; in clock_pll() local 475 fref = FREF; in clock_pll() 481 return (fref * mfd / (BUSDIV * 4)); in clock_pll() 494 temp = 100 * fsys / fref; in clock_pll() 498 fout = (fref * mfd / (BUSDIV * 4)); in clock_pll() 564 return (FREF/(3*(1 << div))); in clock_limp() 590 return (FREF/(2 << divider)); in get_sys_clock() 593 return (FREF * readb(MCF_PLL_PFDR)) / (BUSDIV * 4); in get_sys_clock()
|
/linux/drivers/media/tuners/ |
H A D | mt20xx.c | 108 unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1, in mt2032_compute_freq() local 111 fref= 5250 *1000; //5.25MHz in mt2032_compute_freq() 114 lo1=(2*(desired_lo1/1000)+(fref/1000)) / (2*fref/1000); in mt2032_compute_freq() 136 lo1freq=(lo1a+8*lo1n)*fref; in mt2032_compute_freq() 142 lo2=(desired_lo2)/fref; in mt2032_compute_freq() 145 lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith in mt2032_compute_freq() 146 lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000; in mt2032_compute_freq()
|
/linux/drivers/clk/ |
H A D | clk-clps711x.c | 47 u32 tmp, f_cpu, f_pll, f_bus, f_tim, f_pwm, f_spi, fref = 0; in clps711x_clk_init_dt() local 51 WARN_ON(of_property_read_u32(np, "startup-frequency", &fref)); in clps711x_clk_init_dt() 65 if (((tmp >= 10) && (tmp <= 50)) || !fref) in clps711x_clk_init_dt() 68 f_pll = fref; in clps711x_clk_init_dt()
|
H A D | clk-xgene.c | 74 unsigned long fref; in xgene_clk_pll_recalc_rate() local 93 * Fref = Reference Clock / NREF; in xgene_clk_pll_recalc_rate() 94 * Fvco = Fref * NFB; in xgene_clk_pll_recalc_rate() 100 fref = parent_rate / nref; in xgene_clk_pll_recalc_rate() 101 fvco = fref * nfb; in xgene_clk_pll_recalc_rate()
|
/linux/drivers/clk/imx/ |
H A D | clk-imx31.c | 53 static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref) in _mx31_clocks_init() argument 56 clk[ckih] = imx_clk_fixed("ckih", fref); in _mx31_clocks_init() 127 u32 fref = 26000000; /* default */ in mx31_clocks_init_dt() local 134 if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) { in mx31_clocks_init_dt() 144 _mx31_clocks_init(ccm, fref); in mx31_clocks_init_dt()
|
H A D | clk-fracn-gppll.c | 75 * Fvco = (Fref / rdiv) * (MFI + MFN / MFD) 77 * The (Fref / rdiv) should be in range 20MHz to 40MHz 101 * Fvco = (Fref / rdiv) * MFI 103 * The (Fref / rdiv) should be in range 20MHz to 40MHz 206 /* Fvco = (Fref / rdiv) * MFI */ in clk_fracn_gppll_recalc_rate() 210 /* Fvco = (Fref / rdiv) * (MFI + MFN / MFD) */ in clk_fracn_gppll_recalc_rate()
|
H A D | clk-imx27.c | 51 static void __init _mx27_clocks_init(unsigned long fref) in _mx27_clocks_init() argument 56 clk[IMX27_CLK_CKIH] = imx_clk_fixed("ckih", fref); in _mx27_clocks_init() 175 u32 fref = 26000000; /* default */ in mx27_clocks_init_dt() local 181 if (!of_property_read_u32(refnp, "clock-frequency", &fref)) { in mx27_clocks_init_dt() 189 _mx27_clocks_init(fref); in mx27_clocks_init_dt()
|
H A D | clk-pll14xx.c | 328 * 1us and 1/FREF, respectively. in clk_pll1416x_set_rate() 329 * FREF is FIN / Prediv, the prediv is [1, 63], so choose in clk_pll1416x_set_rate() 392 * 1us and 1/FREF, respectively. in clk_pll1443x_set_rate() 393 * FREF is FIN / Prediv, the prediv is [1, 63], so choose in clk_pll1443x_set_rate()
|
/linux/drivers/clk/sophgo/ |
H A D | clk-sg2042-pll.c | 166 * @prate: parent rate, i.e. FREF 177 * FOUTPOSTDIV = FREF * FBDIV / REFDIV / (POSTDIV1 * POSTDIV2) 242 * FREF to calculate the REFDIV/FBDIV/PSTDIV1/POSTDIV2 combination for pllctrl 245 * @parent_rate: input parent clock rate, i.e. FREF 263 pr_err("INVALID FREF: %ld\n", parent_rate); in sg2042_get_pll_ctl_setting() 275 /* required by hardware: FREF/REFDIV must > 10 */ in sg2042_get_pll_ctl_setting() 283 * FOUTVCO = FREF*FBDIV/REFDIV validation in sg2042_get_pll_ctl_setting() 298 * FOUTPOSTDIV = FREF*FBDIV/REFDIV/(POSTDIV1*POSTDIV2) in sg2042_get_pll_ctl_setting()
|
/linux/drivers/tty/serial/8250/ |
H A D | 8250_lpss.c | 77 unsigned long fref = lpss->board->freq, fuart = baud * 16; in byt_set_termios() local 85 /* Get Fuart closer to Fref */ in byt_set_termios() 86 fuart *= rounddown_pow_of_two(fref / fuart); in byt_set_termios() 94 rational_best_approximation(fuart, fref, w, w, &m, &n); in byt_set_termios()
|