diff options
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 2cedf09f6d96..54d18f22a33e 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -555,7 +555,6 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) | |||
555 | 555 | ||
556 | if (platform->driver->ops && platform->driver->ops->close) | 556 | if (platform->driver->ops && platform->driver->ops->close) |
557 | platform->driver->ops->close(substream); | 557 | platform->driver->ops->close(substream); |
558 | cpu_dai->runtime = NULL; | ||
559 | 558 | ||
560 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 559 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
561 | if (snd_soc_runtime_ignore_pmdown_time(rtd)) { | 560 | if (snd_soc_runtime_ignore_pmdown_time(rtd)) { |
@@ -819,6 +818,13 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
819 | if (ret < 0) | 818 | if (ret < 0) |
820 | return ret; | 819 | return ret; |
821 | } | 820 | } |
821 | |||
822 | if (rtd->dai_link->ops && rtd->dai_link->ops->trigger) { | ||
823 | ret = rtd->dai_link->ops->trigger(substream, cmd); | ||
824 | if (ret < 0) | ||
825 | return ret; | ||
826 | } | ||
827 | |||
822 | return 0; | 828 | return 0; |
823 | } | 829 | } |
824 | 830 | ||
@@ -1012,21 +1018,12 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, | |||
1012 | } | 1018 | } |
1013 | 1019 | ||
1014 | static inline struct snd_soc_dapm_widget * | 1020 | static inline struct snd_soc_dapm_widget * |
1015 | rtd_get_cpu_widget(struct snd_soc_pcm_runtime *rtd, int stream) | 1021 | dai_get_widget(struct snd_soc_dai *dai, int stream) |
1016 | { | ||
1017 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1018 | return rtd->cpu_dai->playback_widget; | ||
1019 | else | ||
1020 | return rtd->cpu_dai->capture_widget; | ||
1021 | } | ||
1022 | |||
1023 | static inline struct snd_soc_dapm_widget * | ||
1024 | rtd_get_codec_widget(struct snd_soc_pcm_runtime *rtd, int stream) | ||
1025 | { | 1022 | { |
1026 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 1023 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) |
1027 | return rtd->codec_dai->playback_widget; | 1024 | return dai->playback_widget; |
1028 | else | 1025 | else |
1029 | return rtd->codec_dai->capture_widget; | 1026 | return dai->capture_widget; |
1030 | } | 1027 | } |
1031 | 1028 | ||
1032 | static int widget_in_list(struct snd_soc_dapm_widget_list *list, | 1029 | static int widget_in_list(struct snd_soc_dapm_widget_list *list, |
@@ -1076,14 +1073,14 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
1076 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) { | 1073 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) { |
1077 | 1074 | ||
1078 | /* is there a valid CPU DAI widget for this BE */ | 1075 | /* is there a valid CPU DAI widget for this BE */ |
1079 | widget = rtd_get_cpu_widget(dpcm->be, stream); | 1076 | widget = dai_get_widget(dpcm->be->cpu_dai, stream); |
1080 | 1077 | ||
1081 | /* prune the BE if it's no longer in our active list */ | 1078 | /* prune the BE if it's no longer in our active list */ |
1082 | if (widget && widget_in_list(list, widget)) | 1079 | if (widget && widget_in_list(list, widget)) |
1083 | continue; | 1080 | continue; |
1084 | 1081 | ||
1085 | /* is there a valid CODEC DAI widget for this BE */ | 1082 | /* is there a valid CODEC DAI widget for this BE */ |
1086 | widget = rtd_get_codec_widget(dpcm->be, stream); | 1083 | widget = dai_get_widget(dpcm->be->codec_dai, stream); |
1087 | 1084 | ||
1088 | /* prune the BE if it's no longer in our active list */ | 1085 | /* prune the BE if it's no longer in our active list */ |
1089 | if (widget && widget_in_list(list, widget)) | 1086 | if (widget && widget_in_list(list, widget)) |
@@ -1675,7 +1672,7 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, | |||
1675 | be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; | 1672 | be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; |
1676 | break; | 1673 | break; |
1677 | case SNDRV_PCM_TRIGGER_SUSPEND: | 1674 | case SNDRV_PCM_TRIGGER_SUSPEND: |
1678 | if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) | 1675 | if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) |
1679 | continue; | 1676 | continue; |
1680 | 1677 | ||
1681 | if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) | 1678 | if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) |