Lines Matching refs:factors
852 static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors,
858 factors->outdiv = 2;
859 while (Fout * factors->outdiv < 90000000 ||
860 Fout * factors->outdiv > 100000000) {
861 factors->outdiv *= 2;
862 if (factors->outdiv > 32) {
869 target = Fout * factors->outdiv;
870 factors->outdiv = factors->outdiv >> 2;
873 factors->freq_ref = 1;
875 factors->freq_ref = 0;
878 factors->fratio = 9;
880 factors->fratio = 0;
885 factors->fratio--;
887 factors->fratio++;
889 if (factors->fratio < 1 || factors->fratio > 8) {
895 factors->n = target / (Fref * factors->fratio);
896 Nmod = target % (Fref * factors->fratio);
902 do_div(Kpart, (Fref * factors->fratio));
910 factors->k = K / 10;
915 factors->n, factors->k, factors->fratio, factors->outdiv);
926 struct fll_factors factors;
934 ret = fll_factors(wm8400, &factors, freq_in, freq_out);
941 memset(&factors, 0, sizeof(factors));
960 reg |= WM8400_FLL_FRAC | factors.fratio;
961 reg |= factors.freq_ref << WM8400_FLL_REF_FREQ_SHIFT;
964 snd_soc_component_write(component, WM8400_FLL_CONTROL_2, factors.k);
965 snd_soc_component_write(component, WM8400_FLL_CONTROL_3, factors.n);
969 reg |= factors.outdiv;