1d8a5d624STakashi Iwai====================
2d8a5d624STakashi IwaiASoC Platform Driver
3d8a5d624STakashi Iwai====================
4d8a5d624STakashi Iwai
5d8a5d624STakashi IwaiAn ASoC platform driver class can be divided into audio DMA drivers, SoC DAI
6d8a5d624STakashi Iwaidrivers and DSP drivers. The platform drivers only target the SoC CPU and must
7d8a5d624STakashi Iwaihave no board specific code.
8d8a5d624STakashi Iwai
9d8a5d624STakashi IwaiAudio DMA
10d8a5d624STakashi Iwai=========
11d8a5d624STakashi Iwai
12d8a5d624STakashi IwaiThe platform DMA driver optionally supports the following ALSA operations:-
13d8a5d624STakashi Iwai::
14d8a5d624STakashi Iwai
15d8a5d624STakashi Iwai  /* SoC audio ops */
16d8a5d624STakashi Iwai  struct snd_soc_ops {
17d8a5d624STakashi Iwai	int (*startup)(struct snd_pcm_substream *);
18d8a5d624STakashi Iwai	void (*shutdown)(struct snd_pcm_substream *);
19d8a5d624STakashi Iwai	int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
20d8a5d624STakashi Iwai	int (*hw_free)(struct snd_pcm_substream *);
21d8a5d624STakashi Iwai	int (*prepare)(struct snd_pcm_substream *);
22d8a5d624STakashi Iwai	int (*trigger)(struct snd_pcm_substream *, int);
23d8a5d624STakashi Iwai  };
24d8a5d624STakashi Iwai
25d8a5d624STakashi IwaiThe platform driver exports its DMA functionality via struct
26d8a5d624STakashi Iwaisnd_soc_platform_driver:-
27d8a5d624STakashi Iwai::
28d8a5d624STakashi Iwai
29d8a5d624STakashi Iwai  struct snd_soc_platform_driver {
30d8a5d624STakashi Iwai	char *name;
31d8a5d624STakashi Iwai
32d8a5d624STakashi Iwai	int (*probe)(struct platform_device *pdev);
33d8a5d624STakashi Iwai	int (*remove)(struct platform_device *pdev);
34d8a5d624STakashi Iwai	int (*suspend)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
35d8a5d624STakashi Iwai	int (*resume)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
36d8a5d624STakashi Iwai
37d8a5d624STakashi Iwai	/* pcm creation and destruction */
38d8a5d624STakashi Iwai	int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
39d8a5d624STakashi Iwai	void (*pcm_free)(struct snd_pcm *);
40d8a5d624STakashi Iwai
41d8a5d624STakashi Iwai	/*
42d8a5d624STakashi Iwai	 * For platform caused delay reporting.
43d8a5d624STakashi Iwai	 * Optional.
44d8a5d624STakashi Iwai	 */
45d8a5d624STakashi Iwai	snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
46d8a5d624STakashi Iwai		struct snd_soc_dai *);
47d8a5d624STakashi Iwai
48d8a5d624STakashi Iwai	/* platform stream ops */
49d8a5d624STakashi Iwai	struct snd_pcm_ops *pcm_ops;
50d8a5d624STakashi Iwai  };
51d8a5d624STakashi Iwai
52d8a5d624STakashi IwaiPlease refer to the ALSA driver documentation for details of audio DMA.
53d8a5d624STakashi Iwaihttp://www.alsa-project.org/~iwai/writing-an-alsa-driver/
54d8a5d624STakashi Iwai
55d8a5d624STakashi IwaiAn example DMA driver is soc/pxa/pxa2xx-pcm.c
56d8a5d624STakashi Iwai
57d8a5d624STakashi Iwai
58d8a5d624STakashi IwaiSoC DAI Drivers
59d8a5d624STakashi Iwai===============
60d8a5d624STakashi Iwai
61d8a5d624STakashi IwaiEach SoC DAI driver must provide the following features:-
62d8a5d624STakashi Iwai
63d8a5d624STakashi Iwai1. Digital audio interface (DAI) description
64d8a5d624STakashi Iwai2. Digital audio interface configuration
65d8a5d624STakashi Iwai3. PCM's description
66d8a5d624STakashi Iwai4. SYSCLK configuration
67d8a5d624STakashi Iwai5. Suspend and resume (optional)
68d8a5d624STakashi Iwai
69d8a5d624STakashi IwaiPlease see codec.txt for a description of items 1 - 4.
70d8a5d624STakashi Iwai
71d8a5d624STakashi Iwai
72d8a5d624STakashi IwaiSoC DSP Drivers
73d8a5d624STakashi Iwai===============
74d8a5d624STakashi Iwai
75d8a5d624STakashi IwaiEach SoC DSP driver usually supplies the following features :-
76d8a5d624STakashi Iwai
77d8a5d624STakashi Iwai1. DAPM graph
78d8a5d624STakashi Iwai2. Mixer controls
79d8a5d624STakashi Iwai3. DMA IO to/from DSP buffers (if applicable)
80d8a5d624STakashi Iwai4. Definition of DSP front end (FE) PCM devices.
81d8a5d624STakashi Iwai
82d8a5d624STakashi IwaiPlease see DPCM.txt for a description of item 4.
83