ASoC: arizona: Support variable FLL VCO multipliers
[firefly-linux-kernel-4.4.55.git] / sound / soc / codecs / arizona.c
index f3680c374347202a60aae3fc6d035af4250c41bd..5c9cacaf2d525cddabffd0b416c0695dfadaab99 100644 (file)
@@ -734,9 +734,9 @@ static int arizona_calc_fll(struct arizona_fll *fll,
        /* Apply the division for our remaining calculations */
        Fref /= div;
 
-       /* Fvco should be 90-100MHz; don't check the upper bound */
+       /* Fvco should be over the targt; don't check the upper bound */
        div = 1;
-       while (Fout * div < 90000000) {
+       while (Fout * div < 90000000 * fll->vco_mult) {
                div++;
                if (div > 7) {
                        arizona_fll_err(fll, "No FLL_OUTDIV for Fout=%uHz\n",
@@ -744,7 +744,7 @@ static int arizona_calc_fll(struct arizona_fll *fll,
                        return -EINVAL;
                }
        }
-       target = Fout * div;
+       target = Fout * div / fll->vco_mult;
        cfg->outdiv = div;
 
        arizona_fll_dbg(fll, "Fvco=%dHz\n", target);