[ALSA] ASoC: documentation & maintainer
[linux-2.6/linux-loongson.git] / Documentation / sound / alsa / soc / platform.txt
blobc88df261e922c374bbe7c31c388215e058eb6d89
1 ASoC Platform Driver
2 ====================
4 An ASoC platform driver can be divided into audio DMA and SoC DAI configuration
5 and control. The platform drivers only target the SoC CPU and must have no board
6 specific code.
8 Audio DMA
9 =========
11 The platform DMA driver optionally supports the following alsa operations:-
13 /* SoC audio ops */
14 struct 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);
23 The platform driver exports it's DMA functionailty via struct snd_soc_platform:-
25 struct snd_soc_platform {
26         char *name;
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);
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 *);
37         /* platform stream ops */
38         snd_pcm_ops_t *pcm_ops;
41 Please refer to the alsa driver documentation for details of audio DMA.
42 http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm
44 An example DMA driver is soc/pxa/pxa2xx-pcm.c
47 SoC DAI Drivers
48 ===============
50 Each SoC DAI driver must provide the following features:-
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)
58 Please see codec.txt for a description of items 1 - 4.