From e13a7d3cf6df18f43c2f62eb46f4bfb4d2f4f37a Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Fri, 5 Aug 2022 10:19:53 +0300 Subject: [PATCH] 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 Signed-off-by: Jaroslav Kysela --- topology/nhlt/intel/dmic-nhlt.c | 2 +- topology/nhlt/nhlt-processor.c | 5 ++--- 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++; -- 2.47.1