Commit eab810f3 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-link: add snd_soc_link_compr_set_params()

dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_set_params().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sgfo3k6q.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0e532c99
...@@ -22,5 +22,6 @@ int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd); ...@@ -22,5 +22,6 @@ int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd);
int snd_soc_link_compr_startup(struct snd_compr_stream *cstream); int snd_soc_link_compr_startup(struct snd_compr_stream *cstream);
void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream); void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream);
int snd_soc_link_compr_set_params(struct snd_compr_stream *cstream);
#endif /* __SOC_LINK_H */ #endif /* __SOC_LINK_H */
...@@ -439,11 +439,9 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream, ...@@ -439,11 +439,9 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
if (ret < 0) if (ret < 0)
goto err; goto err;
if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) { ret = snd_soc_link_compr_set_params(cstream);
ret = rtd->dai_link->compr_ops->set_params(cstream); if (ret < 0)
if (ret < 0) goto err;
goto err;
}
if (cstream->direction == SND_COMPRESS_PLAYBACK) if (cstream->direction == SND_COMPRESS_PLAYBACK)
snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK, snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK,
...@@ -507,11 +505,9 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream, ...@@ -507,11 +505,9 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
if (ret < 0) if (ret < 0)
goto out; goto out;
if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->set_params) { ret = snd_soc_link_compr_set_params(cstream);
ret = fe->dai_link->compr_ops->set_params(cstream); if (ret < 0)
if (ret < 0) goto out;
goto out;
}
dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START); dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE;
......
...@@ -136,3 +136,16 @@ void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream) ...@@ -136,3 +136,16 @@ void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream)
rtd->dai_link->compr_ops->shutdown(cstream); rtd->dai_link->compr_ops->shutdown(cstream);
} }
EXPORT_SYMBOL_GPL(snd_soc_link_compr_shutdown); EXPORT_SYMBOL_GPL(snd_soc_link_compr_shutdown);
int snd_soc_link_compr_set_params(struct snd_compr_stream *cstream)
{
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
int ret = 0;
if (rtd->dai_link->compr_ops &&
rtd->dai_link->compr_ops->set_params)
ret = rtd->dai_link->compr_ops->set_params(cstream);
return soc_link_ret(rtd, ret);
}
EXPORT_SYMBOL_GPL(snd_soc_link_compr_set_params);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment