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:
Stephen Warren 2011-06-03 14:56:31 -06:00 committed by Takashi Iwai
parent 866fa538d4
commit fc038149c5
4 changed files with 167 additions and 55 deletions

View file

@ -76,11 +76,21 @@ struct transition_sequence {
/*
* Modifier Supported Devices.
*/
struct dev_list {
enum dev_list_type {
DEVLIST_NONE,
DEVLIST_SUPPORTED,
DEVLIST_CONFLICTING
};
struct dev_list_node {
struct list_head list;
char *name;
};
struct dev_list {
enum dev_list_type type;
struct list_head list;
};
/*
* Describes a Use Case Modifier and it's enable and disable sequences.
@ -100,8 +110,8 @@ struct use_case_modifier {
/* modifier transition list */
struct list_head transition_list;
/* list of supported devices per modifier */
struct list_head dev_list;
/* list of devices supported or conflicting */
struct dev_list dev_list;
/* values */
struct list_head value_list;
@ -125,6 +135,9 @@ struct use_case_device {
/* device transition list */
struct list_head transition_list;
/* list of devices supported or conflicting */
struct dev_list dev_list;
/* value list */
struct list_head value_list;
};