Lines Matching refs:factors
872 static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors, in fll_factors() argument
878 factors->outdiv = 2; in fll_factors()
879 while (Fout * factors->outdiv < 90000000 || in fll_factors()
880 Fout * factors->outdiv > 100000000) { in fll_factors()
881 factors->outdiv *= 2; in fll_factors()
882 if (factors->outdiv > 32) { in fll_factors()
889 target = Fout * factors->outdiv; in fll_factors()
890 factors->outdiv = factors->outdiv >> 2; in fll_factors()
893 factors->freq_ref = 1; in fll_factors()
895 factors->freq_ref = 0; in fll_factors()
898 factors->fratio = 9; in fll_factors()
900 factors->fratio = 0; in fll_factors()
905 factors->fratio--; in fll_factors()
907 factors->fratio++; in fll_factors()
909 if (factors->fratio < 1 || factors->fratio > 8) { in fll_factors()
915 factors->n = target / (Fref * factors->fratio); in fll_factors()
916 Nmod = target % (Fref * factors->fratio); in fll_factors()
922 do_div(Kpart, (Fref * factors->fratio)); in fll_factors()
930 factors->k = K / 10; in fll_factors()
935 factors->n, factors->k, factors->fratio, factors->outdiv); in fll_factors()
946 struct fll_factors factors; in wm8400_set_dai_pll() local
954 ret = fll_factors(wm8400, &factors, freq_in, freq_out); in wm8400_set_dai_pll()
961 memset(&factors, 0, sizeof(factors)); in wm8400_set_dai_pll()
980 reg |= WM8400_FLL_FRAC | factors.fratio; in wm8400_set_dai_pll()
981 reg |= factors.freq_ref << WM8400_FLL_REF_FREQ_SHIFT; in wm8400_set_dai_pll()
984 snd_soc_write(codec, WM8400_FLL_CONTROL_2, factors.k); in wm8400_set_dai_pll()
985 snd_soc_write(codec, WM8400_FLL_CONTROL_3, factors.n); in wm8400_set_dai_pll()
989 reg |= factors.outdiv; in wm8400_set_dai_pll()