struct snd_compr_stream *cstream);
void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream);
+int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai,
+ struct snd_compr_stream *cstream, int cmd);
struct snd_soc_dai_ops {
/*
if (ret < 0)
goto out;
- if (cpu_dai->driver->cops && cpu_dai->driver->cops->trigger)
- cpu_dai->driver->cops->trigger(cstream, cmd, cpu_dai);
+ ret = snd_soc_dai_compr_trigger(cpu_dai, cstream, cmd);
+ if (ret < 0)
+ goto out;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
- if (cpu_dai->driver->cops && cpu_dai->driver->cops->trigger) {
- ret = cpu_dai->driver->cops->trigger(cstream, cmd, cpu_dai);
- if (ret < 0)
- goto out;
- }
+ ret = snd_soc_dai_compr_trigger(cpu_dai, cstream, cmd);
+ if (ret < 0)
+ goto out;
ret = soc_compr_components_trigger(cstream, cmd);
if (ret < 0)
dai->driver->cops->shutdown(cstream, dai);
}
EXPORT_SYMBOL_GPL(snd_soc_dai_compr_shutdown);
+
+int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai,
+ struct snd_compr_stream *cstream, int cmd)
+{
+ int ret = 0;
+
+ if (dai->driver->cops &&
+ dai->driver->cops->trigger)
+ ret = dai->driver->cops->trigger(cstream, cmd, dai);
+
+ return soc_dai_ret(dai, ret);
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_compr_trigger);