alsa-ucm: Make ports store only one device

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

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Wim Taymans 2023-03-20 17:14:39 +01:00
parent 68ac72d098
commit b02c8ba153
3 changed files with 24 additions and 108 deletions

View file

@ -1253,8 +1253,7 @@ static int setup_mixer(pa_card *impl, pa_alsa_device *dev, bool ignore_dB)
* will be NULL, but the UCM device enable sequence will still need to be
* executed. */
if (dev->active_port && dev->ucm_context) {
if ((res = pa_alsa_ucm_set_port(dev->ucm_context, dev->active_port,
dev->direction == PA_ALSA_DIRECTION_OUTPUT)) < 0)
if ((res = pa_alsa_ucm_set_port(dev->ucm_context, dev->active_port)) < 0)
return res;
}
@ -1843,8 +1842,7 @@ int acp_device_set_port(struct acp_device *dev, uint32_t port_index, uint32_t fl
mixer_volume_init(impl, d);
sync_mixer(d, p);
res = pa_alsa_ucm_set_port(d->ucm_context, p,
dev->direction == ACP_DIRECTION_PLAYBACK);
res = pa_alsa_ucm_set_port(d->ucm_context, p);
} else {
pa_alsa_port_data *data;