Lines Matching refs:factors
869 static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors, in fll_factors() argument
875 factors->outdiv = 2; in fll_factors()
876 while (Fout * factors->outdiv < 90000000 || in fll_factors()
877 Fout * factors->outdiv > 100000000) { in fll_factors()
878 factors->outdiv *= 2; in fll_factors()
879 if (factors->outdiv > 32) { in fll_factors()
886 target = Fout * factors->outdiv; in fll_factors()
887 factors->outdiv = factors->outdiv >> 2; in fll_factors()
890 factors->freq_ref = 1; in fll_factors()
892 factors->freq_ref = 0; in fll_factors()
895 factors->fratio = 9; in fll_factors()
897 factors->fratio = 0; in fll_factors()
902 factors->fratio--; in fll_factors()
904 factors->fratio++; in fll_factors()
906 if (factors->fratio < 1 || factors->fratio > 8) { in fll_factors()
912 factors->n = target / (Fref * factors->fratio); in fll_factors()
913 Nmod = target % (Fref * factors->fratio); in fll_factors()
919 do_div(Kpart, (Fref * factors->fratio)); in fll_factors()
927 factors->k = K / 10; in fll_factors()
932 factors->n, factors->k, factors->fratio, factors->outdiv); in fll_factors()
943 struct fll_factors factors; in wm8400_set_dai_pll() local
951 ret = fll_factors(wm8400, &factors, freq_in, freq_out); in wm8400_set_dai_pll()
958 memset(&factors, 0, sizeof(factors)); in wm8400_set_dai_pll()
977 reg |= WM8400_FLL_FRAC | factors.fratio; in wm8400_set_dai_pll()
978 reg |= factors.freq_ref << WM8400_FLL_REF_FREQ_SHIFT; in wm8400_set_dai_pll()
981 snd_soc_component_write(component, WM8400_FLL_CONTROL_2, factors.k); in wm8400_set_dai_pll()
982 snd_soc_component_write(component, WM8400_FLL_CONTROL_3, factors.n); in wm8400_set_dai_pll()
986 reg |= factors.outdiv; in wm8400_set_dai_pll()