Skip to content

Commit dd894f4

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-pcm: tidyup soc_pcm_pointer()'s delay update method
No driver directly updates runtime->delay in .pointer. This patch cleanups its method. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zgq4wnkx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 796b64a commit dd894f4

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

sound/soc/soc-pcm.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,29 +1080,22 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
10801080
/*
10811081
* soc level wrapper for pointer callback
10821082
* If cpu_dai, codec_dai, component driver has the delay callback, then
1083-
* the runtime->delay will be updated accordingly.
1083+
* the runtime->delay will be updated via snd_soc_pcm_component/dai_delay().
10841084
*/
10851085
static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
10861086
{
10871087
struct snd_pcm_runtime *runtime = substream->runtime;
10881088
snd_pcm_uframes_t offset = 0;
1089-
snd_pcm_sframes_t delay = 0;
10901089
snd_pcm_sframes_t codec_delay = 0;
10911090
snd_pcm_sframes_t cpu_delay = 0;
10921091

1093-
/* clearing the previous total delay */
1094-
runtime->delay = 0;
1095-
10961092
offset = snd_soc_pcm_component_pointer(substream);
10971093

1098-
/* base delay if assigned in pointer callback */
1099-
delay = runtime->delay;
1100-
11011094
/* should be called *after* snd_soc_pcm_component_pointer() */
11021095
snd_soc_pcm_dai_delay(substream, &cpu_delay, &codec_delay);
11031096
snd_soc_pcm_component_delay(substream, &cpu_delay, &codec_delay);
11041097

1105-
runtime->delay = delay + cpu_delay + codec_delay;
1098+
runtime->delay = cpu_delay + codec_delay;
11061099

11071100
return offset;
11081101
}

0 commit comments

Comments
 (0)