aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2013-09-20 13:19:07 -0400
committerMark Brown <broonie@linaro.org>2013-09-23 07:06:25 -0400
commit630a1b3b4f0bb40c84c1fde4fec0d97de62ccdac (patch)
tree2dbe5cc90530722a18b0275d92e2aa7d9c4dc777 /Documentation/sound/alsa
parent3eb012834b28585a37fe0684182828efc1ab0512 (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.txt71
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
22There are 4 power domains within DAPM 22There 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
71Widgets are usually added in the codec driver and the machine driver. There are 79Widgets can be added to the sound card by any of the component driver types.
72convenience macros defined in soc-dapm.h that can be used to quickly build a 80There are convenience macros defined in soc-dapm.h that can be used to quickly
73list of widgets of the codecs and machines DAPM widgets. 81build a list of widgets of the codecs and machines DAPM widgets.
74 82
75Most widgets have a name, register, shift and invert. Some widgets have extra 83Most widgets have a name, register, shift and invert. Some widgets have extra
76parameters for stream name and kcontrols. 84parameters for stream name and kcontrols.
@@ -80,11 +88,13 @@ parameters for stream name and kcontrols.
80------------------------- 88-------------------------
81 89
82Stream Widgets relate to the stream power domain and only consist of ADCs 90Stream 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),
92AIF IN and AIF OUT.
84 93
85Stream widgets have the following format:- 94Stream widgets have the following format:-
86 95
87SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), 96SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert),
97SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert)
88 98
89NOTE: the stream name must match the corresponding stream name in your codec 99NOTE: the stream name must match the corresponding stream name in your codec
90snd_soc_codec_dai. 100snd_soc_codec_dai.
@@ -94,6 +104,11 @@ e.g. stream widgets for HiFi playback and capture
94SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), 104SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1),
95SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), 105SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1),
96 106
107e.g. stream widgets for AIF
108
109SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
110SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0),
111
97 112
982.2 Path Domain Widgets 1132.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,
121you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same 136you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same
122as for SND_SOC_DAPM_MIXER. 137as for SND_SOC_DAPM_MIXER.
123 138
1242.3 Platform/Machine domain Widgets 139
125----------------------------------- 1402.3 Machine domain Widgets
141--------------------------
126 142
127Machine widgets are different from codec widgets in that they don't have a 143Machine widgets are different from codec widgets in that they don't have a
128codec register bit associated with them. A machine widget is assigned to each 144codec register bit associated with them. A machine widget is assigned to each
129machine audio component (non codec) that can be independently powered. e.g. 145machine audio component (non codec or DSP) that can be independently
146powered. 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)
146SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), 163SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias),
147 164
148 165
1492.4 Codec Domain 1662.4 Codec (BIAS) Domain
150---------------- 167-----------------------
151 168
152The codec power domain has no widgets and is handled by the codecs DAPM event 169The codec bias power domain has no widgets and is handled by the codecs DAPM
153handler. This handler is called when the codec powerstate is changed wrt to any 170event handler. This handler is called when the codec powerstate is changed wrt
154stream event or by kernel PM events. 171to any stream event or by kernel PM events.
155 172
156 173
1572.5 Virtual Widgets 1742.5 Virtual Widgets
@@ -169,15 +186,16 @@ After all the widgets have been defined, they can then be added to the DAPM
169subsystem individually with a call to snd_soc_dapm_new_control(). 186subsystem individually with a call to snd_soc_dapm_new_control().
170 187
171 188
1723. Codec Widget Interconnections 1893. Codec/DSP Widget Interconnections
173================================ 190====================================
174 191
175Widgets are connected to each other within the codec and machine by audio paths 192Widgets are connected to each other within the codec, platform and machine by
176(called interconnections). Each interconnection must be defined in order to 193audio paths (called interconnections). Each interconnection must be defined in
177create a map of all audio paths between widgets. 194order to create a map of all audio paths between widgets.
178 195
179This is easiest with a diagram of the codec (and schematic of the machine audio 196This is easiest with a diagram of the codec or DSP (and schematic of the machine
180system), as it requires joining widgets together via their audio signal paths. 197audio system), as it requires joining widgets together via their audio signal
198paths.
181 199
182e.g., from the WM8731 output mixer (wm8731.c) 200e.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
250When a codec pin is NC it can be marked as not used with a call to 268Endpoints are added to the DAPM graph so that their usage can be determined in
251 269order to save power. e.g. NC codecs pins will be switched OFF, unconnected
252snd_soc_dapm_set_endpoint(codec, "Widget Name", 0); 270jacks can also be switched OFF.
253
254The last argument is 0 for inactive and 1 for active. This way the pin and its
255input widget will never be powered up and consume power.
256
257This also applies to machine widgets. e.g. if a headphone is connected to a
258jack then the jack can be marked active. If the headphone is removed, then
259the headphone jack can be marked inactive.
260 271
261 272
2625 DAPM Widget Events 2735 DAPM Widget Events