diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2013-09-20 13:19:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-23 07:06:24 -0400 |
commit | da5feefeda496f003a2e909762e72843cb9837a6 (patch) | |
tree | 290c09b744d0f7d759235799e0be2f3c9609a4da /Documentation/sound/alsa | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (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.txt | 46 |
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 @@ | |||
1 | ASoC Codec Driver | 1 | ASoC Codec Class Driver |
2 | ================= | 2 | ======================= |
3 | 3 | ||
4 | The codec driver is generic and hardware independent code that configures the | 4 | The codec class driver is generic and hardware independent code that configures |
5 | codec to provide audio capture and playback. It should contain no code that is | 5 | the codec, FM, MODEM, BT or external DSP to provide audio capture and playback. |
6 | specific to the target platform or machine. All platform and machine specific | 6 | It should contain no code that is specific to the target platform or machine. |
7 | code should be added to the platform and machine drivers respectively. | 7 | All platform and machine specific code should be added to the platform and |
8 | machine drivers respectively. | ||
8 | 9 | ||
9 | Each codec driver *must* provide the following features:- | 10 | Each 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 | ||
16 | Optionally, codec drivers can also provide:- | 19 | Optionally, 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 | ||
22 | Its probably best to use this guide in conjunction with the existing codec | 23 | Its probably best to use this guide in conjunction with the existing codec |
@@ -64,26 +65,9 @@ struct snd_soc_dai_driver wm8731_dai = { | |||
64 | 2 - Codec control IO | 65 | 2 - Codec control IO |
65 | -------------------- | 66 | -------------------- |
66 | The codec can usually be controlled via an I2C or SPI style interface | 67 | The 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 |
68 | functions to read and write the codec registers along with supplying a | 69 | Regmap API for all codec IO. Please see include/linux/regmap.h and existing |
69 | register cache:- | 70 | codec 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 | |||
75 | Codec read/write should do any data formatting and call the hardware | ||
76 | read write below to perform the IO. These functions are called by the | ||
77 | core 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 | |||
82 | Codec hardware IO functions - usually points to either the I2C, SPI or AC97 | ||
83 | read/write:- | ||
84 | |||
85 | hw_write_t hw_write; | ||
86 | hw_read_t hw_read; | ||
87 | 71 | ||
88 | 72 | ||
89 | 3 - Mixers and audio controls | 73 | 3 - Mixers and audio controls |
@@ -127,7 +111,7 @@ Defines a stereo enumerated control | |||
127 | 111 | ||
128 | 4 - Codec Audio Operations | 112 | 4 - Codec Audio Operations |
129 | -------------------------- | 113 | -------------------------- |
130 | The codec driver also supports the following ALSA operations:- | 114 | The codec driver also supports the following ALSA PCM operations:- |
131 | 115 | ||
132 | /* SoC audio ops */ | 116 | /* SoC audio ops */ |
133 | struct snd_soc_ops { | 117 | struct snd_soc_ops { |