Skip to content

Commit

Permalink
ASoC: rsnd: Fixup SRCm_IFSVR calculate method
Browse files Browse the repository at this point in the history
This patch fixes the calculation accuracy degradation of SRCm_IFSVR
register value.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Hiroyuki Yokoyama authored and Mark Brown committed Jul 27, 2016
1 parent 523d939 commit 93ca33c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 93ca33c

Please sign in to comment.