[alsa-devel] ASoC: help needed for capture DAPM (twl4030)

Peter Ujfalusi peter.ujfalusi at nokia.com
Tue Dec 16 10:17:49 CET 2008


I need some help/advice on how to implement the DAPM routings for twl4030 
capture path.
There are at least two issues which I'm wondering at the moment.

[1] Mux for the analog paths
As with other parts, this is implemented as a bitfield, where only one bit can 
be enabled at the time (0x0 being no routed inputs).
ADCL <-|- Main Mix (0x1)
       |- Headset mic (0x2)
       |- AUXL, LineL (0x4)
       |- Carkit mic (0x8)
Invalid values: 0x3, 0x5, 0x6, 0x7

ADCR <-|- Sub mic (0x1)
       |- AUXR, LineR (0x4)
Invalid values: 0x2, 0x3

Since the playback path also has similar 'mux as not enum but bitfield' types, 
I'm thinking of creating a new type for soc based on the soc_enum. This new 
type would store the valid enum texts and the corresponding value in the 
register (with mask). This could be used in very flexible way. It can be also 
be used instead of the normal enum types (altrough it does not make sense).
But this can wait for now.

[2] ADC versus digital microphone
TWL has two ADCs (ADCL, ADCR), the routing looks something like this, when the 
ADCs are in use:

InputL mux -> AmpliL -> ADCL |-> ATXL1_PGA -> Mic channel1 (I2S, TDM)
                             |-> ATXL2_PGA -> Mic channel2 (TDM)

InputR mux -> AmpliR -> ADCR |-> ATXR1_PGA -> Mic channel3 (I2S, TDM)
                             |-> ATXR2_PGA -> Mic channel4 (TDM)

When the digital microphones are in use:
Digimic0 Left  -> ATXL1_PGA -> Mic channel1 (I2S, TDM)
Digimic0 Right -> ATXR1_PGA -> Mic channel3 (I2S, TDM)

Digimic1 Left  -> ATXL2_PGA -> Mic channel2 (TDM)
Digimic1 Right -> ATXR2_PGA -> Mic channel4 (TDM)

There is a single point of selection for Mic channel1,3 and for channel2,4.
So ATXL1_PGA and ATXR1_PGA receives the data either from the ADCs or from the 
digimic0, ATXL2_PGA and ATXR2_PGA receives the data either from the ADCs or 
from the digimic1.

As you can see, if the digital mic is selected the ADC can be powered off, 
since they are not needed.
How to map this with DAPM?
Is it mandatory to have the SND_SOC_DAPM_INPUT(digimic) to be connected to 
I have been thinking to create four 'ghost ADC' for the four channel. Than 
when building the route the real ADCs can receive switches to handle the 
power management. 

Thank you,

More information about the Alsa-devel mailing list