From: Hiroyuki Yokoyama Date: Mon, 25 Jul 2016 01:52:43 +0000 (+0000) Subject: ASoC: rsnd: Fixup SRCm_IFSVR calculate method X-Git-Tag: v4.8-rc4~10^2^2~2^2 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=93ca33c99f22a0a096f83f19c9f887aeb67507a1;p=cascardo%2Flinux.git ASoC: rsnd: Fixup SRCm_IFSVR calculate method This patch fixes the calculation accuracy degradation of SRCm_IFSVR register value. Signed-off-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index e39f916d0f2f..969a5169de25 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -226,8 +226,12 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, ifscr = 0; fsrate = 0; if (fin != fout) { + u64 n; + ifscr = 1; - fsrate = 0x0400000 / fout * fin; + n = (u64)0x0400000 * fin; + do_div(n, fout); + fsrate = n; } /*