4 The ASoC machine (or board) driver is the code that glues together the platform
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
17 int (*probe)(struct platform_device *pdev);
18 int (*remove)(struct platform_device *pdev);
20 /* the pre and post PM functions are used to do any PM work before and
21 * after the codec and DAIs do any PM work. */
22 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state);
23 int (*suspend_post)(struct platform_device *pdev, pm_message_t state);
24 int (*resume_pre)(struct platform_device *pdev);
25 int (*resume_post)(struct platform_device *pdev);
29 /* CPU <--> Codec DAI links */
30 struct snd_soc_dai_link *dai_link;
38 probe/remove are optional. Do any machine specific probe here.
43 The machine driver has pre and post versions of suspend and resume to take care
44 of any machine audio tasks that have to be done before or after the codec, DAIs
45 and DMA is suspended and resumed. Optional.
48 Machine DAI Configuration
49 -------------------------
50 The machine DAI configuration glues all the codec and CPU DAIs together. It can
51 also be used to set up the DAI system clock and for any machine related DAI
52 initialisation e.g. the machine audio map can be connected to the codec audio
53 map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c
56 struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
58 /* corgi digital audio interface glue - connects codec <--> CPU */
59 static struct snd_soc_dai_link corgi_dai = {
61 .stream_name = "WM8731",
62 .cpu_dai_name = "pxa-is2-dai",
63 .codec_dai_name = "wm8731-hifi",
64 .platform_name = "pxa-pcm-audio",
65 .codec_name = "wm8713-codec.0-001a",
66 .init = corgi_wm8731_init,
70 struct snd_soc_card then sets up the machine with its DAIs. e.g.
72 /* corgi audio machine driver */
73 static struct snd_soc_card snd_soc_corgi = {
75 .dai_link = &corgi_dai,
83 The machine driver can optionally extend the codec power map and to become an
84 audio power map of the audio subsystem. This allows for automatic power up/down
85 of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack
86 sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for
93 Machine specific audio mixer controls can be added in the DAI init function.