On Mon, Feb 10, 2014 at 05:24:47PM +0800, Sean Cross wrote: > On 8/2/14 2:12 AM, Mark Brown wrote: > > In general this looks like it should be making much more use of the > > framework rather than open coding, it looks like it's very much hard > > coded for one use cae. > I've tried to simplify the code somewhat, but I'm still unclear about > how much of the DAPM code functions. I'm running into two problems: > Mapping the codec names "OUT1" and "OUT2" onto "Speaker" and "Headphone" > respectively, and accommodating this codec's one DAC / two outputs > architecture. Describe the hardware accurately. If the hardware has outputs called OUT1 and OUT2 that aren't fixed function in some way then describe them like that, if the CODEC has routing control just describe the routing control. > First, this particular codec doesn't specify what the outputs are used > for, it only specifies the names OUT1 and OUT2. It is permitted to > connect either a speaker or headphones to either output. In the initial > patch, I hardcoded OUT1 to be named "Speaker", and OUT2 to "Headphone". > However, I've genericised the codec and changed them back to "OUT1" and > "OUT2". Inthe board definition I've added DAPM routes that map > "Speaker" and "Headphone" back onto these names. amixer still shows > OUT1 and OUT2. Good. > There seems to be some overlap between DAPM and kcontrols. How can I > specify in the board definition file that OUT1 should have a kcontrol > named "Speaker" and OUT2 should be named "Headphone"? Tracing shows > that DAPM at least recognizes the naming: e.g. "snd_soc_dapm_input_path: > *Speaker <- (direct) <- ROUT1" You can't, do this in your userspace configuration - UCM contains tools to help do remapping if you are using raw ALSA. Or extend the in kernel frameworks but that's probably more trouble than it's worth and it's not clear it's even a good idea to have the complexity in kernel. > Second, I'm having trouble getting the DAPM routing to function > properly. There is one DAC that routes to two outputs, OUT1 and OUT2. > Both OUT1 and OUT2 have their own volume controls as well, but the main > state machine and amplification comes from the DAC. This doesn't seem > to be very common. Are there any codecs I can use as an example that > have one DAC routing to two outputs? That's really common - the overwhelming majority of CODECs have such a design if they have multiple outputs. Could you articulate what's unclear here?
Attachment:
signature.asc
Description: Digital signature