OSDN Git Service

ASoC: fsl_asrc: Fix the issue about unsupported rate
[android-x86/kernel.git] / sound / soc / fsl / fsl_asrc.c
index 1d82f68..88a438f 100644 (file)
@@ -286,8 +286,8 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair)
                return -EINVAL;
        }
 
-       if ((outrate > 8000 && outrate < 30000) &&
-           (outrate/inrate > 24 || inrate/outrate > 8)) {
+       if ((outrate >= 8000 && outrate <= 30000) &&
+           (outrate > 24 * inrate || inrate > 8 * outrate)) {
                pair_err("exceed supported ratio range [1/24, 8] for \
                                inrate/outrate: %d/%d\n", inrate, outrate);
                return -EINVAL;