diff options
author | Mark Brown <broonie@kernel.org> | 2017-08-21 16:48:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-08-21 16:48:37 -0400 |
commit | f13db334bf7b68b0086d04ab6a51517ba41123b4 (patch) | |
tree | 1ce74e775b64e9804aa5bbece3cdc94fd309912b /sound/soc/soc-pcm.c | |
parent | eb59d73cb535ba32df928f210fb9a8529bf465c0 (diff) | |
parent | b47b91c8504c62f95ddff2876620d68697927bd4 (diff) |
Merge branch 'topic/msm8916' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-const
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index dcc5ece08668..7d3859e1a7b9 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, | |||
181 | dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", | 181 | dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", |
182 | be->dai_link->name, event, dir); | 182 | be->dai_link->name, event, dir); |
183 | 183 | ||
184 | if ((event == SND_SOC_DAPM_STREAM_STOP) && | ||
185 | (be->dpcm[dir].users >= 1)) | ||
186 | continue; | ||
187 | |||
184 | snd_soc_dapm_stream_event(be, dir, event); | 188 | snd_soc_dapm_stream_event(be, dir, event); |
185 | } | 189 | } |
186 | 190 | ||
@@ -2628,25 +2632,12 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream) | |||
2628 | return ret; | 2632 | return ret; |
2629 | } | 2633 | } |
2630 | 2634 | ||
2631 | static void soc_pcm_free(struct snd_pcm *pcm) | ||
2632 | { | ||
2633 | struct snd_soc_pcm_runtime *rtd = pcm->private_data; | ||
2634 | struct snd_soc_component *component; | ||
2635 | |||
2636 | list_for_each_entry(component, &rtd->card->component_dev_list, | ||
2637 | card_list) { | ||
2638 | if (component->pcm_free) | ||
2639 | component->pcm_free(pcm); | ||
2640 | } | ||
2641 | } | ||
2642 | |||
2643 | /* create a new pcm */ | 2635 | /* create a new pcm */ |
2644 | int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | 2636 | int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) |
2645 | { | 2637 | { |
2646 | struct snd_soc_platform *platform = rtd->platform; | 2638 | struct snd_soc_platform *platform = rtd->platform; |
2647 | struct snd_soc_dai *codec_dai; | 2639 | struct snd_soc_dai *codec_dai; |
2648 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 2640 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
2649 | struct snd_soc_component *component; | ||
2650 | struct snd_pcm *pcm; | 2641 | struct snd_pcm *pcm; |
2651 | char new_name[64]; | 2642 | char new_name[64]; |
2652 | int ret = 0, playback = 0, capture = 0; | 2643 | int ret = 0, playback = 0, capture = 0; |
@@ -2756,18 +2747,17 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
2756 | if (capture) | 2747 | if (capture) |
2757 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); | 2748 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); |
2758 | 2749 | ||
2759 | list_for_each_entry(component, &rtd->card->component_dev_list, card_list) { | 2750 | if (platform->driver->pcm_new) { |
2760 | if (component->pcm_new) { | 2751 | ret = platform->driver->pcm_new(rtd); |
2761 | ret = component->pcm_new(rtd); | 2752 | if (ret < 0) { |
2762 | if (ret < 0) { | 2753 | dev_err(platform->dev, |
2763 | dev_err(component->dev, | 2754 | "ASoC: pcm constructor failed: %d\n", |
2764 | "ASoC: pcm constructor failed: %d\n", | 2755 | ret); |
2765 | ret); | 2756 | return ret; |
2766 | return ret; | ||
2767 | } | ||
2768 | } | 2757 | } |
2769 | } | 2758 | } |
2770 | pcm->private_free = soc_pcm_free; | 2759 | |
2760 | pcm->private_free = platform->driver->pcm_free; | ||
2771 | out: | 2761 | out: |
2772 | dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", | 2762 | dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", |
2773 | (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, | 2763 | (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, |