aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-16 18:03:27 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 11:10:01 -0500
commit7bd3a6f34cdd4b1776ca34d0b6fab216e9323759 (patch)
treed76722c3f70e4a6ef2cce5ff619a1b8755ddd6a9 /sound/soc/soc-core.c
parent5ba06fc969d068dee9a59f1fa3dbe58e235fa913 (diff)
ASoC: dapm: Supply the DAI and substream when calling stream events
In order to allow us to do something smarter than iterate through widgets doing strcmp() to work out what to power up for stream events change the interface used to generate them to be based on the combination of a DAI and a stream direction rather than just a simple string identifying the stream. At some point we'll probably want a set of channels too. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6bad7cd4131e..7645b8a545cf 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -573,18 +573,20 @@ int snd_soc_suspend(struct device *dev)
573 } 573 }
574 574
575 for (i = 0; i < card->num_rtd; i++) { 575 for (i = 0; i < card->num_rtd; i++) {
576 struct snd_soc_dai_driver *driver = card->rtd[i].codec_dai->driver; 576 struct snd_soc_dai *codec_dai = card->rtd[i].codec_dai;
577 577
578 if (card->rtd[i].dai_link->ignore_suspend) 578 if (card->rtd[i].dai_link->ignore_suspend)
579 continue; 579 continue;
580 580
581 if (driver->playback.stream_name != NULL) 581 snd_soc_dapm_stream_event(&card->rtd[i],
582 snd_soc_dapm_stream_event(&card->rtd[i], driver->playback.stream_name, 582 SNDRV_PCM_STREAM_PLAYBACK,
583 SND_SOC_DAPM_STREAM_SUSPEND); 583 codec_dai,
584 SND_SOC_DAPM_STREAM_SUSPEND);
584 585
585 if (driver->capture.stream_name != NULL) 586 snd_soc_dapm_stream_event(&card->rtd[i],
586 snd_soc_dapm_stream_event(&card->rtd[i], driver->capture.stream_name, 587 SNDRV_PCM_STREAM_CAPTURE,
587 SND_SOC_DAPM_STREAM_SUSPEND); 588 codec_dai,
589 SND_SOC_DAPM_STREAM_SUSPEND);
588 } 590 }
589 591
590 /* suspend all CODECs */ 592 /* suspend all CODECs */
@@ -687,18 +689,18 @@ static void soc_resume_deferred(struct work_struct *work)
687 } 689 }
688 690
689 for (i = 0; i < card->num_rtd; i++) { 691 for (i = 0; i < card->num_rtd; i++) {
690 struct snd_soc_dai_driver *driver = card->rtd[i].codec_dai->driver; 692 struct snd_soc_dai *codec_dai = card->rtd[i].codec_dai;
691 693
692 if (card->rtd[i].dai_link->ignore_suspend) 694 if (card->rtd[i].dai_link->ignore_suspend)
693 continue; 695 continue;
694 696
695 if (driver->playback.stream_name != NULL) 697 snd_soc_dapm_stream_event(&card->rtd[i],
696 snd_soc_dapm_stream_event(&card->rtd[i], driver->playback.stream_name, 698 SNDRV_PCM_STREAM_PLAYBACK, codec_dai,
697 SND_SOC_DAPM_STREAM_RESUME); 699 SND_SOC_DAPM_STREAM_RESUME);
698 700
699 if (driver->capture.stream_name != NULL) 701 snd_soc_dapm_stream_event(&card->rtd[i],
700 snd_soc_dapm_stream_event(&card->rtd[i], driver->capture.stream_name, 702 SNDRV_PCM_STREAM_CAPTURE, codec_dai,
701 SND_SOC_DAPM_STREAM_RESUME); 703 SND_SOC_DAPM_STREAM_RESUME);
702 } 704 }
703 705
704 /* unmute any active DACs */ 706 /* unmute any active DACs */