]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.9/asoc-fsl_asrc-fix-the-issue-about-unsupported-rate.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / asoc-fsl_asrc-fix-the-issue-about-unsupported-rate.patch
CommitLineData
96f81b03
GKH
1From b06c58c2a1eed571ea2a6640fdb85b7b00196b1e Mon Sep 17 00:00:00 2001
2From: "S.j. Wang" <shengjiu.wang@nxp.com>
3Date: Wed, 15 May 2019 06:42:18 +0000
4Subject: ASoC: fsl_asrc: Fix the issue about unsupported rate
5
6From: S.j. Wang <shengjiu.wang@nxp.com>
7
8commit b06c58c2a1eed571ea2a6640fdb85b7b00196b1e upstream.
9
10When the output sample rate is [8kHz, 30kHz], the limitation
11of the supported ratio range is [1/24, 8]. In the driver
12we use (8kHz, 30kHz) instead of [8kHz, 30kHz].
13So this patch is to fix this issue and the potential rounding
14issue with divider.
15
16Fixes: fff6e03c7b65 ("ASoC: fsl_asrc: add support for 8-30kHz
17output sample rate")
18Cc: <stable@vger.kernel.org>
19Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
20Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
21Signed-off-by: Mark Brown <broonie@kernel.org>
22Signed-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@@ -286,8 +286,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;