mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-09 10:06:17 -05:00
UCM: Implement ConflictingDevices, add device list to devices
Wherever SupportedDevice can appear, also allow ConflictingDevice. Only one or the other (or neither) may be specified. When neither is specified, allow anything. Sometimes, listing ConflictingDevices may result in a shorter list than explicitly listing all SupportedDevices. Add support for SupportedDevice and ConflictingDevice to SectionDevice. This allows representing devices which are mutually exclusive, e.g. due to a mux that switches between capturing from two different microphones, without the possibility of mixing. Enhance is_modifier_supported to allow ignoring SupportedDevice and ConflictingDevice. This is useful when querying values from a SectionModifier; there's no reason we shouldn't be able to query values just because the current configuration would prevent enabling that device. The new is_device_supported is implemented similarly. Enhance switch_device to remove the old device from the current device list before querying for the new device, and add it back immediately afterwards. This allows the query for the new device to ignore any conflicts caused solely by the old device. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
866fa538d4
commit
fc038149c5
4 changed files with 167 additions and 55 deletions
|
|
@ -99,13 +99,13 @@ void uc_mgr_free_value(struct list_head *base)
|
|||
}
|
||||
}
|
||||
|
||||
void uc_mgr_free_dev_list(struct list_head *base)
|
||||
void uc_mgr_free_dev_list(struct dev_list *dev_list)
|
||||
{
|
||||
struct list_head *pos, *npos;
|
||||
struct dev_list *dlist;
|
||||
struct dev_list_node *dlist;
|
||||
|
||||
list_for_each_safe(pos, npos, base) {
|
||||
dlist = list_entry(pos, struct dev_list, list);
|
||||
list_for_each_safe(pos, npos, &dev_list->list) {
|
||||
dlist = list_entry(pos, struct dev_list_node, list);
|
||||
free(dlist->name);
|
||||
list_del(&dlist->list);
|
||||
free(dlist);
|
||||
|
|
@ -189,6 +189,7 @@ void uc_mgr_free_device(struct list_head *base)
|
|||
uc_mgr_free_sequence(&dev->enable_list);
|
||||
uc_mgr_free_sequence(&dev->disable_list);
|
||||
uc_mgr_free_transition(&dev->transition_list);
|
||||
uc_mgr_free_dev_list(&dev->dev_list);
|
||||
uc_mgr_free_value(&dev->value_list);
|
||||
list_del(&dev->list);
|
||||
free(dev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue