ASoC: arizona: Correct relationship between VCO corner and Fref
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 9 Jul 2014 16:41:45 +0000 (17:41 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 10 Jul 2014 10:09:15 +0000 (12:09 +0200)
When configuring the FLL we must ensure that the reference clock passed
to the FLL is under a certain limit. This limit was specified
incorrectly in the current code, this patch corrects this. Although the
error will only be encountered in some edge cases.

Reported-by: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/arizona.c

index 4c4727f0837ce47ad904ce0147bec306c2ed57b2..6084af76f337137223e88f1d90bd2b57878857f6 100644 (file)
@@ -1578,8 +1578,8 @@ static int arizona_calc_fratio(struct arizona_fll *fll,
        while (div <= ARIZONA_FLL_MAX_REFDIV) {
                for (ratio = init_ratio; ratio <= ARIZONA_FLL_MAX_FRATIO;
                     ratio++) {
-                       if (ARIZONA_FLL_VCO_CORNER / (fll->vco_mult * ratio) <
-                           Fref)
+                       if ((ARIZONA_FLL_VCO_CORNER / 2) /
+                           (fll->vco_mult * ratio) < Fref)
                                break;
 
                        if (target % (ratio * Fref)) {