@@ -24,5 +24,7 @@ int snd_soc_link_compr_startup(struct snd_soc_pcm_runtime *rtd,
struct snd_compr_stream *cstream);
void snd_soc_link_compr_shutdown(struct snd_soc_pcm_runtime *rtd,
struct snd_compr_stream *cstream);
+int snd_soc_link_compr_set_params(struct snd_soc_pcm_runtime *rtd,
+ struct snd_compr_stream *cstream);
#endif /* __SOC_LINK_H */
@@ -438,11 +438,9 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
if (ret < 0)
goto err;
- if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) {
- ret = rtd->dai_link->compr_ops->set_params(cstream);
- if (ret < 0)
- goto err;
- }
+ ret = snd_soc_link_compr_set_params(rtd, cstream);
+ if (ret < 0)
+ goto err;
if (cstream->direction == SND_COMPRESS_PLAYBACK)
snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK,
@@ -506,11 +504,9 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
if (ret < 0)
goto out;
- if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->set_params) {
- ret = fe->dai_link->compr_ops->set_params(cstream);
- if (ret < 0)
- goto out;
- }
+ ret = snd_soc_link_compr_set_params(fe, cstream);
+ if (ret < 0)
+ goto out;
dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE;
@@ -134,3 +134,16 @@ void snd_soc_link_compr_shutdown(struct snd_soc_pcm_runtime *rtd,
rtd->dai_link->compr_ops->shutdown(cstream);
}
EXPORT_SYMBOL_GPL(snd_soc_link_compr_shutdown);
+
+int snd_soc_link_compr_set_params(struct snd_soc_pcm_runtime *rtd,
+ struct snd_compr_stream *cstream)
+{
+ 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);