From: Shengjiu Wang Date: Wed, 11 Dec 2019 11:57:22 +0000 (+0800) Subject: ASoC: wm8962: fix lambda value X-Git-Tag: v3.16.83~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c6879d121ebe0886f22233e284af5fadfb15048;p=thirdparty%2Fkernel%2Fstable.git ASoC: wm8962: fix lambda value commit 556672d75ff486e0b6786056da624131679e0576 upstream. According to user manual, it is required that FLL_LAMBDA > 0 in all cases (Integer and Franctional modes). Fixes: 9a76f1ff6e29 ("ASoC: Add initial WM8962 CODEC driver") Signed-off-by: Shengjiu Wang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1576065442-19763-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Ben Hutchings --- diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 0caaa8fa42311..af54f736c01d2 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2795,7 +2795,7 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, if (target % Fref == 0) { fll_div->theta = 0; - fll_div->lambda = 0; + fll_div->lambda = 1; } else { gcd_fll = gcd(target, fratio * Fref); @@ -2865,7 +2865,7 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, return -EINVAL; } - if (fll_div.theta || fll_div.lambda) + if (fll_div.theta) fll1 |= WM8962_FLL_FRAC; /* Stop the FLL while we reconfigure */