]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.1.12/asoc-fsl_asrc-fix-the-issue-about-unsupported-rate.patch
move all the pending queues back to their "real" places
[thirdparty/kernel/stable-queue.git] / releases / 5.1.12 / asoc-fsl_asrc-fix-the-issue-about-unsupported-rate.patch
1 From b06c58c2a1eed571ea2a6640fdb85b7b00196b1e Mon Sep 17 00:00:00 2001
2 From: "S.j. Wang" <shengjiu.wang@nxp.com>
3 Date: Wed, 15 May 2019 06:42:18 +0000
4 Subject: ASoC: fsl_asrc: Fix the issue about unsupported rate
5
6 From: S.j. Wang <shengjiu.wang@nxp.com>
7
8 commit b06c58c2a1eed571ea2a6640fdb85b7b00196b1e upstream.
9
10 When the output sample rate is [8kHz, 30kHz], the limitation
11 of the supported ratio range is [1/24, 8]. In the driver
12 we use (8kHz, 30kHz) instead of [8kHz, 30kHz].
13 So this patch is to fix this issue and the potential rounding
14 issue with divider.
15
16 Fixes: fff6e03c7b65 ("ASoC: fsl_asrc: add support for 8-30kHz
17 output sample rate")
18 Cc: <stable@vger.kernel.org>
19 Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
20 Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
21 Signed-off-by: Mark Brown <broonie@kernel.org>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 sound/soc/fsl/fsl_asrc.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28 --- a/sound/soc/fsl/fsl_asrc.c
29 +++ b/sound/soc/fsl/fsl_asrc.c
30 @@ -282,8 +282,8 @@ static int fsl_asrc_config_pair(struct f
31 return -EINVAL;
32 }
33
34 - if ((outrate > 8000 && outrate < 30000) &&
35 - (outrate/inrate > 24 || inrate/outrate > 8)) {
36 + if ((outrate >= 8000 && outrate <= 30000) &&
37 + (outrate > 24 * inrate || inrate > 8 * outrate)) {
38 pair_err("exceed supported ratio range [1/24, 8] for \
39 inrate/outrate: %d/%d\n", inrate, outrate);
40 return -EINVAL;