summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaska Uimonen <jaska.uimonen@linux.intel.com>2022-08-05 10:19:53 +0300
committerJaroslav Kysela <perex@perex.cz>2022-11-04 22:04:29 +0100
commite13a7d3cf6df18f43c2f62eb46f4bfb4d2f4f37a (patch)
tree9f2b87281c8883ff649bb311fafd38a612b000a4
parent038ed518e9927d915d65de094384025f77e9f0c4 (diff)
downloadalsa-utils-e13a7d3cf6df18f43c2f62eb46f4bfb4d2f4f37a.tar.gz
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>
-rw-r--r--topology/nhlt/intel/dmic-nhlt.c2
-rw-r--r--topology/nhlt/nhlt-processor.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/topology/nhlt/intel/dmic-nhlt.c b/topology/nhlt/intel/dmic-nhlt.c
index 38336c5..ea93739 100644
--- a/topology/nhlt/intel/dmic-nhlt.c
+++ b/topology/nhlt/intel/dmic-nhlt.c
@@ -251,7 +251,7 @@ int nhlt_dmic_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor
ep.subsystem_id = 0;
ep.device_type = 0;
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,
&array_type, &num_mics, &extension, &snr, &sensitivity);
diff --git a/topology/nhlt/nhlt-processor.c b/topology/nhlt/nhlt-processor.c
index 8b570a3..24aed94 100644
--- a/topology/nhlt/nhlt-processor.c
+++ b/topology/nhlt/nhlt-processor.c
@@ -327,9 +327,8 @@ static int nhlt_create(struct intel_nhlt_params *nhlt, snd_config_t *input, snd_
eps[i] = NULL;
/* we always have only 0 or 1 dmic ep */
- if (nhlt_dmic_get_ep_count(nhlt)) {
- /* the index is always 0 in dmic case */
- ret = nhlt_dmic_get_ep(nhlt, &eps[eps_count], 0);
+ for (i = 0; i < nhlt_dmic_get_ep_count(nhlt); i++) {
+ ret = nhlt_dmic_get_ep(nhlt, &eps[eps_count], i);
if (ret < 0)
return -EINVAL;
eps_count++;