diff options
author | Liam Girdwood <liam.girdwood@wolfsonmicro.com> | 2006-10-06 12:34:51 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:00:20 -0500 |
commit | eb1a6af39b70375d93ed25e7c916f64463e00614 (patch) | |
tree | a5cb9228ad4f5cad115d491a413a3ad0a0e7de29 /Documentation/sound/alsa/soc/machine.txt | |
parent | a3288176de3fdd439d9bca0a0b9ca749c12ac5ac (diff) |
[ALSA] ASoC: documentation & maintainer
This patch adds documentation describing the ASoC architecture and a
maintainer entry for ASoC.
The documentation includes the following files:-
codec.txt: Codec driver internals.
DAI.txt: Description of Digital Audio Interface standards and how to
configure a DAI within your codec and CPU DAI drivers.
dapm.txt: Dynamic Audio Power Management.
platform.txt: Platform audio DMA and DAI.
machine.txt: Machine driver internals.
pop_clicks.txt: How to minimise audio artifacts.
clocking.txt: ASoC clocking for best power performance.
Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'Documentation/sound/alsa/soc/machine.txt')
-rw-r--r-- | Documentation/sound/alsa/soc/machine.txt | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt new file mode 100644 index 000000000000..3014795b1733 --- /dev/null +++ b/Documentation/sound/alsa/soc/machine.txt | |||
@@ -0,0 +1,114 @@ | |||
1 | ASoC Machine Driver | ||
2 | =================== | ||
3 | |||
4 | The ASoC machine (or board) driver is the code that glues together the platform | ||
5 | and codec drivers. | ||
6 | |||
7 | The machine driver can contain codec and platform specific code. It registers | ||
8 | the audio subsystem with the kernel as a platform device and is represented by | ||
9 | the following struct:- | ||
10 | |||
11 | /* SoC machine */ | ||
12 | struct snd_soc_machine { | ||
13 | char *name; | ||
14 | |||
15 | int (*probe)(struct platform_device *pdev); | ||
16 | int (*remove)(struct platform_device *pdev); | ||
17 | |||
18 | /* the pre and post PM functions are used to do any PM work before and | ||
19 | * after the codec and DAI's do any PM work. */ | ||
20 | int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); | ||
21 | int (*suspend_post)(struct platform_device *pdev, pm_message_t state); | ||
22 | int (*resume_pre)(struct platform_device *pdev); | ||
23 | int (*resume_post)(struct platform_device *pdev); | ||
24 | |||
25 | /* machine stream operations */ | ||
26 | struct snd_soc_ops *ops; | ||
27 | |||
28 | /* CPU <--> Codec DAI links */ | ||
29 | struct snd_soc_dai_link *dai_link; | ||
30 | int num_links; | ||
31 | }; | ||
32 | |||
33 | probe()/remove() | ||
34 | ---------------- | ||
35 | probe/remove are optional. Do any machine specific probe here. | ||
36 | |||
37 | |||
38 | suspend()/resume() | ||
39 | ------------------ | ||
40 | The machine driver has pre and post versions of suspend and resume to take care | ||
41 | of any machine audio tasks that have to be done before or after the codec, DAI's | ||
42 | and DMA is suspended and resumed. Optional. | ||
43 | |||
44 | |||
45 | Machine operations | ||
46 | ------------------ | ||
47 | The machine specific audio operations can be set here. Again this is optional. | ||
48 | |||
49 | |||
50 | Machine DAI Configuration | ||
51 | ------------------------- | ||
52 | The machine DAI configuration glues all the codec and CPU DAI's together. It can | ||
53 | also be used to set up the DAI system clock and for any machine related DAI | ||
54 | initialisation e.g. the machine audio map can be connected to the codec audio | ||
55 | map, unconnnected codec pins can be set as such. Please see corgi.c, spitz.c | ||
56 | for examples. | ||
57 | |||
58 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | ||
59 | |||
60 | /* corgi digital audio interface glue - connects codec <--> CPU */ | ||
61 | static struct snd_soc_dai_link corgi_dai = { | ||
62 | .name = "WM8731", | ||
63 | .stream_name = "WM8731", | ||
64 | .cpu_dai = &pxa_i2s_dai, | ||
65 | .codec_dai = &wm8731_dai, | ||
66 | .init = corgi_wm8731_init, | ||
67 | .config_sysclk = corgi_config_sysclk, | ||
68 | }; | ||
69 | |||
70 | struct snd_soc_machine then sets up the machine with it's DAI's. e.g. | ||
71 | |||
72 | /* corgi audio machine driver */ | ||
73 | static struct snd_soc_machine snd_soc_machine_corgi = { | ||
74 | .name = "Corgi", | ||
75 | .dai_link = &corgi_dai, | ||
76 | .num_links = 1, | ||
77 | .ops = &corgi_ops, | ||
78 | }; | ||
79 | |||
80 | |||
81 | Machine Audio Subsystem | ||
82 | ----------------------- | ||
83 | |||
84 | The machine soc device glues the platform, machine and codec driver together. | ||
85 | Private data can also be set here. e.g. | ||
86 | |||
87 | /* corgi audio private data */ | ||
88 | static struct wm8731_setup_data corgi_wm8731_setup = { | ||
89 | .i2c_address = 0x1b, | ||
90 | }; | ||
91 | |||
92 | /* corgi audio subsystem */ | ||
93 | static struct snd_soc_device corgi_snd_devdata = { | ||
94 | .machine = &snd_soc_machine_corgi, | ||
95 | .platform = &pxa2xx_soc_platform, | ||
96 | .codec_dev = &soc_codec_dev_wm8731, | ||
97 | .codec_data = &corgi_wm8731_setup, | ||
98 | }; | ||
99 | |||
100 | |||
101 | Machine Power Map | ||
102 | ----------------- | ||
103 | |||
104 | The machine driver can optionally extend the codec power map and to become an | ||
105 | audio power map of the audio subsystem. This allows for automatic power up/down | ||
106 | of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack | ||
107 | sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for | ||
108 | details. | ||
109 | |||
110 | |||
111 | Machine Controls | ||
112 | ---------------- | ||
113 | |||
114 | Machine specific audio mixer controls can be added in the dai init function. \ No newline at end of file | ||