aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-05-27 02:03:03 -0400
committerTakashi Iwai <tiwai@suse.de>2011-05-27 02:03:03 -0400
commitcf73df1e2975ae8f88e573e5f593761339a65def (patch)
tree1c264fb62e9bb36af8e762e860a6de3daf112782 /sound
parentd1227e3fe0c63a258db855f4f1536b0b34cd8725 (diff)
parentea77b94774b3cc67162d74894b49af7eb17071f0 (diff)
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/atmel/sam9g20_wm8731.c2
-rw-r--r--sound/soc/codecs/wm1250-ev1.c2
-rw-r--r--sound/soc/codecs/wm8731.c2
-rw-r--r--sound/soc/codecs/wm8915.c1
-rw-r--r--sound/soc/pxa/raumfeld.c92
-rw-r--r--sound/soc/soc-core.c8
-rw-r--r--sound/soc/soc-dapm.c2
7 files changed, 66 insertions, 43 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 28afbbf69ce0..95572d290c27 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -146,7 +146,7 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
146 "at91sam9g20ek_wm8731 " 146 "at91sam9g20ek_wm8731 "
147 ": at91sam9g20ek_wm8731_init() called\n"); 147 ": at91sam9g20ek_wm8731_init() called\n");
148 148
149 ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, 149 ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_MCLK,
150 MCLK_RATE, SND_SOC_CLOCK_IN); 150 MCLK_RATE, SND_SOC_CLOCK_IN);
151 if (ret < 0) { 151 if (ret < 0) {
152 printk(KERN_ERR "Failed to set WM8731 SYSCLK: %d\n", ret); 152 printk(KERN_ERR "Failed to set WM8731 SYSCLK: %d\n", ret);
diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c
index 14d0716bf009..bcc208967917 100644
--- a/sound/soc/codecs/wm1250-ev1.c
+++ b/sound/soc/codecs/wm1250-ev1.c
@@ -22,7 +22,7 @@ SND_SOC_DAPM_ADC("ADC", "wm1250-ev1 Capture", SND_SOC_NOPM, 0, 0),
22SND_SOC_DAPM_DAC("DAC", "wm1250-ev1 Playback", SND_SOC_NOPM, 0, 0), 22SND_SOC_DAPM_DAC("DAC", "wm1250-ev1 Playback", SND_SOC_NOPM, 0, 0),
23 23
24SND_SOC_DAPM_INPUT("WM1250 Input"), 24SND_SOC_DAPM_INPUT("WM1250 Input"),
25SND_SOC_DAPM_INPUT("WM1250 Output"), 25SND_SOC_DAPM_OUTPUT("WM1250 Output"),
26}; 26};
27 27
28static const struct snd_soc_dapm_route wm1250_ev1_dapm_routes[] = { 28static const struct snd_soc_dapm_route wm1250_ev1_dapm_routes[] = {
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 6dec7cee2cb4..2dc964b55e4f 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -198,7 +198,7 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
198{ 198{
199 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(source->codec); 199 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(source->codec);
200 200
201 return wm8731->sysclk_type == WM8731_SYSCLK_MCLK; 201 return wm8731->sysclk_type == WM8731_SYSCLK_XTAL;
202} 202}
203 203
204static const struct snd_soc_dapm_route wm8731_intercon[] = { 204static const struct snd_soc_dapm_route wm8731_intercon[] = {
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index ccc9bd832794..a0b1a7278284 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -19,7 +19,6 @@
19#include <linux/gcd.h> 19#include <linux/gcd.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/delay.h>
23#include <linux/regulator/consumer.h> 22#include <linux/regulator/consumer.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <linux/workqueue.h> 24#include <linux/workqueue.h>
diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c
index 2afabaf59491..1a591f1ebfbd 100644
--- a/sound/soc/pxa/raumfeld.c
+++ b/sound/soc/pxa/raumfeld.c
@@ -151,13 +151,13 @@ static struct snd_soc_ops raumfeld_cs4270_ops = {
151 .hw_params = raumfeld_cs4270_hw_params, 151 .hw_params = raumfeld_cs4270_hw_params,
152}; 152};
153 153
154static int raumfeld_line_suspend(struct snd_soc_card *card) 154static int raumfeld_analog_suspend(struct snd_soc_card *card)
155{ 155{
156 raumfeld_enable_audio(false); 156 raumfeld_enable_audio(false);
157 return 0; 157 return 0;
158} 158}
159 159
160static int raumfeld_line_resume(struct snd_soc_card *card) 160static int raumfeld_analog_resume(struct snd_soc_card *card)
161{ 161{
162 raumfeld_enable_audio(true); 162 raumfeld_enable_audio(true);
163 return 0; 163 return 0;
@@ -225,32 +225,53 @@ static struct snd_soc_ops raumfeld_ak4104_ops = {
225 .hw_params = raumfeld_ak4104_hw_params, 225 .hw_params = raumfeld_ak4104_hw_params,
226}; 226};
227 227
228static struct snd_soc_dai_link raumfeld_dai[] = { 228#define DAI_LINK_CS4270 \
229{ \
230 .name = "CS4270", \
231 .stream_name = "CS4270", \
232 .cpu_dai_name = "pxa-ssp-dai.0", \
233 .platform_name = "pxa-pcm-audio", \
234 .codec_dai_name = "cs4270-hifi", \
235 .codec_name = "cs4270-codec.0-0048", \
236 .ops = &raumfeld_cs4270_ops, \
237}
238
239#define DAI_LINK_AK4104 \
240{ \
241 .name = "ak4104", \
242 .stream_name = "Playback", \
243 .cpu_dai_name = "pxa-ssp-dai.1", \
244 .codec_dai_name = "ak4104-hifi", \
245 .platform_name = "pxa-pcm-audio", \
246 .ops = &raumfeld_ak4104_ops, \
247 .codec_name = "spi0.0", \
248}
249
250static struct snd_soc_dai_link snd_soc_raumfeld_connector_dai[] =
229{ 251{
230 .name = "ak4104", 252 DAI_LINK_CS4270,
231 .stream_name = "Playback", 253 DAI_LINK_AK4104,
232 .cpu_dai_name = "pxa-ssp-dai.1", 254};
233 .codec_dai_name = "ak4104-hifi", 255
234 .platform_name = "pxa-pcm-audio", 256static struct snd_soc_dai_link snd_soc_raumfeld_speaker_dai[] =
235 .ops = &raumfeld_ak4104_ops,
236 .codec_name = "ak4104-codec.0",
237},
238{ 257{
239 .name = "CS4270", 258 DAI_LINK_CS4270,
240 .stream_name = "CS4270", 259};
241 .cpu_dai_name = "pxa-ssp-dai.0", 260
242 .platform_name = "pxa-pcm-audio", 261static struct snd_soc_card snd_soc_raumfeld_connector = {
243 .codec_dai_name = "cs4270-hifi", 262 .name = "Raumfeld Connector",
244 .codec_name = "cs4270-codec.0-0048", 263 .dai_link = snd_soc_raumfeld_connector_dai,
245 .ops = &raumfeld_cs4270_ops, 264 .num_links = ARRAY_SIZE(snd_soc_raumfeld_connector_dai),
246},}; 265 .suspend_post = raumfeld_analog_suspend,
247 266 .resume_pre = raumfeld_analog_resume,
248static struct snd_soc_card snd_soc_raumfeld = { 267};
249 .name = "Raumfeld", 268
250 .dai_link = raumfeld_dai, 269static struct snd_soc_card snd_soc_raumfeld_speaker = {
251 .suspend_post = raumfeld_line_suspend, 270 .name = "Raumfeld Speaker",
252 .resume_pre = raumfeld_line_resume, 271 .dai_link = snd_soc_raumfeld_speaker_dai,
253 .num_links = ARRAY_SIZE(raumfeld_dai), 272 .num_links = ARRAY_SIZE(snd_soc_raumfeld_speaker_dai),
273 .suspend_post = raumfeld_analog_suspend,
274 .resume_pre = raumfeld_analog_resume,
254}; 275};
255 276
256static struct platform_device *raumfeld_audio_device; 277static struct platform_device *raumfeld_audio_device;
@@ -271,22 +292,25 @@ static int __init raumfeld_audio_init(void)
271 292
272 set_max9485_clk(MAX9485_MCLK_FREQ_122880); 293 set_max9485_clk(MAX9485_MCLK_FREQ_122880);
273 294
274 /* Register LINE and SPDIF */ 295 /* Register analog device */
275 raumfeld_audio_device = platform_device_alloc("soc-audio", 0); 296 raumfeld_audio_device = platform_device_alloc("soc-audio", 0);
276 if (!raumfeld_audio_device) 297 if (!raumfeld_audio_device)
277 return -ENOMEM; 298 return -ENOMEM;
278 299
279 platform_set_drvdata(raumfeld_audio_device,
280 &snd_soc_raumfeld);
281 ret = platform_device_add(raumfeld_audio_device);
282
283 /* no S/PDIF on Speakers */
284 if (machine_is_raumfeld_speaker()) 300 if (machine_is_raumfeld_speaker())
301 platform_set_drvdata(raumfeld_audio_device,
302 &snd_soc_raumfeld_speaker);
303
304 if (machine_is_raumfeld_connector())
305 platform_set_drvdata(raumfeld_audio_device,
306 &snd_soc_raumfeld_connector);
307
308 ret = platform_device_add(raumfeld_audio_device);
309 if (ret < 0)
285 return ret; 310 return ret;
286 311
287 raumfeld_enable_audio(true); 312 raumfeld_enable_audio(true);
288 313 return 0;
289 return ret;
290} 314}
291 315
292static void __exit raumfeld_audio_exit(void) 316static void __exit raumfeld_audio_exit(void)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index bb7cd5812945..d75043ed7fc0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1306,10 +1306,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
1306 /* no, then find CPU DAI from registered DAIs*/ 1306 /* no, then find CPU DAI from registered DAIs*/
1307 list_for_each_entry(cpu_dai, &dai_list, list) { 1307 list_for_each_entry(cpu_dai, &dai_list, list) {
1308 if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) { 1308 if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) {
1309
1310 if (!try_module_get(cpu_dai->dev->driver->owner))
1311 return -ENODEV;
1312
1313 rtd->cpu_dai = cpu_dai; 1309 rtd->cpu_dai = cpu_dai;
1314 goto find_codec; 1310 goto find_codec;
1315 } 1311 }
@@ -1622,11 +1618,15 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
1622 1618
1623 /* probe the cpu_dai */ 1619 /* probe the cpu_dai */
1624 if (!cpu_dai->probed) { 1620 if (!cpu_dai->probed) {
1621 if (!try_module_get(cpu_dai->dev->driver->owner))
1622 return -ENODEV;
1623
1625 if (cpu_dai->driver->probe) { 1624 if (cpu_dai->driver->probe) {
1626 ret = cpu_dai->driver->probe(cpu_dai); 1625 ret = cpu_dai->driver->probe(cpu_dai);
1627 if (ret < 0) { 1626 if (ret < 0) {
1628 printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", 1627 printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n",
1629 cpu_dai->name); 1628 cpu_dai->name);
1629 module_put(cpu_dai->dev->driver->owner);
1630 return ret; 1630 return ret;
1631 } 1631 }
1632 } 1632 }
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 456617e63789..999bb08cdfb1 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1110,7 +1110,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
1110 trace_snd_soc_dapm_start(card); 1110 trace_snd_soc_dapm_start(card);
1111 1111
1112 list_for_each_entry(d, &card->dapm_list, list) 1112 list_for_each_entry(d, &card->dapm_list, list)
1113 if (d->n_widgets) 1113 if (d->n_widgets || d->codec == NULL)
1114 d->dev_power = 0; 1114 d->dev_power = 0;
1115 1115
1116 /* Check which widgets we need to power and store them in 1116 /* Check which widgets we need to power and store them in