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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2020-04-24 08:15:49 +09:00 committed by Mark Brown
parent 53294353a0
commit ed38cc5909
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
3 changed files with 21 additions and 3 deletions

View File

@ -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,
struct snd_compr_stream *cstream,
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 {
/*

View File

@ -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);
if (cpu_dai->driver->cops && cpu_dai->driver->cops->pointer)
cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai);
ret = snd_soc_dai_compr_pointer(cpu_dai, cstream, tstamp);
if (ret < 0)
goto out;
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compress_ops ||
@ -660,7 +661,7 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
component, cstream, tstamp);
break;
}
out:
mutex_unlock(&rtd->card->pcm_mutex);
return ret;
}

View File

@ -581,3 +581,17 @@ int snd_soc_dai_compr_ack(struct snd_soc_dai *dai,
return soc_dai_ret(dai, ret);
}
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);