diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-01-23 02:41:46 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:30:10 -0500 |
commit | 7c4dbbd87c0dc62849f0f72449464dc37da0a82a (patch) | |
tree | 27ea47730466503e9c4e92bebb7a64a9fb5538ea /Documentation/sound/alsa | |
parent | dca008f367586f73bd1c766836e4f7a38ce9814f (diff) |
[ALSA] ASoC documentation updates
Update the ASoC documentation. Along with minor formatting and grammar
cleanups it moves the ASoC overview into the present tense to reflect
the fact that it has now been merged.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'Documentation/sound/alsa')
-rw-r--r-- | Documentation/sound/alsa/soc/DAI.txt | 6 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/clocking.txt | 10 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/codec.txt | 53 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/dapm.txt | 51 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/machine.txt | 12 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/overview.txt | 42 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/platform.txt | 6 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/pops_clicks.txt | 10 |
8 files changed, 97 insertions, 93 deletions
diff --git a/Documentation/sound/alsa/soc/DAI.txt b/Documentation/sound/alsa/soc/DAI.txt index 3feeb9ecdec4..0ebd7ea9706c 100644 --- a/Documentation/sound/alsa/soc/DAI.txt +++ b/Documentation/sound/alsa/soc/DAI.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | ASoC currently supports the three main Digital Audio Interfaces (DAI) found on | 1 | ASoC currently supports the three main Digital Audio Interfaces (DAI) found on |
2 | SoC controllers and portable audio CODECS today, namely AC97, I2S and PCM. | 2 | SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM. |
3 | 3 | ||
4 | 4 | ||
5 | AC97 | 5 | AC97 |
@@ -25,7 +25,7 @@ left/right clock (LRC) synchronise the link. I2S is flexible in that either the | |||
25 | controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock | 25 | controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock |
26 | usually varies depending on the sample rate and the master system clock | 26 | usually varies depending on the sample rate and the master system clock |
27 | (SYSCLK). LRCLK is the same as the sample rate. A few devices support separate | 27 | (SYSCLK). LRCLK is the same as the sample rate. A few devices support separate |
28 | ADC and DAC LRCLK's, this allows for simultaneous capture and playback at | 28 | ADC and DAC LRCLKs, this allows for simultaneous capture and playback at |
29 | different sample rates. | 29 | different sample rates. |
30 | 30 | ||
31 | I2S has several different operating modes:- | 31 | I2S has several different operating modes:- |
@@ -35,7 +35,7 @@ I2S has several different operating modes:- | |||
35 | 35 | ||
36 | o Left Justified - MSB is transmitted on transition of LRC. | 36 | o Left Justified - MSB is transmitted on transition of LRC. |
37 | 37 | ||
38 | o Right Justified - MSB is transmitted sample size BCLK's before LRC | 38 | o Right Justified - MSB is transmitted sample size BCLKs before LRC |
39 | transition. | 39 | transition. |
40 | 40 | ||
41 | PCM | 41 | PCM |
diff --git a/Documentation/sound/alsa/soc/clocking.txt b/Documentation/sound/alsa/soc/clocking.txt index 14930887c25f..b1300162e01c 100644 --- a/Documentation/sound/alsa/soc/clocking.txt +++ b/Documentation/sound/alsa/soc/clocking.txt | |||
@@ -13,7 +13,7 @@ or SYSCLK). This audio master clock can be derived from a number of sources | |||
13 | (e.g. crystal, PLL, CPU clock) and is responsible for producing the correct | 13 | (e.g. crystal, PLL, CPU clock) and is responsible for producing the correct |
14 | audio playback and capture sample rates. | 14 | audio playback and capture sample rates. |
15 | 15 | ||
16 | Some master clocks (e.g. PLL's and CPU based clocks) are configurable in that | 16 | Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that |
17 | their speed can be altered by software (depending on the system use and to save | 17 | their speed can be altered by software (depending on the system use and to save |
18 | power). Other master clocks are fixed at a set frequency (i.e. crystals). | 18 | power). Other master clocks are fixed at a set frequency (i.e. crystals). |
19 | 19 | ||
@@ -41,11 +41,11 @@ BCLK = LRC * x | |||
41 | BCLK = LRC * Channels * Word Size | 41 | BCLK = LRC * Channels * Word Size |
42 | 42 | ||
43 | This relationship depends on the codec or SoC CPU in particular. In general | 43 | This relationship depends on the codec or SoC CPU in particular. In general |
44 | it's best to configure BCLK to the lowest possible speed (depending on your | 44 | it is best to configure BCLK to the lowest possible speed (depending on your |
45 | rate, number of channels and wordsize) to save on power. | 45 | rate, number of channels and word size) to save on power. |
46 | 46 | ||
47 | It's also desirable to use the codec (if possible) to drive (or master) the | 47 | It is also desirable to use the codec (if possible) to drive (or master) the |
48 | audio clocks as it's usually gives more accurate sample rates than the CPU. | 48 | audio clocks as it usually gives more accurate sample rates than the CPU. |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt index 1e766ad0ebd1..1e95342ed72e 100644 --- a/Documentation/sound/alsa/soc/codec.txt +++ b/Documentation/sound/alsa/soc/codec.txt | |||
@@ -9,7 +9,7 @@ code should be added to the platform and machine drivers respectively. | |||
9 | Each codec driver *must* provide the following features:- | 9 | Each codec driver *must* provide the following features:- |
10 | 10 | ||
11 | 1) Codec DAI and PCM configuration | 11 | 1) Codec DAI and PCM configuration |
12 | 2) Codec control IO - using I2C, 3 Wire(SPI) or both API's | 12 | 2) Codec control IO - using I2C, 3 Wire(SPI) or both APIs |
13 | 3) Mixers and audio controls | 13 | 3) Mixers and audio controls |
14 | 4) Codec audio operations | 14 | 4) Codec audio operations |
15 | 15 | ||
@@ -19,7 +19,7 @@ Optionally, codec drivers can also provide:- | |||
19 | 6) DAPM event handler. | 19 | 6) DAPM event handler. |
20 | 7) DAC Digital mute control. | 20 | 7) DAC Digital mute control. |
21 | 21 | ||
22 | It's probably best to use this guide in conjunction with the existing codec | 22 | Its probably best to use this guide in conjunction with the existing codec |
23 | driver code in sound/soc/codecs/ | 23 | driver code in sound/soc/codecs/ |
24 | 24 | ||
25 | ASoC Codec driver breakdown | 25 | ASoC Codec driver breakdown |
@@ -27,8 +27,8 @@ ASoC Codec driver breakdown | |||
27 | 27 | ||
28 | 1 - Codec DAI and PCM configuration | 28 | 1 - Codec DAI and PCM configuration |
29 | ----------------------------------- | 29 | ----------------------------------- |
30 | Each codec driver must have a struct snd_soc_codec_dai to define it's DAI and | 30 | Each codec driver must have a struct snd_soc_codec_dai to define its DAI and |
31 | PCM's capabilities and operations. This struct is exported so that it can be | 31 | PCM capabilities and operations. This struct is exported so that it can be |
32 | registered with the core by your machine driver. | 32 | registered with the core by your machine driver. |
33 | 33 | ||
34 | e.g. | 34 | e.g. |
@@ -67,18 +67,18 @@ EXPORT_SYMBOL_GPL(wm8731_dai); | |||
67 | 67 | ||
68 | 2 - Codec control IO | 68 | 2 - Codec control IO |
69 | -------------------- | 69 | -------------------- |
70 | The codec can usually be controlled via an I2C or SPI style interface (AC97 | 70 | The codec can usually be controlled via an I2C or SPI style interface |
71 | combines control with data in the DAI). The codec drivers will have to provide | 71 | (AC97 combines control with data in the DAI). The codec drivers provide |
72 | functions to read and write the codec registers along with supplying a register | 72 | functions to read and write the codec registers along with supplying a |
73 | cache:- | 73 | register cache:- |
74 | 74 | ||
75 | /* IO control data and register cache */ | 75 | /* IO control data and register cache */ |
76 | void *control_data; /* codec control (i2c/3wire) data */ | 76 | void *control_data; /* codec control (i2c/3wire) data */ |
77 | void *reg_cache; | 77 | void *reg_cache; |
78 | 78 | ||
79 | Codec read/write should do any data formatting and call the hardware read write | 79 | Codec read/write should do any data formatting and call the hardware |
80 | below to perform the IO. These functions are called by the core and alsa when | 80 | read write below to perform the IO. These functions are called by the |
81 | performing DAPM or changing the mixer:- | 81 | core and ALSA when performing DAPM or changing the mixer:- |
82 | 82 | ||
83 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | 83 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); |
84 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 84 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
@@ -131,7 +131,7 @@ Defines a stereo enumerated control | |||
131 | 131 | ||
132 | 4 - Codec Audio Operations | 132 | 4 - Codec Audio Operations |
133 | -------------------------- | 133 | -------------------------- |
134 | The codec driver also supports the following alsa operations:- | 134 | The codec driver also supports the following ALSA operations:- |
135 | 135 | ||
136 | /* SoC audio ops */ | 136 | /* SoC audio ops */ |
137 | struct snd_soc_ops { | 137 | struct snd_soc_ops { |
@@ -142,15 +142,15 @@ struct snd_soc_ops { | |||
142 | int (*prepare)(struct snd_pcm_substream *); | 142 | int (*prepare)(struct snd_pcm_substream *); |
143 | }; | 143 | }; |
144 | 144 | ||
145 | Please refer to the alsa driver PCM documentation for details. | 145 | Please refer to the ALSA driver PCM documentation for details. |
146 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm | 146 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm |
147 | 147 | ||
148 | 148 | ||
149 | 5 - DAPM description. | 149 | 5 - DAPM description. |
150 | --------------------- | 150 | --------------------- |
151 | The Dynamic Audio Power Management description describes the codec's power | 151 | The Dynamic Audio Power Management description describes the codec power |
152 | components, their relationships and registers to the ASoC core. Please read | 152 | components and their relationships and registers to the ASoC core. |
153 | dapm.txt for details of building the description. | 153 | Please read dapm.txt for details of building the description. |
154 | 154 | ||
155 | Please also see the examples in other codec drivers. | 155 | Please also see the examples in other codec drivers. |
156 | 156 | ||
@@ -158,8 +158,8 @@ Please also see the examples in other codec drivers. | |||
158 | 6 - DAPM event handler | 158 | 6 - DAPM event handler |
159 | ---------------------- | 159 | ---------------------- |
160 | This function is a callback that handles codec domain PM calls and system | 160 | This function is a callback that handles codec domain PM calls and system |
161 | domain PM calls (e.g. suspend and resume). It's used to put the codec to sleep | 161 | domain PM calls (e.g. suspend and resume). It is used to put the codec |
162 | when not in use. | 162 | to sleep when not in use. |
163 | 163 | ||
164 | Power states:- | 164 | Power states:- |
165 | 165 | ||
@@ -175,13 +175,14 @@ Power states:- | |||
175 | SNDRV_CTL_POWER_D3cold: /* Everything Off, without power */ | 175 | SNDRV_CTL_POWER_D3cold: /* Everything Off, without power */ |
176 | 176 | ||
177 | 177 | ||
178 | 7 - Codec DAC digital mute control. | 178 | 7 - Codec DAC digital mute control |
179 | ------------------------------------ | 179 | ---------------------------------- |
180 | Most codecs have a digital mute before the DAC's that can be used to minimise | 180 | Most codecs have a digital mute before the DACs that can be used to |
181 | any system noise. The mute stops any digital data from entering the DAC. | 181 | minimise any system noise. The mute stops any digital data from |
182 | entering the DAC. | ||
182 | 183 | ||
183 | A callback can be created that is called by the core for each codec DAI when the | 184 | A callback can be created that is called by the core for each codec DAI |
184 | mute is applied or freed. | 185 | when the mute is applied or freed. |
185 | 186 | ||
186 | i.e. | 187 | i.e. |
187 | 188 | ||
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index ab0766fd7869..c784a18b94dc 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt | |||
@@ -4,20 +4,20 @@ Dynamic Audio Power Management for Portable Devices | |||
4 | 1. Description | 4 | 1. Description |
5 | ============== | 5 | ============== |
6 | 6 | ||
7 | Dynamic Audio Power Management (DAPM) is designed to allow portable Linux devices | 7 | Dynamic Audio Power Management (DAPM) is designed to allow portable |
8 | to use the minimum amount of power within the audio subsystem at all times. It | 8 | Linux devices to use the minimum amount of power within the audio |
9 | is independent of other kernel PM and as such, can easily co-exist with the | 9 | subsystem at all times. It is independent of other kernel PM and as |
10 | other PM systems. | 10 | such, can easily co-exist with the other PM systems. |
11 | 11 | ||
12 | DAPM is also completely transparent to all user space applications as all power | 12 | DAPM is also completely transparent to all user space applications as |
13 | switching is done within the ASoC core. No code changes or recompiling are | 13 | all power switching is done within the ASoC core. No code changes or |
14 | required for user space applications. DAPM makes power switching decisions based | 14 | recompiling are required for user space applications. DAPM makes power |
15 | upon any audio stream (capture/playback) activity and audio mixer settings | 15 | switching decisions based upon any audio stream (capture/playback) |
16 | within the device. | 16 | activity and audio mixer settings within the device. |
17 | 17 | ||
18 | DAPM spans the whole machine. It covers power control within the entire audio | 18 | DAPM spans the whole machine. It covers power control within the entire |
19 | subsystem, this includes internal codec power blocks and machine level power | 19 | audio subsystem, this includes internal codec power blocks and machine |
20 | systems. | 20 | level power systems. |
21 | 21 | ||
22 | There are 4 power domains within DAPM | 22 | There are 4 power domains within DAPM |
23 | 23 | ||
@@ -34,7 +34,7 @@ There are 4 power domains within DAPM | |||
34 | Automatically set when mixer and mux settings are changed by the user. | 34 | Automatically set when mixer and mux settings are changed by the user. |
35 | e.g. alsamixer, amixer. | 35 | e.g. alsamixer, amixer. |
36 | 36 | ||
37 | 4. Stream domain - DAC's and ADC's. | 37 | 4. Stream domain - DACs and ADCs. |
38 | Enabled and disabled when stream playback/capture is started and | 38 | Enabled and disabled when stream playback/capture is started and |
39 | stopped respectively. e.g. aplay, arecord. | 39 | stopped respectively. e.g. aplay, arecord. |
40 | 40 | ||
@@ -51,7 +51,7 @@ widgets hereafter. | |||
51 | Audio DAPM widgets fall into a number of types:- | 51 | Audio DAPM widgets fall into a number of types:- |
52 | 52 | ||
53 | o Mixer - Mixes several analog signals into a single analog signal. | 53 | o Mixer - Mixes several analog signals into a single analog signal. |
54 | o Mux - An analog switch that outputs only 1 of it's inputs. | 54 | o Mux - An analog switch that outputs only one of many inputs. |
55 | o PGA - A programmable gain amplifier or attenuation widget. | 55 | o PGA - A programmable gain amplifier or attenuation widget. |
56 | o ADC - Analog to Digital Converter | 56 | o ADC - Analog to Digital Converter |
57 | o DAC - Digital to Analog Converter | 57 | o DAC - Digital to Analog Converter |
@@ -78,14 +78,14 @@ parameters for stream name and kcontrols. | |||
78 | 2.1 Stream Domain Widgets | 78 | 2.1 Stream Domain Widgets |
79 | ------------------------- | 79 | ------------------------- |
80 | 80 | ||
81 | Stream Widgets relate to the stream power domain and only consist of ADC's | 81 | Stream Widgets relate to the stream power domain and only consist of ADCs |
82 | (analog to digital converters) and DAC's (digital to analog converters). | 82 | (analog to digital converters) and DACs (digital to analog converters). |
83 | 83 | ||
84 | Stream widgets have the following format:- | 84 | Stream widgets have the following format:- |
85 | 85 | ||
86 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), | 86 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), |
87 | 87 | ||
88 | NOTE: the stream name must match the corresponding stream name in your codecs | 88 | NOTE: the stream name must match the corresponding stream name in your codec |
89 | snd_soc_codec_dai. | 89 | snd_soc_codec_dai. |
90 | 90 | ||
91 | e.g. stream widgets for HiFi playback and capture | 91 | e.g. stream widgets for HiFi playback and capture |
@@ -97,7 +97,7 @@ SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), | |||
97 | 2.2 Path Domain Widgets | 97 | 2.2 Path Domain Widgets |
98 | ----------------------- | 98 | ----------------------- |
99 | 99 | ||
100 | Path domain widgets have a ability to control or effect the audio signal or | 100 | Path domain widgets have a ability to control or affect the audio signal or |
101 | audio paths within the audio subsystem. They have the following form:- | 101 | audio paths within the audio subsystem. They have the following form:- |
102 | 102 | ||
103 | SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) | 103 | SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) |
@@ -149,7 +149,7 @@ SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), | |||
149 | 2.4 Codec Domain | 149 | 2.4 Codec Domain |
150 | ---------------- | 150 | ---------------- |
151 | 151 | ||
152 | The Codec power domain has no widgets and is handled by the codecs DAPM event | 152 | The codec power domain has no widgets and is handled by the codecs DAPM event |
153 | handler. This handler is called when the codec powerstate is changed wrt to any | 153 | handler. This handler is called when the codec powerstate is changed wrt to any |
154 | stream event or by kernel PM events. | 154 | stream event or by kernel PM events. |
155 | 155 | ||
@@ -158,8 +158,8 @@ stream event or by kernel PM events. | |||
158 | ------------------- | 158 | ------------------- |
159 | 159 | ||
160 | Sometimes widgets exist in the codec or machine audio map that don't have any | 160 | Sometimes widgets exist in the codec or machine audio map that don't have any |
161 | corresponding register bit for power control. In this case it's necessary to | 161 | corresponding soft power control. In this case it is necessary to create |
162 | create a virtual widget - a widget with no control bits e.g. | 162 | a virtual widget - a widget with no control bits e.g. |
163 | 163 | ||
164 | SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0), | 164 | SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0), |
165 | 165 | ||
@@ -172,13 +172,14 @@ subsystem individually with a call to snd_soc_dapm_new_control(). | |||
172 | 3. Codec Widget Interconnections | 172 | 3. Codec Widget Interconnections |
173 | ================================ | 173 | ================================ |
174 | 174 | ||
175 | Widgets are connected to each other within the codec and machine by audio | 175 | Widgets are connected to each other within the codec and machine by audio paths |
176 | paths (called interconnections). Each interconnection must be defined in order | 176 | (called interconnections). Each interconnection must be defined in order to |
177 | to create a map of all audio paths between widgets. | 177 | create a map of all audio paths between widgets. |
178 | |||
178 | This is easiest with a diagram of the codec (and schematic of the machine audio | 179 | This is easiest with a diagram of the codec (and schematic of the machine audio |
179 | system), as it requires joining widgets together via their audio signal paths. | 180 | system), as it requires joining widgets together via their audio signal paths. |
180 | 181 | ||
181 | i.e. from the WM8731 codec's output mixer (wm8731.c) | 182 | e.g., from the WM8731 output mixer (wm8731.c) |
182 | 183 | ||
183 | The WM8731 output mixer has 3 inputs (sources) | 184 | The WM8731 output mixer has 3 inputs (sources) |
184 | 185 | ||
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index 72bd222f2a21..f370e7db86af 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt | |||
@@ -16,7 +16,7 @@ struct snd_soc_machine { | |||
16 | int (*remove)(struct platform_device *pdev); | 16 | int (*remove)(struct platform_device *pdev); |
17 | 17 | ||
18 | /* the pre and post PM functions are used to do any PM work before and | 18 | /* the pre and post PM functions are used to do any PM work before and |
19 | * after the codec and DAI's do any PM work. */ | 19 | * after the codec and DAIs do any PM work. */ |
20 | int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); | 20 | int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); |
21 | int (*suspend_post)(struct platform_device *pdev, pm_message_t state); | 21 | int (*suspend_post)(struct platform_device *pdev, pm_message_t state); |
22 | int (*resume_pre)(struct platform_device *pdev); | 22 | int (*resume_pre)(struct platform_device *pdev); |
@@ -38,7 +38,7 @@ probe/remove are optional. Do any machine specific probe here. | |||
38 | suspend()/resume() | 38 | suspend()/resume() |
39 | ------------------ | 39 | ------------------ |
40 | The machine driver has pre and post versions of suspend and resume to take care | 40 | The machine driver has pre and post versions of suspend and resume to take care |
41 | of any machine audio tasks that have to be done before or after the codec, DAI's | 41 | of any machine audio tasks that have to be done before or after the codec, DAIs |
42 | and DMA is suspended and resumed. Optional. | 42 | and DMA is suspended and resumed. Optional. |
43 | 43 | ||
44 | 44 | ||
@@ -49,10 +49,10 @@ The machine specific audio operations can be set here. Again this is optional. | |||
49 | 49 | ||
50 | Machine DAI Configuration | 50 | Machine DAI Configuration |
51 | ------------------------- | 51 | ------------------------- |
52 | The machine DAI configuration glues all the codec and CPU DAI's together. It can | 52 | The machine DAI configuration glues all the codec and CPU DAIs together. It can |
53 | also be used to set up the DAI system clock and for any machine related DAI | 53 | also be used to set up the DAI system clock and for any machine related DAI |
54 | initialisation e.g. the machine audio map can be connected to the codec audio | 54 | initialisation e.g. the machine audio map can be connected to the codec audio |
55 | map, unconnnected codec pins can be set as such. Please see corgi.c, spitz.c | 55 | map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c |
56 | for examples. | 56 | for examples. |
57 | 57 | ||
58 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | 58 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. |
@@ -67,7 +67,7 @@ static struct snd_soc_dai_link corgi_dai = { | |||
67 | .ops = &corgi_ops, | 67 | .ops = &corgi_ops, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct snd_soc_machine then sets up the machine with it's DAI's. e.g. | 70 | struct snd_soc_machine then sets up the machine with it's DAIs. e.g. |
71 | 71 | ||
72 | /* corgi audio machine driver */ | 72 | /* corgi audio machine driver */ |
73 | static struct snd_soc_machine snd_soc_machine_corgi = { | 73 | static struct snd_soc_machine snd_soc_machine_corgi = { |
@@ -110,4 +110,4 @@ details. | |||
110 | Machine Controls | 110 | Machine Controls |
111 | ---------------- | 111 | ---------------- |
112 | 112 | ||
113 | Machine specific audio mixer controls can be added in the dai init function. \ No newline at end of file | 113 | Machine specific audio mixer controls can be added in the DAI init function. |
diff --git a/Documentation/sound/alsa/soc/overview.txt b/Documentation/sound/alsa/soc/overview.txt index c47ce9530677..1e4c6d3655f2 100644 --- a/Documentation/sound/alsa/soc/overview.txt +++ b/Documentation/sound/alsa/soc/overview.txt | |||
@@ -1,25 +1,26 @@ | |||
1 | ALSA SoC Layer | 1 | ALSA SoC Layer |
2 | ============== | 2 | ============== |
3 | 3 | ||
4 | The overall project goal of the ALSA System on Chip (ASoC) layer is to provide | 4 | The overall project goal of the ALSA System on Chip (ASoC) layer is to |
5 | better ALSA support for embedded system-on-chip processors (e.g. pxa2xx, au1x00, | 5 | provide better ALSA support for embedded system-on-chip processors (e.g. |
6 | iMX, etc) and portable audio codecs. Currently there is some support in the | 6 | pxa2xx, au1x00, iMX, etc) and portable audio codecs. Prior to the ASoC |
7 | kernel for SoC audio, however it has some limitations:- | 7 | subsystem there was some support in the kernel for SoC audio, however it |
8 | had some limitations:- | ||
8 | 9 | ||
9 | * Currently, codec drivers are often tightly coupled to the underlying SoC | 10 | * Codec drivers were often tightly coupled to the underlying SoC |
10 | CPU. This is not ideal and leads to code duplication i.e. Linux now has 4 | 11 | CPU. This is not ideal and leads to code duplication - for example, |
11 | different wm8731 drivers for 4 different SoC platforms. | 12 | Linux had different wm8731 drivers for 4 different SoC platforms. |
12 | 13 | ||
13 | * There is no standard method to signal user initiated audio events (e.g. | 14 | * There was no standard method to signal user initiated audio events (e.g. |
14 | Headphone/Mic insertion, Headphone/Mic detection after an insertion | 15 | Headphone/Mic insertion, Headphone/Mic detection after an insertion |
15 | event). These are quite common events on portable devices and often require | 16 | event). These are quite common events on portable devices and often require |
16 | machine specific code to re-route audio, enable amps, etc., after such an | 17 | machine specific code to re-route audio, enable amps, etc., after such an |
17 | event. | 18 | event. |
18 | 19 | ||
19 | * Current drivers tend to power up the entire codec when playing | 20 | * Drivers tended to power up the entire codec when playing (or |
20 | (or recording) audio. This is fine for a PC, but tends to waste a lot of | 21 | recording) audio. This is fine for a PC, but tends to waste a lot of |
21 | power on portable devices. There is also no support for saving power via | 22 | power on portable devices. There was also no support for saving |
22 | changing codec oversampling rates, bias currents, etc. | 23 | power via changing codec oversampling rates, bias currents, etc. |
23 | 24 | ||
24 | 25 | ||
25 | ASoC Design | 26 | ASoC Design |
@@ -31,12 +32,13 @@ features :- | |||
31 | * Codec independence. Allows reuse of codec drivers on other platforms | 32 | * Codec independence. Allows reuse of codec drivers on other platforms |
32 | and machines. | 33 | and machines. |
33 | 34 | ||
34 | * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC interface | 35 | * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC |
35 | and codec registers it's audio interface capabilities with the core and are | 36 | interface and codec registers it's audio interface capabilities with the |
36 | subsequently matched and configured when the application hw params are known. | 37 | core and are subsequently matched and configured when the application |
38 | hardware parameters are known. | ||
37 | 39 | ||
38 | * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to | 40 | * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to |
39 | it's minimum power state at all times. This includes powering up/down | 41 | its minimum power state at all times. This includes powering up/down |
40 | internal power blocks depending on the internal codec audio routing and any | 42 | internal power blocks depending on the internal codec audio routing and any |
41 | active streams. | 43 | active streams. |
42 | 44 | ||
@@ -45,16 +47,16 @@ features :- | |||
45 | signals the codec when to change power states. | 47 | signals the codec when to change power states. |
46 | 48 | ||
47 | * Machine specific controls: Allow machines to add controls to the sound card | 49 | * Machine specific controls: Allow machines to add controls to the sound card |
48 | (e.g. volume control for speaker amp). | 50 | (e.g. volume control for speaker amplifier). |
49 | 51 | ||
50 | To achieve all this, ASoC basically splits an embedded audio system into 3 | 52 | To achieve all this, ASoC basically splits an embedded audio system into 3 |
51 | components :- | 53 | components :- |
52 | 54 | ||
53 | * Codec driver: The codec driver is platform independent and contains audio | 55 | * Codec driver: The codec driver is platform independent and contains audio |
54 | controls, audio interface capabilities, codec dapm definition and codec IO | 56 | controls, audio interface capabilities, codec DAPM definition and codec IO |
55 | functions. | 57 | functions. |
56 | 58 | ||
57 | * Platform driver: The platform driver contains the audio dma engine and audio | 59 | * Platform driver: The platform driver contains the audio DMA engine and audio |
58 | interface drivers (e.g. I2S, AC97, PCM) for that platform. | 60 | interface drivers (e.g. I2S, AC97, PCM) for that platform. |
59 | 61 | ||
60 | * Machine driver: The machine driver handles any machine specific controls and | 62 | * Machine driver: The machine driver handles any machine specific controls and |
@@ -81,4 +83,4 @@ machine.txt: Machine driver internals. | |||
81 | 83 | ||
82 | pop_clicks.txt: How to minimise audio artifacts. | 84 | pop_clicks.txt: How to minimise audio artifacts. |
83 | 85 | ||
84 | clocking.txt: ASoC clocking for best power performance. \ No newline at end of file | 86 | clocking.txt: ASoC clocking for best power performance. |
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt index d4678b4dc6c6..b681d17fc388 100644 --- a/Documentation/sound/alsa/soc/platform.txt +++ b/Documentation/sound/alsa/soc/platform.txt | |||
@@ -8,7 +8,7 @@ specific code. | |||
8 | Audio DMA | 8 | Audio DMA |
9 | ========= | 9 | ========= |
10 | 10 | ||
11 | The platform DMA driver optionally supports the following alsa operations:- | 11 | The platform DMA driver optionally supports the following ALSA operations:- |
12 | 12 | ||
13 | /* SoC audio ops */ | 13 | /* SoC audio ops */ |
14 | struct snd_soc_ops { | 14 | struct snd_soc_ops { |
@@ -38,7 +38,7 @@ struct snd_soc_platform { | |||
38 | struct snd_pcm_ops *pcm_ops; | 38 | struct snd_pcm_ops *pcm_ops; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | Please refer to the alsa driver documentation for details of audio DMA. | 41 | Please refer to the ALSA driver documentation for details of audio DMA. |
42 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm | 42 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm |
43 | 43 | ||
44 | An example DMA driver is soc/pxa/pxa2xx-pcm.c | 44 | An example DMA driver is soc/pxa/pxa2xx-pcm.c |
@@ -52,7 +52,7 @@ Each SoC DAI driver must provide the following features:- | |||
52 | 1) Digital audio interface (DAI) description | 52 | 1) Digital audio interface (DAI) description |
53 | 2) Digital audio interface configuration | 53 | 2) Digital audio interface configuration |
54 | 3) PCM's description | 54 | 3) PCM's description |
55 | 4) Sysclk configuration | 55 | 4) SYSCLK configuration |
56 | 5) Suspend and resume (optional) | 56 | 5) Suspend and resume (optional) |
57 | 57 | ||
58 | Please see codec.txt for a description of items 1 - 4. | 58 | Please see codec.txt for a description of items 1 - 4. |
diff --git a/Documentation/sound/alsa/soc/pops_clicks.txt b/Documentation/sound/alsa/soc/pops_clicks.txt index 3371bd9d7cfa..e1e74daa4497 100644 --- a/Documentation/sound/alsa/soc/pops_clicks.txt +++ b/Documentation/sound/alsa/soc/pops_clicks.txt | |||
@@ -15,11 +15,11 @@ click every time a component power state is changed. | |||
15 | Minimising Playback Pops and Clicks | 15 | Minimising Playback Pops and Clicks |
16 | =================================== | 16 | =================================== |
17 | 17 | ||
18 | Playback pops in portable audio subsystems cannot be completely eliminated atm, | 18 | Playback pops in portable audio subsystems cannot be completely eliminated |
19 | however future audio codec hardware will have better pop and click suppression. | 19 | currently, however future audio codec hardware will have better pop and click |
20 | Pops can be reduced within playback by powering the audio components in a | 20 | suppression. Pops can be reduced within playback by powering the audio |
21 | specific order. This order is different for startup and shutdown and follows | 21 | components in a specific order. This order is different for startup and |
22 | some basic rules:- | 22 | shutdown and follows some basic rules:- |
23 | 23 | ||
24 | Startup Order :- DAC --> Mixers --> Output PGA --> Digital Unmute | 24 | Startup Order :- DAC --> Mixers --> Output PGA --> Digital Unmute |
25 | 25 | ||