diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2013-09-20 13:19:07 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-23 07:06:25 -0400 |
commit | 630a1b3b4f0bb40c84c1fde4fec0d97de62ccdac (patch) | |
tree | 2dbe5cc90530722a18b0275d92e2aa7d9c4dc777 /Documentation/sound/alsa | |
parent | 3eb012834b28585a37fe0684182828efc1ab0512 (diff) |
ASoC: Docs: update DAPM
Update the DAPM documentation and bring it up to date with the current
code base. This includes API changes and new widgets.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'Documentation/sound/alsa')
-rw-r--r-- | Documentation/sound/alsa/soc/dapm.txt | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index 05bf5a0eee41..7dfd88ce31ac 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt | |||
@@ -21,7 +21,7 @@ level power systems. | |||
21 | 21 | ||
22 | There are 4 power domains within DAPM | 22 | There are 4 power domains within DAPM |
23 | 23 | ||
24 | 1. Codec domain - VREF, VMID (core codec and audio power) | 24 | 1. Codec bias domain - VREF, VMID (core codec and audio power) |
25 | Usually controlled at codec probe/remove and suspend/resume, although | 25 | Usually controlled at codec probe/remove and suspend/resume, although |
26 | can be set at stream time if power is not needed for sidetone, etc. | 26 | can be set at stream time if power is not needed for sidetone, etc. |
27 | 27 | ||
@@ -63,14 +63,22 @@ Audio DAPM widgets fall into a number of types:- | |||
63 | o Line - Line Input/Output (and optional Jack) | 63 | o Line - Line Input/Output (and optional Jack) |
64 | o Speaker - Speaker | 64 | o Speaker - Speaker |
65 | o Supply - Power or clock supply widget used by other widgets. | 65 | o Supply - Power or clock supply widget used by other widgets. |
66 | o Regulator - External regulator that supplies power to audio components. | ||
67 | o Clock - External clock that supplies clock to audio componnents. | ||
68 | o AIF IN - Audio Interface Input (with TDM slot mask). | ||
69 | o AIF OUT - Audio Interface Output (with TDM slot mask). | ||
70 | o Siggen - Signal Generator. | ||
71 | o DAI IN - Digital Audio Interface Input. | ||
72 | o DAI OUT - Digital Audio Interface Output. | ||
73 | o DAI Link - DAI Link between two DAI structures */ | ||
66 | o Pre - Special PRE widget (exec before all others) | 74 | o Pre - Special PRE widget (exec before all others) |
67 | o Post - Special POST widget (exec after all others) | 75 | o Post - Special POST widget (exec after all others) |
68 | 76 | ||
69 | (Widgets are defined in include/sound/soc-dapm.h) | 77 | (Widgets are defined in include/sound/soc-dapm.h) |
70 | 78 | ||
71 | Widgets are usually added in the codec driver and the machine driver. There are | 79 | Widgets can be added to the sound card by any of the component driver types. |
72 | convenience macros defined in soc-dapm.h that can be used to quickly build a | 80 | There are convenience macros defined in soc-dapm.h that can be used to quickly |
73 | list of widgets of the codecs and machines DAPM widgets. | 81 | build a list of widgets of the codecs and machines DAPM widgets. |
74 | 82 | ||
75 | Most widgets have a name, register, shift and invert. Some widgets have extra | 83 | Most widgets have a name, register, shift and invert. Some widgets have extra |
76 | parameters for stream name and kcontrols. | 84 | parameters for stream name and kcontrols. |
@@ -80,11 +88,13 @@ parameters for stream name and kcontrols. | |||
80 | ------------------------- | 88 | ------------------------- |
81 | 89 | ||
82 | Stream Widgets relate to the stream power domain and only consist of ADCs | 90 | Stream Widgets relate to the stream power domain and only consist of ADCs |
83 | (analog to digital converters) and DACs (digital to analog converters). | 91 | (analog to digital converters), DACs (digital to analog converters), |
92 | AIF IN and AIF OUT. | ||
84 | 93 | ||
85 | Stream widgets have the following format:- | 94 | Stream widgets have the following format:- |
86 | 95 | ||
87 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), | 96 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), |
97 | SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert) | ||
88 | 98 | ||
89 | NOTE: the stream name must match the corresponding stream name in your codec | 99 | NOTE: the stream name must match the corresponding stream name in your codec |
90 | snd_soc_codec_dai. | 100 | snd_soc_codec_dai. |
@@ -94,6 +104,11 @@ e.g. stream widgets for HiFi playback and capture | |||
94 | SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), | 104 | SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), |
95 | SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), | 105 | SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), |
96 | 106 | ||
107 | e.g. stream widgets for AIF | ||
108 | |||
109 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), | ||
110 | SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), | ||
111 | |||
97 | 112 | ||
98 | 2.2 Path Domain Widgets | 113 | 2.2 Path Domain Widgets |
99 | ----------------------- | 114 | ----------------------- |
@@ -121,12 +136,14 @@ If you dont want the mixer elements prefixed with the name of the mixer widget, | |||
121 | you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same | 136 | you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same |
122 | as for SND_SOC_DAPM_MIXER. | 137 | as for SND_SOC_DAPM_MIXER. |
123 | 138 | ||
124 | 2.3 Platform/Machine domain Widgets | 139 | |
125 | ----------------------------------- | 140 | 2.3 Machine domain Widgets |
141 | -------------------------- | ||
126 | 142 | ||
127 | Machine widgets are different from codec widgets in that they don't have a | 143 | Machine widgets are different from codec widgets in that they don't have a |
128 | codec register bit associated with them. A machine widget is assigned to each | 144 | codec register bit associated with them. A machine widget is assigned to each |
129 | machine audio component (non codec) that can be independently powered. e.g. | 145 | machine audio component (non codec or DSP) that can be independently |
146 | powered. e.g. | ||
130 | 147 | ||
131 | o Speaker Amp | 148 | o Speaker Amp |
132 | o Microphone Bias | 149 | o Microphone Bias |
@@ -146,12 +163,12 @@ static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) | |||
146 | SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), | 163 | SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), |
147 | 164 | ||
148 | 165 | ||
149 | 2.4 Codec Domain | 166 | 2.4 Codec (BIAS) Domain |
150 | ---------------- | 167 | ----------------------- |
151 | 168 | ||
152 | The codec power domain has no widgets and is handled by the codecs DAPM event | 169 | The codec bias power domain has no widgets and is handled by the codecs DAPM |
153 | handler. This handler is called when the codec powerstate is changed wrt to any | 170 | event handler. This handler is called when the codec powerstate is changed wrt |
154 | stream event or by kernel PM events. | 171 | to any stream event or by kernel PM events. |
155 | 172 | ||
156 | 173 | ||
157 | 2.5 Virtual Widgets | 174 | 2.5 Virtual Widgets |
@@ -169,15 +186,16 @@ After all the widgets have been defined, they can then be added to the DAPM | |||
169 | subsystem individually with a call to snd_soc_dapm_new_control(). | 186 | subsystem individually with a call to snd_soc_dapm_new_control(). |
170 | 187 | ||
171 | 188 | ||
172 | 3. Codec Widget Interconnections | 189 | 3. Codec/DSP Widget Interconnections |
173 | ================================ | 190 | ==================================== |
174 | 191 | ||
175 | Widgets are connected to each other within the codec and machine by audio paths | 192 | Widgets are connected to each other within the codec, platform and machine by |
176 | (called interconnections). Each interconnection must be defined in order to | 193 | audio paths (called interconnections). Each interconnection must be defined in |
177 | create a map of all audio paths between widgets. | 194 | order to create a map of all audio paths between widgets. |
178 | 195 | ||
179 | This is easiest with a diagram of the codec (and schematic of the machine audio | 196 | This is easiest with a diagram of the codec or DSP (and schematic of the machine |
180 | system), as it requires joining widgets together via their audio signal paths. | 197 | audio system), as it requires joining widgets together via their audio signal |
198 | paths. | ||
181 | 199 | ||
182 | e.g., from the WM8731 output mixer (wm8731.c) | 200 | e.g., from the WM8731 output mixer (wm8731.c) |
183 | 201 | ||
@@ -247,16 +265,9 @@ machine and includes the codec. e.g. | |||
247 | o Mic Jack | 265 | o Mic Jack |
248 | o Codec Pins | 266 | o Codec Pins |
249 | 267 | ||
250 | When a codec pin is NC it can be marked as not used with a call to | 268 | Endpoints are added to the DAPM graph so that their usage can be determined in |
251 | 269 | order to save power. e.g. NC codecs pins will be switched OFF, unconnected | |
252 | snd_soc_dapm_set_endpoint(codec, "Widget Name", 0); | 270 | jacks can also be switched OFF. |
253 | |||
254 | The last argument is 0 for inactive and 1 for active. This way the pin and its | ||
255 | input widget will never be powered up and consume power. | ||
256 | |||
257 | This also applies to machine widgets. e.g. if a headphone is connected to a | ||
258 | jack then the jack can be marked active. If the headphone is removed, then | ||
259 | the headphone jack can be marked inactive. | ||
260 | 271 | ||
261 | 272 | ||
262 | 5 DAPM Widget Events | 273 | 5 DAPM Widget Events |