alsa-ucm: Make mapping UCM contexts have only one device

After previous patches, we should be generating no combination ports, so
we don't need to store multiple devices per mapping. Simplify the code
based on this.

Link: 084d70a1e2
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
[Wim: Apply to acp add_profiles() and acp_card_set_profile()]
This commit is contained in:
Alper Nebi Yasak 2023-11-27 23:52:45 +03:00 committed by Wim Taymans
parent b8361cc568
commit bc42a617a4
3 changed files with 39 additions and 73 deletions

View file

@ -510,7 +510,7 @@ static void add_profiles(pa_card *impl)
pa_dynarray_append(&impl->out.devices, dev);
}
if (impl->use_ucm) {
if (m->ucm_context.ucm_devices) {
if (m->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(NULL, &m->ucm_context,
true, impl->ports, ap, NULL);
pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
@ -534,7 +534,7 @@ static void add_profiles(pa_card *impl)
}
if (impl->use_ucm) {
if (m->ucm_context.ucm_devices) {
if (m->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(NULL, &m->ucm_context,
false, impl->ports, ap, NULL);
pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
@ -1516,7 +1516,7 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index, uint32_t fla
PA_IDXSET_FOREACH(am, np->output_mappings, idx) {
if (impl->use_ucm) {
/* Update ports priorities */
if (am->ucm_context.ucm_devices) {
if (am->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(am->output.ports, &am->ucm_context,
true, impl->ports, np, NULL);
}
@ -1529,7 +1529,7 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index, uint32_t fla
PA_IDXSET_FOREACH(am, np->input_mappings, idx) {
if (impl->use_ucm) {
/* Update ports priorities */
if (am->ucm_context.ucm_devices) {
if (am->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(am->input.ports, &am->ucm_context,
false, impl->ports, np, NULL);
}