aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa/soc/platform.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/sound/alsa/soc/platform.txt')
-rw-r--r--Documentation/sound/alsa/soc/platform.txt58
1 files changed, 58 insertions, 0 deletions
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt
new file mode 100644
index 000000000000..c88df261e922
--- /dev/null
+++ b/Documentation/sound/alsa/soc/platform.txt
@@ -0,0 +1,58 @@
1ASoC Platform Driver
2====================
3
4An ASoC platform driver can be divided into audio DMA and SoC DAI configuration
5and control. The platform drivers only target the SoC CPU and must have no board
6specific code.
7
8Audio DMA
9=========
10
11The platform DMA driver optionally supports the following alsa operations:-
12
13/* SoC audio ops */
14struct snd_soc_ops {
15 int (*startup)(snd_pcm_substream_t *);
16 void (*shutdown)(snd_pcm_substream_t *);
17 int (*hw_params)(snd_pcm_substream_t *, snd_pcm_hw_params_t *);
18 int (*hw_free)(snd_pcm_substream_t *);
19 int (*prepare)(snd_pcm_substream_t *);
20 int (*trigger)(snd_pcm_substream_t *, int);
21};
22
23The platform driver exports it's DMA functionailty via struct snd_soc_platform:-
24
25struct snd_soc_platform {
26 char *name;
27
28 int (*probe)(struct platform_device *pdev);
29 int (*remove)(struct platform_device *pdev);
30 int (*suspend)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
31 int (*resume)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
32
33 /* pcm creation and destruction */
34 int (*pcm_new)(snd_card_t *, struct snd_soc_codec_dai *, snd_pcm_t *);
35 void (*pcm_free)(snd_pcm_t *);
36
37 /* platform stream ops */
38 snd_pcm_ops_t *pcm_ops;
39};
40
41Please refer to the alsa driver documentation for details of audio DMA.
42http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm
43
44An example DMA driver is soc/pxa/pxa2xx-pcm.c
45
46
47SoC DAI Drivers
48===============
49
50Each SoC DAI driver must provide the following features:-
51
52 1) Digital audio interface (DAI) description
53 2) Digital audio interface configuration
54 3) PCM's description
55 4) Sysclk configuration
56 5) Suspend and resume (optional)
57
58Please see codec.txt for a description of items 1 - 4.