aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-24 06:24:05 -0400
committerMark Brown <broonie@linaro.org>2013-10-24 06:24:05 -0400
commit9f7a949fb909b017e054574c96c4ebb44f5ff3fa (patch)
tree58aa069ba011a9ef626f30a61cfcdd1ac520b1b8 /Documentation/sound
parent70e0db2f7434961c778466708c032e76775b7f1e (diff)
parent469b7bc4e6dbfdb173f0901f746e9277f6740ba7 (diff)
Merge remote-tracking branch 'asoc/topic/doc' into asoc-next
Diffstat (limited to 'Documentation/sound')
-rw-r--r--Documentation/sound/alsa/soc/DPCM.txt380
-rw-r--r--Documentation/sound/alsa/soc/codec.txt46
-rw-r--r--Documentation/sound/alsa/soc/dapm.txt71
-rw-r--r--Documentation/sound/alsa/soc/machine.txt6
-rw-r--r--Documentation/sound/alsa/soc/platform.txt19
5 files changed, 456 insertions, 66 deletions
diff --git a/Documentation/sound/alsa/soc/DPCM.txt b/Documentation/sound/alsa/soc/DPCM.txt
new file mode 100644
index 000000000000..aa8546f2d144
--- /dev/null
+++ b/Documentation/sound/alsa/soc/DPCM.txt
@@ -0,0 +1,380 @@
1Dynamic PCM
2===========
3
41. Description
5==============
6
7Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to
8various digital endpoints during the PCM stream runtime. e.g. PCM0 can route
9digital audio to I2S DAI0, I2S DAI1 or PDM DAI2. This is useful for on SoC DSP
10drivers that expose several ALSA PCMs and can route to multiple DAIs.
11
12The DPCM runtime routing is determined by the ALSA mixer settings in the same
13way as the analog signal is routed in an ASoC codec driver. DPCM uses a DAPM
14graph representing the DSP internal audio paths and uses the mixer settings to
15determine the patch used by each ALSA PCM.
16
17DPCM re-uses all the existing component codec, platform and DAI drivers without
18any modifications.
19
20
21Phone Audio System with SoC based DSP
22-------------------------------------
23
24Consider the following phone audio subsystem. This will be used in this
25document for all examples :-
26
27| Front End PCMs | SoC DSP | Back End DAIs | Audio devices |
28
29 *************
30PCM0 <------------> * * <----DAI0-----> Codec Headset
31 * *
32PCM1 <------------> * * <----DAI1-----> Codec Speakers
33 * DSP *
34PCM2 <------------> * * <----DAI2-----> MODEM
35 * *
36PCM3 <------------> * * <----DAI3-----> BT
37 * *
38 * * <----DAI4-----> DMIC
39 * *
40 * * <----DAI5-----> FM
41 *************
42
43This diagram shows a simple smart phone audio subsystem. It supports Bluetooth,
44FM digital radio, Speakers, Headset Jack, digital microphones and cellular
45modem. This sound card exposes 4 DSP front end (FE) ALSA PCM devices and
46supports 6 back end (BE) DAIs. Each FE PCM can digitally route audio data to any
47of the BE DAIs. The FE PCM devices can also route audio to more than 1 BE DAI.
48
49
50
51Example - DPCM Switching playback from DAI0 to DAI1
52---------------------------------------------------
53
54Audio is being played to the Headset. After a while the user removes the headset
55and audio continues playing on the speakers.
56
57Playback on PCM0 to Headset would look like :-
58
59 *************
60PCM0 <============> * * <====DAI0=====> Codec Headset
61 * *
62PCM1 <------------> * * <----DAI1-----> Codec Speakers
63 * DSP *
64PCM2 <------------> * * <----DAI2-----> MODEM
65 * *
66PCM3 <------------> * * <----DAI3-----> BT
67 * *
68 * * <----DAI4-----> DMIC
69 * *
70 * * <----DAI5-----> FM
71 *************
72
73The headset is removed from the jack by user so the speakers must now be used :-
74
75 *************
76PCM0 <============> * * <----DAI0-----> Codec Headset
77 * *
78PCM1 <------------> * * <====DAI1=====> Codec Speakers
79 * DSP *
80PCM2 <------------> * * <----DAI2-----> MODEM
81 * *
82PCM3 <------------> * * <----DAI3-----> BT
83 * *
84 * * <----DAI4-----> DMIC
85 * *
86 * * <----DAI5-----> FM
87 *************
88
89The audio driver processes this as follows :-
90
91 1) Machine driver receives Jack removal event.
92
93 2) Machine driver OR audio HAL disables the Headset path.
94
95 3) DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0
96 for headset since the path is now disabled.
97
98 4) Machine driver or audio HAL enables the speaker path.
99
100 5) DPCM runs the PCM ops for startup(), hw_params(), prepapre() and
101 trigger(start) for DAI1 Speakers since the path is enabled.
102
103In this example, the machine driver or userspace audio HAL can alter the routing
104and then DPCM will take care of managing the DAI PCM operations to either bring
105the link up or down. Audio playback does not stop during this transition.
106
107
108
109DPCM machine driver
110===================
111
112The DPCM enabled ASoC machine driver is similar to normal machine drivers
113except that we also have to :-
114
115 1) Define the FE and BE DAI links.
116
117 2) Define any FE/BE PCM operations.
118
119 3) Define widget graph connections.
120
121
1221 FE and BE DAI links
123---------------------
124
125| Front End PCMs | SoC DSP | Back End DAIs | Audio devices |
126
127 *************
128PCM0 <------------> * * <----DAI0-----> Codec Headset
129 * *
130PCM1 <------------> * * <----DAI1-----> Codec Speakers
131 * DSP *
132PCM2 <------------> * * <----DAI2-----> MODEM
133 * *
134PCM3 <------------> * * <----DAI3-----> BT
135 * *
136 * * <----DAI4-----> DMIC
137 * *
138 * * <----DAI5-----> FM
139 *************
140
141For the example above we have to define 4 FE DAI links and 6 BE DAI links. The
142FE DAI links are defined as follows :-
143
144static struct snd_soc_dai_link machine_dais[] = {
145 {
146 .name = "PCM0 System",
147 .stream_name = "System Playback",
148 .cpu_dai_name = "System Pin",
149 .platform_name = "dsp-audio",
150 .codec_name = "snd-soc-dummy",
151 .codec_dai_name = "snd-soc-dummy-dai",
152 .dynamic = 1,
153 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
154 .dpcm_playback = 1,
155 },
156 .....< other FE and BE DAI links here >
157};
158
159This FE DAI link is pretty similar to a regular DAI link except that we also
160set the DAI link to a DPCM FE with the "dynamic = 1". The supported FE stream
161directions should also be set with the "dpcm_playback" and "dpcm_capture"
162flags. There is also an option to specify the ordering of the trigger call for
163each FE. This allows the ASoC core to trigger the DSP before or after the other
164components (as some DSPs have strong requirements for the ordering DAI/DSP
165start and stop sequences).
166
167The FE DAI above sets the codec and code DAIs to dummy devices since the BE is
168dynamic and will change depending on runtime config.
169
170The BE DAIs are configured as follows :-
171
172static struct snd_soc_dai_link machine_dais[] = {
173 .....< FE DAI links here >
174 {
175 .name = "Codec Headset",
176 .cpu_dai_name = "ssp-dai.0",
177 .platform_name = "snd-soc-dummy",
178 .no_pcm = 1,
179 .codec_name = "rt5640.0-001c",
180 .codec_dai_name = "rt5640-aif1",
181 .ignore_suspend = 1,
182 .ignore_pmdown_time = 1,
183 .be_hw_params_fixup = hswult_ssp0_fixup,
184 .ops = &haswell_ops,
185 .dpcm_playback = 1,
186 .dpcm_capture = 1,
187 },
188 .....< other BE DAI links here >
189};
190
191This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
192the "no_pcm" flag to mark it has a BE and sets flags for supported stream
193directions using "dpcm_playback" and "dpcm_capture" above.
194
195The BE has also flags set for ignoreing suspend and PM down time. This allows
196the BE to work in a hostless mode where the host CPU is not transferring data
197like a BT phone call :-
198
199 *************
200PCM0 <------------> * * <----DAI0-----> Codec Headset
201 * *
202PCM1 <------------> * * <----DAI1-----> Codec Speakers
203 * DSP *
204PCM2 <------------> * * <====DAI2=====> MODEM
205 * *
206PCM3 <------------> * * <====DAI3=====> BT
207 * *
208 * * <----DAI4-----> DMIC
209 * *
210 * * <----DAI5-----> FM
211 *************
212
213This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are
214still in operation.
215
216A BE DAI link can also set the codec to a dummy device if the code is a device
217that is managed externally.
218
219Likewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the
220DSP firmware.
221
222
2232 FE/BE PCM operations
224----------------------
225
226The BE above also exports some PCM operations and a "fixup" callback. The fixup
227callback is used by the machine driver to (re)configure the DAI based upon the
228FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE.
229
230e.g. DSP converts all FE hw params to run at fixed rate of 48k, 16bit, stereo for
231DAI0. This means all FE hw_params have to be fixed in the machine driver for
232DAI0 so that the DAI is running at desired configuration regardless of the FE
233configuration.
234
235static int dai0_fixup(struct snd_soc_pcm_runtime *rtd,
236 struct snd_pcm_hw_params *params)
237{
238 struct snd_interval *rate = hw_param_interval(params,
239 SNDRV_PCM_HW_PARAM_RATE);
240 struct snd_interval *channels = hw_param_interval(params,
241 SNDRV_PCM_HW_PARAM_CHANNELS);
242
243 /* The DSP will covert the FE rate to 48k, stereo */
244 rate->min = rate->max = 48000;
245 channels->min = channels->max = 2;
246
247 /* set DAI0 to 16 bit */
248 snd_mask_set(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT -
249 SNDRV_PCM_HW_PARAM_FIRST_MASK],
250 SNDRV_PCM_FORMAT_S16_LE);
251 return 0;
252}
253
254The other PCM operation are the same as for regular DAI links. Use as necessary.
255
256
2573 Widget graph connections
258--------------------------
259
260The BE DAI links will normally be connected to the graph at initialisation time
261by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this
262has to be set explicitly in the driver :-
263
264/* BE for codec Headset - DAI0 is dummy and managed by DSP FW */
265{"DAI0 CODEC IN", NULL, "AIF1 Capture"},
266{"AIF1 Playback", NULL, "DAI0 CODEC OUT"},
267
268
269Writing a DPCM DSP driver
270=========================
271
272The DPCM DSP driver looks much like a standard platform class ASoC driver
273combined with elements from a codec class driver. A DSP platform driver must
274implement :-
275
276 1) Front End PCM DAIs - i.e. struct snd_soc_dai_driver.
277
278 2) DAPM graph showing DSP audio routing from FE DAIs to BEs.
279
280 3) DAPM widgets from DSP graph.
281
282 4) Mixers for gains, routing, etc.
283
284 5) DMA configuration.
285
286 6) BE AIF widgets.
287
288Items 6 is important for routing the audio outside of the DSP. AIF need to be
289defined for each BE and each stream direction. e.g for BE DAI0 above we would
290have :-
291
292SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0),
293SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0),
294
295The BE AIF are used to connect the DSP graph to the graphs for the other
296component drivers (e.g. codec graph).
297
298
299Hostless PCM streams
300====================
301
302A hostless PCM stream is a stream that is not routed through the host CPU. An
303example of this would be a phone call from handset to modem.
304
305
306 *************
307PCM0 <------------> * * <----DAI0-----> Codec Headset
308 * *
309PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic
310 * DSP *
311PCM2 <------------> * * <====DAI2=====> MODEM
312 * *
313PCM3 <------------> * * <----DAI3-----> BT
314 * *
315 * * <----DAI4-----> DMIC
316 * *
317 * * <----DAI5-----> FM
318 *************
319
320In this case the PCM data is routed via the DSP. The host CPU in this use case
321is only used for control and can sleep during the runtime of the stream.
322
323The host can control the hostless link either by :-
324
325 1) Configuring the link as a CODEC <-> CODEC style link. In this case the link
326 is enabled or disabled by the state of the DAPM graph. This usually means
327 there is a mixer control that can be used to connect or disconnect the path
328 between both DAIs.
329
330 2) Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM
331 graph. Control is then carried out by the FE as regualar PCM operations.
332 This method gives more control over the DAI links, but requires much more
333 userspace code to control the link. Its recommended to use CODEC<->CODEC
334 unless your HW needs more fine grained sequencing of the PCM ops.
335
336
337CODEC <-> CODEC link
338--------------------
339
340This DAI link is enabled when DAPM detects a valid path within the DAPM graph.
341The machine driver sets some additional parameters to the DAI link i.e.
342
343static const struct snd_soc_pcm_stream dai_params = {
344 .formats = SNDRV_PCM_FMTBIT_S32_LE,
345 .rate_min = 8000,
346 .rate_max = 8000,
347 .channels_min = 2,
348 .channels_max = 2,
349};
350
351static struct snd_soc_dai_link dais[] = {
352 < ... more DAI links above ... >
353 {
354 .name = "MODEM",
355 .stream_name = "MODEM",
356 .cpu_dai_name = "dai2",
357 .codec_dai_name = "modem-aif1",
358 .codec_name = "modem",
359 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
360 | SND_SOC_DAIFMT_CBM_CFM,
361 .params = &dai_params,
362 }
363 < ... more DAI links here ... >
364
365These parameters are used to configure the DAI hw_params() when DAPM detects a
366valid path and then calls the PCM operations to start the link. DAPM will also
367call the appropriate PCM operations to disable the DAI when the path is no
368longer valid.
369
370
371Hostless FE
372-----------
373
374The DAI link(s) are enabled by a FE that does not read or write any PCM data.
375This means creating a new FE that is connected with a virtual path to both
376DAI links. The DAI links will be started when the FE PCM is started and stopped
377when the FE PCM is stopped. Note that the FE PCM cannot read or write data in
378this configuration.
379
380
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt
index bce23a4a7875..db5f9c9ae149 100644
--- a/Documentation/sound/alsa/soc/codec.txt
+++ b/Documentation/sound/alsa/soc/codec.txt
@@ -1,22 +1,23 @@
1ASoC Codec Driver 1ASoC Codec Class Driver
2================= 2=======================
3 3
4The codec driver is generic and hardware independent code that configures the 4The codec class driver is generic and hardware independent code that configures
5codec to provide audio capture and playback. It should contain no code that is 5the codec, FM, MODEM, BT or external DSP to provide audio capture and playback.
6specific to the target platform or machine. All platform and machine specific 6It should contain no code that is specific to the target platform or machine.
7code should be added to the platform and machine drivers respectively. 7All platform and machine specific code should be added to the platform and
8machine drivers respectively.
8 9
9Each codec driver *must* provide the following features:- 10Each codec class driver *must* provide the following features:-
10 11
11 1) Codec DAI and PCM configuration 12 1) Codec DAI and PCM configuration
12 2) Codec control IO - using I2C, 3 Wire(SPI) or both APIs 13 2) Codec control IO - using RegMap API
13 3) Mixers and audio controls 14 3) Mixers and audio controls
14 4) Codec audio operations 15 4) Codec audio operations
16 5) DAPM description.
17 6) DAPM event handler.
15 18
16Optionally, codec drivers can also provide:- 19Optionally, codec drivers can also provide:-
17 20
18 5) DAPM description.
19 6) DAPM event handler.
20 7) DAC Digital mute control. 21 7) DAC Digital mute control.
21 22
22Its probably best to use this guide in conjunction with the existing codec 23Its probably best to use this guide in conjunction with the existing codec
@@ -64,26 +65,9 @@ struct snd_soc_dai_driver wm8731_dai = {
642 - Codec control IO 652 - Codec control IO
65-------------------- 66--------------------
66The codec can usually be controlled via an I2C or SPI style interface 67The codec can usually be controlled via an I2C or SPI style interface
67(AC97 combines control with data in the DAI). The codec drivers provide 68(AC97 combines control with data in the DAI). The codec driver should use the
68functions to read and write the codec registers along with supplying a 69Regmap API for all codec IO. Please see include/linux/regmap.h and existing
69register cache:- 70codec drivers for example regmap usage.
70
71 /* IO control data and register cache */
72 void *control_data; /* codec control (i2c/3wire) data */
73 void *reg_cache;
74
75Codec read/write should do any data formatting and call the hardware
76read write below to perform the IO. These functions are called by the
77core and ALSA when performing DAPM or changing the mixer:-
78
79 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
80 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
81
82Codec hardware IO functions - usually points to either the I2C, SPI or AC97
83read/write:-
84
85 hw_write_t hw_write;
86 hw_read_t hw_read;
87 71
88 72
893 - Mixers and audio controls 733 - Mixers and audio controls
@@ -127,7 +111,7 @@ Defines a stereo enumerated control
127 111
1284 - Codec Audio Operations 1124 - Codec Audio Operations
129-------------------------- 113--------------------------
130The codec driver also supports the following ALSA operations:- 114The codec driver also supports the following ALSA PCM operations:-
131 115
132/* SoC audio ops */ 116/* SoC audio ops */
133struct snd_soc_ops { 117struct snd_soc_ops {
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
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt
index d50c14df3411..74056dba52be 100644
--- a/Documentation/sound/alsa/soc/machine.txt
+++ b/Documentation/sound/alsa/soc/machine.txt
@@ -1,8 +1,10 @@
1ASoC Machine Driver 1ASoC Machine Driver
2=================== 2===================
3 3
4The ASoC machine (or board) driver is the code that glues together the platform 4The ASoC machine (or board) driver is the code that glues together all the
5and codec drivers. 5component drivers (e.g. codecs, platforms and DAIs). It also describes the
6relationships between each componnent which include audio paths, GPIOs,
7interrupts, clocking, jacks and voltage regulators.
6 8
7The machine driver can contain codec and platform specific code. It registers 9The machine driver can contain codec and platform specific code. It registers
8the audio subsystem with the kernel as a platform device and is represented by 10the audio subsystem with the kernel as a platform device and is represented by
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt
index d57efad37e0a..3a08a2c9150c 100644
--- a/Documentation/sound/alsa/soc/platform.txt
+++ b/Documentation/sound/alsa/soc/platform.txt
@@ -1,9 +1,9 @@
1ASoC Platform Driver 1ASoC Platform Driver
2==================== 2====================
3 3
4An ASoC platform driver can be divided into audio DMA and SoC DAI configuration 4An ASoC platform driver class can be divided into audio DMA drivers, SoC DAI
5and control. The platform drivers only target the SoC CPU and must have no board 5drivers and DSP drivers. The platform drivers only target the SoC CPU and must
6specific code. 6have no board specific code.
7 7
8Audio DMA 8Audio DMA
9========= 9=========
@@ -64,3 +64,16 @@ Each SoC DAI driver must provide the following features:-
64 5) Suspend and resume (optional) 64 5) Suspend and resume (optional)
65 65
66Please see codec.txt for a description of items 1 - 4. 66Please see codec.txt for a description of items 1 - 4.
67
68
69SoC DSP Drivers
70===============
71
72Each SoC DSP driver usually supplies the following features :-
73
74 1) DAPM graph
75 2) Mixer controls
76 3) DMA IO to/from DSP buffers (if applicable)
77 4) Definition of DSP front end (FE) PCM devices.
78
79Please see DPCM.txt for a description of item 4.