aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-10 10:02:37 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-10 10:02:37 -0500
commitfad837c16cdd856c68ce2e1335ad0fe836ed8ecd (patch)
tree1a6babdc2ac7e5388c482e93505fdfaf5ff97f61 /sound/soc/soc-core.c
parent51c6ab130642ed975681df843c772dda48a1d2ed (diff)
parent57d54889cd00db2752994b389ba714138652e60c (diff)
Merge commit 'v2.6.34-rc1' into for-2.6.35
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4011ad3dc57a..06c38d1502b7 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -427,24 +427,24 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
427 if (!runtime->hw.rates) { 427 if (!runtime->hw.rates) {
428 printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", 428 printk(KERN_ERR "asoc: %s <-> %s No matching rates\n",
429 codec_dai->name, cpu_dai->name); 429 codec_dai->name, cpu_dai->name);
430 goto machine_err; 430 goto config_err;
431 } 431 }
432 if (!runtime->hw.formats) { 432 if (!runtime->hw.formats) {
433 printk(KERN_ERR "asoc: %s <-> %s No matching formats\n", 433 printk(KERN_ERR "asoc: %s <-> %s No matching formats\n",
434 codec_dai->name, cpu_dai->name); 434 codec_dai->name, cpu_dai->name);
435 goto machine_err; 435 goto config_err;
436 } 436 }
437 if (!runtime->hw.channels_min || !runtime->hw.channels_max) { 437 if (!runtime->hw.channels_min || !runtime->hw.channels_max) {
438 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n", 438 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n",
439 codec_dai->name, cpu_dai->name); 439 codec_dai->name, cpu_dai->name);
440 goto machine_err; 440 goto config_err;
441 } 441 }
442 442
443 /* Symmetry only applies if we've already got an active stream. */ 443 /* Symmetry only applies if we've already got an active stream. */
444 if (cpu_dai->active || codec_dai->active) { 444 if (cpu_dai->active || codec_dai->active) {
445 ret = soc_pcm_apply_symmetry(substream); 445 ret = soc_pcm_apply_symmetry(substream);
446 if (ret != 0) 446 if (ret != 0)
447 goto machine_err; 447 goto config_err;
448 } 448 }
449 449
450 pr_debug("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name); 450 pr_debug("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name);
@@ -467,10 +467,14 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
467 mutex_unlock(&pcm_mutex); 467 mutex_unlock(&pcm_mutex);
468 return 0; 468 return 0;
469 469
470machine_err: 470config_err:
471 if (machine->ops && machine->ops->shutdown) 471 if (machine->ops && machine->ops->shutdown)
472 machine->ops->shutdown(substream); 472 machine->ops->shutdown(substream);
473 473
474machine_err:
475 if (codec_dai->ops->shutdown)
476 codec_dai->ops->shutdown(substream, codec_dai);
477
474codec_dai_err: 478codec_dai_err:
475 if (platform->pcm_ops->close) 479 if (platform->pcm_ops->close)
476 platform->pcm_ops->close(substream); 480 platform->pcm_ops->close(substream);
@@ -1002,6 +1006,12 @@ static int soc_resume(struct device *dev)
1002 struct snd_soc_card *card = socdev->card; 1006 struct snd_soc_card *card = socdev->card;
1003 struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai; 1007 struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai;
1004 1008
1009 /* If the initialization of this soc device failed, there is no codec
1010 * associated with it. Just bail out in this case.
1011 */
1012 if (!card->codec)
1013 return 0;
1014
1005 /* AC97 devices might have other drivers hanging off them so 1015 /* AC97 devices might have other drivers hanging off them so
1006 * need to resume immediately. Other drivers don't have that 1016 * need to resume immediately. Other drivers don't have that
1007 * problem and may take a substantial amount of time to resume 1017 * problem and may take a substantial amount of time to resume