Skip to content

Commit da5feef

Browse files
lrgirdwobroonie
authored andcommitted
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>
1 parent 272b98c commit da5feef

1 file changed

Lines changed: 15 additions & 31 deletions

File tree

‎Documentation/sound/alsa/soc/codec.txt‎

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
ASoC Codec Driver
2-
=================
1+
ASoC Codec Class Driver
2+
=======================
33

4-
The codec driver is generic and hardware independent code that configures the
5-
codec to provide audio capture and playback. It should contain no code that is
6-
specific to the target platform or machine. All platform and machine specific
7-
code should be added to the platform and machine drivers respectively.
4+
The codec class driver is generic and hardware independent code that configures
5+
the codec, FM, MODEM, BT or external DSP to provide audio capture and playback.
6+
It should contain no code that is specific to the target platform or machine.
7+
All platform and machine specific code should be added to the platform and
8+
machine drivers respectively.
89

9-
Each codec driver *must* provide the following features:-
10+
Each codec class driver *must* provide the following features:-
1011

1112
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
1314
3) Mixers and audio controls
1415
4) Codec audio operations
16+
5) DAPM description.
17+
6) DAPM event handler.
1518

1619
Optionally, codec drivers can also provide:-
1720

18-
5) DAPM description.
19-
6) DAPM event handler.
2021
7) DAC Digital mute control.
2122

2223
Its probably best to use this guide in conjunction with the existing codec
@@ -64,26 +65,9 @@ struct snd_soc_dai_driver wm8731_dai = {
6465
2 - Codec control IO
6566
--------------------
6667
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-
functions to read and write the codec registers along with supplying a
69-
register cache:-
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;
68+
(AC97 combines control with data in the DAI). The codec driver should use the
69+
Regmap API for all codec IO. Please see include/linux/regmap.h and existing
70+
codec drivers for example regmap usage.
8771

8872

8973
3 - Mixers and audio controls
@@ -127,7 +111,7 @@ Defines a stereo enumerated control
127111

128112
4 - Codec Audio Operations
129113
--------------------------
130-
The codec driver also supports the following ALSA operations:-
114+
The codec driver also supports the following ALSA PCM operations:-
131115

132116
/* SoC audio ops */
133117
struct snd_soc_ops {

0 commit comments

Comments
 (0)