aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2013-09-20 13:19:05 -0400
committerMark Brown <broonie@linaro.org>2013-09-23 07:06:24 -0400
commitda5feefeda496f003a2e909762e72843cb9837a6 (patch)
tree290c09b744d0f7d759235799e0be2f3c9609a4da /Documentation/sound/alsa
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
ASoC: Docs: Update codec documentation
Update the codec class driver documentation and bring it up to date with the current code base. This includes API changes, regmap and multi component. 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/codec.txt46
1 files changed, 15 insertions, 31 deletions
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 {