topology: nhlt: Intel: Add check for DMIC version

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>
This commit is contained in:
Seppo Ingalsuo 2024-02-28 17:04:33 +02:00 committed by Jaroslav Kysela
parent 3ad48bd0f8
commit 9efbf459fb

View 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;
}