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

ASoC: soc-dai: add snd_soc_dai_compr_pointer()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_pointer().
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/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 53294353
...@@ -185,6 +185,9 @@ int snd_soc_dai_compr_get_params(struct snd_soc_dai *dai, ...@@ -185,6 +185,9 @@ int snd_soc_dai_compr_get_params(struct snd_soc_dai *dai,
int snd_soc_dai_compr_ack(struct snd_soc_dai *dai, int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream, struct snd_compr_stream *cstream,
size_t bytes); size_t bytes);
int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp);
struct snd_soc_dai_ops { struct snd_soc_dai_ops {
/* /*
......
...@@ -648,8 +648,9 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, ...@@ -648,8 +648,9 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
if (cpu_dai->driver->cops && cpu_dai->driver->cops->pointer) ret = snd_soc_dai_compr_pointer(cpu_dai, cstream, tstamp);
cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai); if (ret < 0)
goto out;
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compress_ops || if (!component->driver->compress_ops ||
...@@ -660,7 +661,7 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, ...@@ -660,7 +661,7 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
component, cstream, tstamp); component, cstream, tstamp);
break; break;
} }
out:
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
} }
......
...@@ -581,3 +581,17 @@ int snd_soc_dai_compr_ack(struct snd_soc_dai *dai, ...@@ -581,3 +581,17 @@ int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
return soc_dai_ret(dai, ret); return soc_dai_ret(dai, ret);
} }
EXPORT_SYMBOL_GPL(snd_soc_dai_compr_ack); EXPORT_SYMBOL_GPL(snd_soc_dai_compr_ack);
int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp)
{
int ret = 0;
if (dai->driver->cops &&
dai->driver->cops->pointer)
ret = dai->driver->cops->pointer(cstream, tstamp, dai);
return soc_dai_ret(dai, ret);
}
EXPORT_SYMBOL_GPL(snd_soc_dai_compr_pointer);
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