]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: nhlt: Intel: Add check for DMIC version
authorSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Wed, 28 Feb 2024 15:04:33 +0000 (17:04 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 16 Mar 2024 18:01:11 +0000 (19:01 +0100)
Error if the version passed from topology is not known. Also fix the
dmic_set_params() error prints for to show the correct function name.

Closes: https://github.com/alsa-project/alsa-utils/pull/254
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/nhlt/intel/dmic/dmic-process.c

index facf24f0d464acf500fff50398b16428b0bcb518..ead272509742b4a70671ee175f311c04d3dfddf8 100644 (file)
@@ -1232,7 +1232,12 @@ int dmic_set_params(struct intel_nhlt_params *nhlt, int dai_index, int driver_ve
                return -EINVAL;
 
        if (dai_index >= DMIC_HW_FIFOS) {
-               fprintf(stderr, "set_dmic_data illegal dai index\n");
+               fprintf(stderr, "%s: illegal dai index %d \n", __func__, dai_index);
+               return -EINVAL;
+       }
+
+       if (driver_version < 1 || driver_version > 5) {
+               fprintf(stderr, "%s: illegal driver version %d\n", __func__, driver_version);
                return -EINVAL;
        }