|
1 | | -ASoC Codec Driver |
2 | | -================= |
| 1 | +ASoC Codec Class Driver |
| 2 | +======================= |
3 | 3 |
|
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. |
8 | 9 |
|
9 | | -Each codec driver *must* provide the following features:- |
| 10 | +Each codec class driver *must* provide the following features:- |
10 | 11 |
|
11 | 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 | 14 | 3) Mixers and audio controls |
14 | 15 | 4) Codec audio operations |
| 16 | + 5) DAPM description. |
| 17 | + 6) DAPM event handler. |
15 | 18 |
|
16 | 19 | Optionally, codec drivers can also provide:- |
17 | 20 |
|
18 | | - 5) DAPM description. |
19 | | - 6) DAPM event handler. |
20 | 21 | 7) DAC Digital mute control. |
21 | 22 |
|
22 | 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 | 65 | 2 - Codec control IO |
65 | 66 | -------------------- |
66 | 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 | | -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. |
87 | 71 |
|
88 | 72 |
|
89 | 73 | 3 - Mixers and audio controls |
@@ -127,7 +111,7 @@ Defines a stereo enumerated control |
127 | 111 |
|
128 | 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 | 116 | /* SoC audio ops */ |
133 | 117 | struct snd_soc_ops { |
|
0 commit comments