Liam Girdwood wrote at Thursday, May 26, 2011 5:02 AM:
On 25/05/11 23:38, Stephen Warren wrote:
Liam Girdwood wrote at Saturday, May 21, 2011 10:20 AM:
On 20/05/11 22:48, Stephen Warren wrote:
I have a few more questions how to represent things in UCM. ... The WM8903 can capture from one or the other or AMIC/DMIC, but not both. ... How to indicate when certain devices can be used together, or are mutually exclusive?
Atm, I don't think we can do this with devices. We can do it with modifiers though (i.e. a modifier can list it's supported devices). It does sound like a useful feature and probably could be based on the modifier supported device code.
OK, it looks pretty easy to modify the code to parse and implement something like:
SectionDevice."AMIC".0 { Comment "Analog Microphone Jack"
ConflictingDevice [ "DMIC", "foo" ]
... }
SectionDevice."DMIC".0 { Comment "Internal Digital Microphone"
ConflictingDevice [ "AMIC" ]
... }
Does that look reasonable?
Yes, although does it make more sense using "SupportedDevice" instead ?
I assume a SupportedDevice list would be all devices in the current verb that are compatible with the SectionDevice being defined, i.e. you're talking about different semantics, rather than just a different textual name for the section.
My thought process here was that conflicting devices are probably less common than non-conflicting devices. At least, it seems like that'd be the default assumption of someone writing a UCM file. So, if we list ConflictingDevice(s), then that would often map to an empty list, and you could eliminate the section. If we had to list all compatible devices, by default you'd have to list every device in the UCM verb in almost all cases. That seems like more work.
Plus, adding an optional ConflictingDevice list maintains backwards Compatibility with any existing UCM files, whereas adding a mandatory SupportedDevice list doesn't.
Still, explicitly listing SupportedDevice(s) might be safer?
I wonder if allowing all lists of devices to be either inclusive SupportedDevice or exclusive ConflictingDevice makes sense, with the default being ConflictingDevice being empty, and SupportedDevice being the entire set of devices? Seems more complex, but probably still workable.
I'll go with whatever call you want to make.