OSDN Git Service

ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 16 Nov 2021 07:45:12 +0000 (16:45 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 29 Nov 2021 12:19:40 +0000 (12:19 +0000)
commit8544f08c816292c2219f28c6eaa69236b978bfb9
treecaaed488df4069a5b4dad5794c9037793b776815
parent335302dbc2e4d041b579614beed83124f341ff43
ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay()

Current soc_pcm_pointer() is manually calculating
both CPU-DAI's   max delay (= A)
and  Codec-DAI's max delay (= B).

static snd_pcm_uframes_t soc_pcm_pointer(...)
{
...
 ^ for_each_rtd_cpu_dais(rtd, i, cpu_dai)
(A) cpu_delay = max(cpu_delay, ...);
 v delay += cpu_delay;

 ^ for_each_rtd_codec_dais(rtd, i, codec_dai)
(B) codec_delay = max(codec_delay, ...);
 v delay += codec_delay;

runtime->delay = delay;
...
}

Current soc_pcm_pointer() and the total delay calculating
is not readable / difficult to understand.

This patch update snd_soc_dai_delay() to snd_soc_pcm_dai_delay(),
and calcule both CPU/Codec delay in one function.

Link: https://lore.kernel.org/r/87fszl4yrq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875yssy25z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dai.h
sound/soc/soc-dai.c
sound/soc/soc-pcm.c