aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa/soc/codec.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/sound/alsa/soc/codec.txt')
-rw-r--r--Documentation/sound/alsa/soc/codec.txt53
1 files changed, 27 insertions, 26 deletions
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.
9Each codec driver *must* provide the following features:- 9Each 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
22It's probably best to use this guide in conjunction with the existing codec 22Its probably best to use this guide in conjunction with the existing codec
23driver code in sound/soc/codecs/ 23driver code in sound/soc/codecs/
24 24
25ASoC Codec driver breakdown 25ASoC Codec driver breakdown
@@ -27,8 +27,8 @@ ASoC Codec driver breakdown
27 27
281 - Codec DAI and PCM configuration 281 - Codec DAI and PCM configuration
29----------------------------------- 29-----------------------------------
30Each codec driver must have a struct snd_soc_codec_dai to define it's DAI and 30Each codec driver must have a struct snd_soc_codec_dai to define its DAI and
31PCM's capabilities and operations. This struct is exported so that it can be 31PCM capabilities and operations. This struct is exported so that it can be
32registered with the core by your machine driver. 32registered with the core by your machine driver.
33 33
34e.g. 34e.g.
@@ -67,18 +67,18 @@ EXPORT_SYMBOL_GPL(wm8731_dai);
67 67
682 - Codec control IO 682 - Codec control IO
69-------------------- 69--------------------
70The codec can usually be controlled via an I2C or SPI style interface (AC97 70The codec can usually be controlled via an I2C or SPI style interface
71combines 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
72functions to read and write the codec registers along with supplying a register 72functions to read and write the codec registers along with supplying a
73cache:- 73register 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
79Codec read/write should do any data formatting and call the hardware read write 79Codec read/write should do any data formatting and call the hardware
80below to perform the IO. These functions are called by the core and alsa when 80read write below to perform the IO. These functions are called by the
81performing DAPM or changing the mixer:- 81core 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
1324 - Codec Audio Operations 1324 - Codec Audio Operations
133-------------------------- 133--------------------------
134The codec driver also supports the following alsa operations:- 134The codec driver also supports the following ALSA operations:-
135 135
136/* SoC audio ops */ 136/* SoC audio ops */
137struct snd_soc_ops { 137struct 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
145Please refer to the alsa driver PCM documentation for details. 145Please refer to the ALSA driver PCM documentation for details.
146http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm 146http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm
147 147
148 148
1495 - DAPM description. 1495 - DAPM description.
150--------------------- 150---------------------
151The Dynamic Audio Power Management description describes the codec's power 151The Dynamic Audio Power Management description describes the codec power
152components, their relationships and registers to the ASoC core. Please read 152components and their relationships and registers to the ASoC core.
153dapm.txt for details of building the description. 153Please read dapm.txt for details of building the description.
154 154
155Please also see the examples in other codec drivers. 155Please also see the examples in other codec drivers.
156 156
@@ -158,8 +158,8 @@ Please also see the examples in other codec drivers.
1586 - DAPM event handler 1586 - DAPM event handler
159---------------------- 159----------------------
160This function is a callback that handles codec domain PM calls and system 160This function is a callback that handles codec domain PM calls and system
161domain PM calls (e.g. suspend and resume). It's used to put the codec to sleep 161domain PM calls (e.g. suspend and resume). It is used to put the codec
162when not in use. 162to sleep when not in use.
163 163
164Power states:- 164Power 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
1787 - Codec DAC digital mute control. 1787 - Codec DAC digital mute control
179------------------------------------ 179----------------------------------
180Most codecs have a digital mute before the DAC's that can be used to minimise 180Most codecs have a digital mute before the DACs that can be used to
181any system noise. The mute stops any digital data from entering the DAC. 181minimise any system noise. The mute stops any digital data from
182entering the DAC.
182 183
183A callback can be created that is called by the core for each codec DAI when the 184A callback can be created that is called by the core for each codec DAI
184mute is applied or freed. 185when the mute is applied or freed.
185 186
186i.e. 187i.e.
187 188