topology: plugins: nhlt: add dmic dai index

Dmic might have multiple configurations for the same hw, so add them to
nhlt blob. The configurations are separated by dai_index.

Fixes: https://github.com/alsa-project/alsa-utils/pull/164
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaska Uimonen 2022-08-05 10:19:53 +03:00 committed by Jaroslav Kysela
parent 038ed518e9
commit e13a7d3cf6
2 changed files with 3 additions and 4 deletions

View file

@ -251,7 +251,7 @@ int nhlt_dmic_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor
ep.subsystem_id = 0; ep.subsystem_id = 0;
ep.device_type = 0; ep.device_type = 0;
ep.direction = NHLT_ENDPOINT_DIRECTION_CAPTURE; ep.direction = NHLT_ENDPOINT_DIRECTION_CAPTURE;
ep.virtualbus_id = 0; ep.virtualbus_id = index;
ret = dmic_get_params(nhlt, index, &sample_rate, &channel_count, &bits_per_sample, ret = dmic_get_params(nhlt, index, &sample_rate, &channel_count, &bits_per_sample,
&array_type, &num_mics, &extension, &snr, &sensitivity); &array_type, &num_mics, &extension, &snr, &sensitivity);

View file

@ -327,9 +327,8 @@ static int nhlt_create(struct intel_nhlt_params *nhlt, snd_config_t *input, snd_
eps[i] = NULL; eps[i] = NULL;
/* we always have only 0 or 1 dmic ep */ /* we always have only 0 or 1 dmic ep */
if (nhlt_dmic_get_ep_count(nhlt)) { for (i = 0; i < nhlt_dmic_get_ep_count(nhlt); i++) {
/* the index is always 0 in dmic case */ ret = nhlt_dmic_get_ep(nhlt, &eps[eps_count], i);
ret = nhlt_dmic_get_ep(nhlt, &eps[eps_count], 0);
if (ret < 0) if (ret < 0)
return -EINVAL; return -EINVAL;
eps_count++; eps_count++;