Lines Matching refs:factors

852 static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors,  in fll_factors()  argument
858 factors->outdiv = 2; in fll_factors()
859 while (Fout * factors->outdiv < 90000000 || in fll_factors()
860 Fout * factors->outdiv > 100000000) { in fll_factors()
861 factors->outdiv *= 2; in fll_factors()
862 if (factors->outdiv > 32) { in fll_factors()
869 target = Fout * factors->outdiv; in fll_factors()
870 factors->outdiv = factors->outdiv >> 2; in fll_factors()
873 factors->freq_ref = 1; in fll_factors()
875 factors->freq_ref = 0; in fll_factors()
878 factors->fratio = 9; in fll_factors()
880 factors->fratio = 0; in fll_factors()
885 factors->fratio--; in fll_factors()
887 factors->fratio++; in fll_factors()
889 if (factors->fratio < 1 || factors->fratio > 8) { 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()
910 factors->k = K / 10; in fll_factors()
915 factors->n, factors->k, factors->fratio, factors->outdiv); in fll_factors()
926 struct fll_factors factors; in wm8400_set_dai_pll() local
934 ret = fll_factors(wm8400, &factors, freq_in, freq_out); in wm8400_set_dai_pll()
941 memset(&factors, 0, sizeof(factors)); in wm8400_set_dai_pll()
960 reg |= WM8400_FLL_FRAC | factors.fratio; in wm8400_set_dai_pll()
961 reg |= factors.freq_ref << WM8400_FLL_REF_FREQ_SHIFT; in wm8400_set_dai_pll()
964 snd_soc_component_write(component, WM8400_FLL_CONTROL_2, factors.k); in wm8400_set_dai_pll()
965 snd_soc_component_write(component, WM8400_FLL_CONTROL_3, factors.n); in wm8400_set_dai_pll()
969 reg |= factors.outdiv; in wm8400_set_dai_pll()