diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-01-20 20:47:12 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-28 19:20:43 -0500 |
commit | b0639bd2428d61a13b69d2ff247cfceae90b8366 (patch) | |
tree | 6358e1fedaf4557d245684305bdf354f20eeeb52 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
ASoC: soc-pcm: copy dpcm->hw_params and call be_hw_params_fixup every time
Current DPCM doesn't copy dpcm->hw_params and doesn't call be_hw_params
if some FE are connected. But 2nd or later FE might want to know BE hw_params.
This patch solves this issue.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-pcm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index e898b427be7e..be2fd5e46182 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -1866,18 +1866,6 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) | |||
1866 | if (!snd_soc_dpcm_be_can_update(fe, be, stream)) | 1866 | if (!snd_soc_dpcm_be_can_update(fe, be, stream)) |
1867 | continue; | 1867 | continue; |
1868 | 1868 | ||
1869 | /* only allow hw_params() if no connected FEs are running */ | ||
1870 | if (!snd_soc_dpcm_can_be_params(fe, be, stream)) | ||
1871 | continue; | ||
1872 | |||
1873 | if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && | ||
1874 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && | ||
1875 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) | ||
1876 | continue; | ||
1877 | |||
1878 | dev_dbg(be->dev, "ASoC: hw_params BE %s\n", | ||
1879 | dpcm->fe->dai_link->name); | ||
1880 | |||
1881 | /* copy params for each dpcm */ | 1869 | /* copy params for each dpcm */ |
1882 | memcpy(&dpcm->hw_params, &fe->dpcm[stream].hw_params, | 1870 | memcpy(&dpcm->hw_params, &fe->dpcm[stream].hw_params, |
1883 | sizeof(struct snd_pcm_hw_params)); | 1871 | sizeof(struct snd_pcm_hw_params)); |
@@ -1894,6 +1882,18 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) | |||
1894 | } | 1882 | } |
1895 | } | 1883 | } |
1896 | 1884 | ||
1885 | /* only allow hw_params() if no connected FEs are running */ | ||
1886 | if (!snd_soc_dpcm_can_be_params(fe, be, stream)) | ||
1887 | continue; | ||
1888 | |||
1889 | if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && | ||
1890 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && | ||
1891 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) | ||
1892 | continue; | ||
1893 | |||
1894 | dev_dbg(be->dev, "ASoC: hw_params BE %s\n", | ||
1895 | dpcm->fe->dai_link->name); | ||
1896 | |||
1897 | ret = soc_pcm_hw_params(be_substream, &dpcm->hw_params); | 1897 | ret = soc_pcm_hw_params(be_substream, &dpcm->hw_params); |
1898 | if (ret < 0) { | 1898 | if (ret < 0) { |
1899 | dev_err(dpcm->be->dev, | 1899 | dev_err(dpcm->be->dev, |