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

ASoC: soc-dai: add snd_soc_dai_compr_trigger()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_trigger().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87mu71ssiz.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2b25f81d
...@@ -174,6 +174,8 @@ int snd_soc_dai_compr_startup(struct snd_soc_dai *dai, ...@@ -174,6 +174,8 @@ int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream); struct snd_compr_stream *cstream);
void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai, void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream); 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 { struct snd_soc_dai_ops {
/* /*
......
...@@ -338,8 +338,9 @@ static int soc_compr_trigger(struct snd_compr_stream *cstream, int cmd) ...@@ -338,8 +338,9 @@ static int soc_compr_trigger(struct snd_compr_stream *cstream, int cmd)
if (ret < 0) if (ret < 0)
goto out; goto out;
if (cpu_dai->driver->cops && cpu_dai->driver->cops->trigger) ret = snd_soc_dai_compr_trigger(cpu_dai, cstream, cmd);
cpu_dai->driver->cops->trigger(cstream, cmd, cpu_dai); if (ret < 0)
goto out;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
...@@ -372,11 +373,9 @@ static int soc_compr_trigger_fe(struct snd_compr_stream *cstream, int cmd) ...@@ -372,11 +373,9 @@ static int soc_compr_trigger_fe(struct snd_compr_stream *cstream, int cmd)
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
if (cpu_dai->driver->cops && cpu_dai->driver->cops->trigger) { ret = snd_soc_dai_compr_trigger(cpu_dai, cstream, cmd);
ret = cpu_dai->driver->cops->trigger(cstream, cmd, cpu_dai);
if (ret < 0) if (ret < 0)
goto out; goto out;
}
ret = soc_compr_components_trigger(cstream, cmd); ret = soc_compr_components_trigger(cstream, cmd);
if (ret < 0) if (ret < 0)
......
...@@ -526,3 +526,16 @@ void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai, ...@@ -526,3 +526,16 @@ void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
dai->driver->cops->shutdown(cstream, dai); dai->driver->cops->shutdown(cstream, dai);
} }
EXPORT_SYMBOL_GPL(snd_soc_dai_compr_shutdown); 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);
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