aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-21 02:10:14 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-21 02:10:14 -0500
commit842a2097007b8a01a71a701300e970502a54bbb2 (patch)
tree64f8ad8b41513fda0710cc6097968f11d0083ce5 /Documentation/sound
parent2f36f5e1ffcc18deee234b9085fabd2828f59ee0 (diff)
parentc88c2823e87dd6f8214b8b8cdc36d45f205a8077 (diff)
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'Documentation/sound')
-rw-r--r--Documentation/sound/alsa/soc/codec.txt45
-rw-r--r--Documentation/sound/alsa/soc/machine.txt38
-rw-r--r--Documentation/sound/alsa/soc/platform.txt12
3 files changed, 40 insertions, 55 deletions
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt
index 37ba3a72cb76..bce23a4a7875 100644
--- a/Documentation/sound/alsa/soc/codec.txt
+++ b/Documentation/sound/alsa/soc/codec.txt
@@ -27,42 +27,38 @@ ASoC Codec driver breakdown
27 27
281 - Codec DAI and PCM configuration 281 - Codec DAI and PCM configuration
29----------------------------------- 29-----------------------------------
30Each codec driver must have a struct snd_soc_codec_dai to define its DAI and 30Each codec driver must have a struct snd_soc_dai_driver to define its DAI and
31PCM capabilities and operations. This struct is exported so that it can be 31PCM capabilities and operations. This struct is exported so that it can be
32registered with the core by your machine driver. 32registered with the core by your machine driver.
33 33
34e.g. 34e.g.
35 35
36struct snd_soc_codec_dai wm8731_dai = { 36static struct snd_soc_dai_ops wm8731_dai_ops = {
37 .name = "WM8731", 37 .prepare = wm8731_pcm_prepare,
38 /* playback capabilities */ 38 .hw_params = wm8731_hw_params,
39 .shutdown = wm8731_shutdown,
40 .digital_mute = wm8731_mute,
41 .set_sysclk = wm8731_set_dai_sysclk,
42 .set_fmt = wm8731_set_dai_fmt,
43};
44
45struct snd_soc_dai_driver wm8731_dai = {
46 .name = "wm8731-hifi",
39 .playback = { 47 .playback = {
40 .stream_name = "Playback", 48 .stream_name = "Playback",
41 .channels_min = 1, 49 .channels_min = 1,
42 .channels_max = 2, 50 .channels_max = 2,
43 .rates = WM8731_RATES, 51 .rates = WM8731_RATES,
44 .formats = WM8731_FORMATS,}, 52 .formats = WM8731_FORMATS,},
45 /* capture capabilities */
46 .capture = { 53 .capture = {
47 .stream_name = "Capture", 54 .stream_name = "Capture",
48 .channels_min = 1, 55 .channels_min = 1,
49 .channels_max = 2, 56 .channels_max = 2,
50 .rates = WM8731_RATES, 57 .rates = WM8731_RATES,
51 .formats = WM8731_FORMATS,}, 58 .formats = WM8731_FORMATS,},
52 /* pcm operations - see section 4 below */ 59 .ops = &wm8731_dai_ops,
53 .ops = { 60 .symmetric_rates = 1,
54 .prepare = wm8731_pcm_prepare,
55 .hw_params = wm8731_hw_params,
56 .shutdown = wm8731_shutdown,
57 },
58 /* DAI operations - see DAI.txt */
59 .dai_ops = {
60 .digital_mute = wm8731_mute,
61 .set_sysclk = wm8731_set_dai_sysclk,
62 .set_fmt = wm8731_set_dai_fmt,
63 }
64}; 61};
65EXPORT_SYMBOL_GPL(wm8731_dai);
66 62
67 63
682 - Codec control IO 642 - Codec control IO
@@ -186,13 +182,14 @@ when the mute is applied or freed.
186 182
187i.e. 183i.e.
188 184
189static int wm8974_mute(struct snd_soc_codec *codec, 185static int wm8974_mute(struct snd_soc_dai *dai, int mute)
190 struct snd_soc_codec_dai *dai, int mute)
191{ 186{
192 u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; 187 struct snd_soc_codec *codec = dai->codec;
193 if(mute) 188 u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf;
194 wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); 189
190 if (mute)
191 snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40);
195 else 192 else
196 wm8974_write(codec, WM8974_DAC, mute_reg); 193 snd_soc_write(codec, WM8974_DAC, mute_reg);
197 return 0; 194 return 0;
198} 195}
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt
index 2524c75557df..3e2ec9cbf397 100644
--- a/Documentation/sound/alsa/soc/machine.txt
+++ b/Documentation/sound/alsa/soc/machine.txt
@@ -12,6 +12,8 @@ the following struct:-
12struct snd_soc_card { 12struct snd_soc_card {
13 char *name; 13 char *name;
14 14
15 ...
16
15 int (*probe)(struct platform_device *pdev); 17 int (*probe)(struct platform_device *pdev);
16 int (*remove)(struct platform_device *pdev); 18 int (*remove)(struct platform_device *pdev);
17 19
@@ -22,12 +24,13 @@ struct snd_soc_card {
22 int (*resume_pre)(struct platform_device *pdev); 24 int (*resume_pre)(struct platform_device *pdev);
23 int (*resume_post)(struct platform_device *pdev); 25 int (*resume_post)(struct platform_device *pdev);
24 26
25 /* machine stream operations */ 27 ...
26 struct snd_soc_ops *ops;
27 28
28 /* CPU <--> Codec DAI links */ 29 /* CPU <--> Codec DAI links */
29 struct snd_soc_dai_link *dai_link; 30 struct snd_soc_dai_link *dai_link;
30 int num_links; 31 int num_links;
32
33 ...
31}; 34};
32 35
33probe()/remove() 36probe()/remove()
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs
42and DMA is suspended and resumed. Optional. 45and DMA is suspended and resumed. Optional.
43 46
44 47
45Machine operations
46------------------
47The machine specific audio operations can be set here. Again this is optional.
48
49
50Machine DAI Configuration 48Machine DAI Configuration
51------------------------- 49-------------------------
52The machine DAI configuration glues all the codec and CPU DAIs together. It can 50The machine DAI configuration glues all the codec and CPU DAIs together. It can
@@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
61static struct snd_soc_dai_link corgi_dai = { 59static struct snd_soc_dai_link corgi_dai = {
62 .name = "WM8731", 60 .name = "WM8731",
63 .stream_name = "WM8731", 61 .stream_name = "WM8731",
64 .cpu_dai = &pxa_i2s_dai, 62 .cpu_dai_name = "pxa-is2-dai",
65 .codec_dai = &wm8731_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, 66 .init = corgi_wm8731_init,
67 .ops = &corgi_ops, 67 .ops = &corgi_ops,
68}; 68};
@@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = {
77}; 77};
78 78
79 79
80Machine Audio Subsystem
81-----------------------
82
83The machine soc device glues the platform, machine and codec driver together.
84Private data can also be set here. e.g.
85
86/* corgi audio private data */
87static struct wm8731_setup_data corgi_wm8731_setup = {
88 .i2c_address = 0x1b,
89};
90
91/* corgi audio subsystem */
92static struct snd_soc_device corgi_snd_devdata = {
93 .machine = &snd_soc_corgi,
94 .platform = &pxa2xx_soc_platform,
95 .codec_dev = &soc_codec_dev_wm8731,
96 .codec_data = &corgi_wm8731_setup,
97};
98
99
100Machine Power Map 80Machine Power Map
101----------------- 81-----------------
102 82
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt
index 06d835987c6a..d57efad37e0a 100644
--- a/Documentation/sound/alsa/soc/platform.txt
+++ b/Documentation/sound/alsa/soc/platform.txt
@@ -20,9 +20,10 @@ struct snd_soc_ops {
20 int (*trigger)(struct snd_pcm_substream *, int); 20 int (*trigger)(struct snd_pcm_substream *, int);
21}; 21};
22 22
23The platform driver exports its DMA functionality via struct snd_soc_platform:- 23The platform driver exports its DMA functionality via struct
24snd_soc_platform_driver:-
24 25
25struct snd_soc_platform { 26struct snd_soc_platform_driver {
26 char *name; 27 char *name;
27 28
28 int (*probe)(struct platform_device *pdev); 29 int (*probe)(struct platform_device *pdev);
@@ -34,6 +35,13 @@ struct snd_soc_platform {
34 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); 35 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
35 void (*pcm_free)(struct snd_pcm *); 36 void (*pcm_free)(struct snd_pcm *);
36 37
38 /*
39 * For platform caused delay reporting.
40 * Optional.
41 */
42 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
43 struct snd_soc_dai *);
44
37 /* platform stream ops */ 45 /* platform stream ops */
38 struct snd_pcm_ops *pcm_ops; 46 struct snd_pcm_ops *pcm_ops;
39}; 47};