]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: plugins: nhlt: add dmic dai index
authorJaska Uimonen <jaska.uimonen@linux.intel.com>
Fri, 5 Aug 2022 07:19:53 +0000 (10:19 +0300)
committerJaroslav Kysela <perex@perex.cz>
Fri, 4 Nov 2022 21:04:29 +0000 (22:04 +0100)
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>
topology/nhlt/intel/dmic-nhlt.c
topology/nhlt/nhlt-processor.c

index 38336c569c01e91b774ae01a10bdbfd5a5d73f69..ea93739ef3fd8a7b6793def3b8ed6f8b1d45f5d8 100644 (file)
@@ -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);
index 8b570a38f66519a2646a15b78ee78e7a6e65736b..24aed94940e0df39cc60742df2f96acb35a8031b 100644 (file)
@@ -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++;