diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-01-21 02:10:14 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-21 02:10:14 -0500 |
commit | 842a2097007b8a01a71a701300e970502a54bbb2 (patch) | |
tree | 64f8ad8b41513fda0710cc6097968f11d0083ce5 | |
parent | 2f36f5e1ffcc18deee234b9085fabd2828f59ee0 (diff) | |
parent | c88c2823e87dd6f8214b8b8cdc36d45f205a8077 (diff) |
Merge branch 'fix/asoc' into for-linus
-rw-r--r-- | Documentation/sound/alsa/soc/codec.txt | 45 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/machine.txt | 38 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/platform.txt | 12 | ||||
-rw-r--r-- | sound/soc/blackfin/Kconfig | 11 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97.c | 4 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-tdm.c | 10 | ||||
-rw-r--r-- | sound/soc/pxa/z2.c | 3 |
7 files changed, 55 insertions, 68 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 | ||
28 | 1 - Codec DAI and PCM configuration | 28 | 1 - Codec DAI and PCM configuration |
29 | ----------------------------------- | 29 | ----------------------------------- |
30 | Each codec driver must have a struct snd_soc_codec_dai to define its DAI and | 30 | Each codec driver must have a struct snd_soc_dai_driver to define its DAI and |
31 | PCM capabilities and operations. This struct is exported so that it can be | 31 | PCM capabilities and operations. This struct is exported so that it can be |
32 | registered with the core by your machine driver. | 32 | registered with the core by your machine driver. |
33 | 33 | ||
34 | e.g. | 34 | e.g. |
35 | 35 | ||
36 | struct snd_soc_codec_dai wm8731_dai = { | 36 | static 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 | |||
45 | struct 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 | }; |
65 | EXPORT_SYMBOL_GPL(wm8731_dai); | ||
66 | 62 | ||
67 | 63 | ||
68 | 2 - Codec control IO | 64 | 2 - Codec control IO |
@@ -186,13 +182,14 @@ when the mute is applied or freed. | |||
186 | 182 | ||
187 | i.e. | 183 | i.e. |
188 | 184 | ||
189 | static int wm8974_mute(struct snd_soc_codec *codec, | 185 | static 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:- | |||
12 | struct snd_soc_card { | 12 | struct 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 | ||
33 | probe()/remove() | 36 | probe()/remove() |
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs | |||
42 | and DMA is suspended and resumed. Optional. | 45 | and DMA is suspended and resumed. Optional. |
43 | 46 | ||
44 | 47 | ||
45 | Machine operations | ||
46 | ------------------ | ||
47 | The machine specific audio operations can be set here. Again this is optional. | ||
48 | |||
49 | |||
50 | Machine DAI Configuration | 48 | Machine DAI Configuration |
51 | ------------------------- | 49 | ------------------------- |
52 | The machine DAI configuration glues all the codec and CPU DAIs together. It can | 50 | The 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. | |||
61 | static struct snd_soc_dai_link corgi_dai = { | 59 | static 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 | ||
80 | Machine Audio Subsystem | ||
81 | ----------------------- | ||
82 | |||
83 | The machine soc device glues the platform, machine and codec driver together. | ||
84 | Private data can also be set here. e.g. | ||
85 | |||
86 | /* corgi audio private data */ | ||
87 | static struct wm8731_setup_data corgi_wm8731_setup = { | ||
88 | .i2c_address = 0x1b, | ||
89 | }; | ||
90 | |||
91 | /* corgi audio subsystem */ | ||
92 | static 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 | |||
100 | Machine Power Map | 80 | Machine 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 | ||
23 | The platform driver exports its DMA functionality via struct snd_soc_platform:- | 23 | The platform driver exports its DMA functionality via struct |
24 | snd_soc_platform_driver:- | ||
24 | 25 | ||
25 | struct snd_soc_platform { | 26 | struct 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 | }; |
diff --git a/sound/soc/blackfin/Kconfig b/sound/soc/blackfin/Kconfig index 3abeeddc67d3..ae403597fd31 100644 --- a/sound/soc/blackfin/Kconfig +++ b/sound/soc/blackfin/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config SND_BF5XX_I2S | 1 | config SND_BF5XX_I2S |
2 | tristate "SoC I2S Audio for the ADI BF5xx chip" | 2 | tristate "SoC I2S Audio for the ADI BF5xx chip" |
3 | depends on BLACKFIN | 3 | depends on BLACKFIN |
4 | select SND_BF5XX_SOC_SPORT | ||
4 | help | 5 | help |
5 | Say Y or M if you want to add support for codecs attached to | 6 | Say Y or M if you want to add support for codecs attached to |
6 | the Blackfin SPORT (synchronous serial ports) interface in I2S | 7 | the Blackfin SPORT (synchronous serial ports) interface in I2S |
@@ -35,6 +36,7 @@ config SND_BFIN_AD73311_SE | |||
35 | config SND_BF5XX_TDM | 36 | config SND_BF5XX_TDM |
36 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" | 37 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" |
37 | depends on (BLACKFIN && SND_SOC) | 38 | depends on (BLACKFIN && SND_SOC) |
39 | select SND_BF5XX_SOC_SPORT | ||
38 | help | 40 | help |
39 | Say Y or M if you want to add support for codecs attached to | 41 | Say Y or M if you want to add support for codecs attached to |
40 | the Blackfin SPORT (synchronous serial ports) interface in TDM | 42 | the Blackfin SPORT (synchronous serial ports) interface in TDM |
@@ -61,6 +63,10 @@ config SND_BF5XX_SOC_AD193X | |||
61 | config SND_BF5XX_AC97 | 63 | config SND_BF5XX_AC97 |
62 | tristate "SoC AC97 Audio for the ADI BF5xx chip" | 64 | tristate "SoC AC97 Audio for the ADI BF5xx chip" |
63 | depends on BLACKFIN | 65 | depends on BLACKFIN |
66 | select AC97_BUS | ||
67 | select SND_SOC_AC97_BUS | ||
68 | select SND_BF5XX_SOC_SPORT | ||
69 | select SND_BF5XX_SOC_AC97 | ||
64 | help | 70 | help |
65 | Say Y or M if you want to add support for codecs attached to | 71 | Say Y or M if you want to add support for codecs attached to |
66 | the Blackfin SPORT (synchronous serial ports) interface in slot 16 | 72 | the Blackfin SPORT (synchronous serial ports) interface in slot 16 |
@@ -122,17 +128,12 @@ config SND_BF5XX_SOC_SPORT | |||
122 | 128 | ||
123 | config SND_BF5XX_SOC_I2S | 129 | config SND_BF5XX_SOC_I2S |
124 | tristate | 130 | tristate |
125 | select SND_BF5XX_SOC_SPORT | ||
126 | 131 | ||
127 | config SND_BF5XX_SOC_TDM | 132 | config SND_BF5XX_SOC_TDM |
128 | tristate | 133 | tristate |
129 | select SND_BF5XX_SOC_SPORT | ||
130 | 134 | ||
131 | config SND_BF5XX_SOC_AC97 | 135 | config SND_BF5XX_SOC_AC97 |
132 | tristate | 136 | tristate |
133 | select AC97_BUS | ||
134 | select SND_SOC_AC97_BUS | ||
135 | select SND_BF5XX_SOC_SPORT | ||
136 | 137 | ||
137 | config SND_BF5XX_SPORT_NUM | 138 | config SND_BF5XX_SPORT_NUM |
138 | int "Set a SPORT for Sound chip" | 139 | int "Set a SPORT for Sound chip" |
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index c5f856ec27ca..ffbac26b9bce 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c | |||
@@ -260,9 +260,9 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) | |||
260 | pr_debug("%s : sport %d\n", __func__, dai->id); | 260 | pr_debug("%s : sport %d\n", __func__, dai->id); |
261 | if (!dai->active) | 261 | if (!dai->active) |
262 | return 0; | 262 | return 0; |
263 | if (dai->capture.active) | 263 | if (dai->capture_active) |
264 | sport_rx_stop(sport); | 264 | sport_rx_stop(sport); |
265 | if (dai->playback.active) | 265 | if (dai->playback_active) |
266 | sport_tx_stop(sport); | 266 | sport_tx_stop(sport); |
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c index 125123929f16..5515ac9e05c7 100644 --- a/sound/soc/blackfin/bf5xx-tdm.c +++ b/sound/soc/blackfin/bf5xx-tdm.c | |||
@@ -210,7 +210,7 @@ static int bf5xx_tdm_set_channel_map(struct snd_soc_dai *dai, | |||
210 | #ifdef CONFIG_PM | 210 | #ifdef CONFIG_PM |
211 | static int bf5xx_tdm_suspend(struct snd_soc_dai *dai) | 211 | static int bf5xx_tdm_suspend(struct snd_soc_dai *dai) |
212 | { | 212 | { |
213 | struct sport_device *sport = dai->private_data; | 213 | struct sport_device *sport = snd_soc_dai_get_drvdata(dai); |
214 | 214 | ||
215 | if (!dai->active) | 215 | if (!dai->active) |
216 | return 0; | 216 | return 0; |
@@ -235,13 +235,13 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai) | |||
235 | ret = -EBUSY; | 235 | ret = -EBUSY; |
236 | } | 236 | } |
237 | 237 | ||
238 | ret = sport_config_rx(sport, IRFS, 0x1F, 0, 0); | 238 | ret = sport_config_rx(sport, 0, 0x1F, 0, 0); |
239 | if (ret) { | 239 | if (ret) { |
240 | pr_err("SPORT is busy!\n"); | 240 | pr_err("SPORT is busy!\n"); |
241 | ret = -EBUSY; | 241 | ret = -EBUSY; |
242 | } | 242 | } |
243 | 243 | ||
244 | ret = sport_config_tx(sport, ITFS, 0x1F, 0, 0); | 244 | ret = sport_config_tx(sport, 0, 0x1F, 0, 0); |
245 | if (ret) { | 245 | if (ret) { |
246 | pr_err("SPORT is busy!\n"); | 246 | pr_err("SPORT is busy!\n"); |
247 | ret = -EBUSY; | 247 | ret = -EBUSY; |
@@ -303,14 +303,14 @@ static int __devinit bfin_tdm_probe(struct platform_device *pdev) | |||
303 | goto sport_config_err; | 303 | goto sport_config_err; |
304 | } | 304 | } |
305 | 305 | ||
306 | ret = sport_config_rx(sport_handle, IRFS, 0x1F, 0, 0); | 306 | ret = sport_config_rx(sport_handle, 0, 0x1F, 0, 0); |
307 | if (ret) { | 307 | if (ret) { |
308 | pr_err("SPORT is busy!\n"); | 308 | pr_err("SPORT is busy!\n"); |
309 | ret = -EBUSY; | 309 | ret = -EBUSY; |
310 | goto sport_config_err; | 310 | goto sport_config_err; |
311 | } | 311 | } |
312 | 312 | ||
313 | ret = sport_config_tx(sport_handle, ITFS, 0x1F, 0, 0); | 313 | ret = sport_config_tx(sport_handle, 0, 0x1F, 0, 0); |
314 | if (ret) { | 314 | if (ret) { |
315 | pr_err("SPORT is busy!\n"); | 315 | pr_err("SPORT is busy!\n"); |
316 | ret = -EBUSY; | 316 | ret = -EBUSY; |
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index 2d4f896d7fec..3ceaef68e01d 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c | |||
@@ -104,6 +104,7 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = { | |||
104 | .name = "hsdet-gpio", | 104 | .name = "hsdet-gpio", |
105 | .report = SND_JACK_HEADSET, | 105 | .report = SND_JACK_HEADSET, |
106 | .debounce_time = 200, | 106 | .debounce_time = 200, |
107 | .invert = 1, | ||
107 | }, | 108 | }, |
108 | }; | 109 | }; |
109 | 110 | ||
@@ -192,7 +193,7 @@ static struct snd_soc_dai_link z2_dai = { | |||
192 | .cpu_dai_name = "pxa2xx-i2s", | 193 | .cpu_dai_name = "pxa2xx-i2s", |
193 | .codec_dai_name = "wm8750-hifi", | 194 | .codec_dai_name = "wm8750-hifi", |
194 | .platform_name = "pxa-pcm-audio", | 195 | .platform_name = "pxa-pcm-audio", |
195 | .codec_name = "wm8750-codec.0-001a", | 196 | .codec_name = "wm8750-codec.0-001b", |
196 | .init = z2_wm8750_init, | 197 | .init = z2_wm8750_init, |
197 | .ops = &z2_ops, | 198 | .ops = &z2_ops, |
198 | }; | 199 | }; |