diff options
| author | Kuninori Morimoto <[email protected]> | 2021-11-16 16:45:34 +0900 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2021-11-29 12:19:45 +0000 |
| commit | dd894f4caf7df77cf72dc6ae7547900b55d0de42 (patch) | |
| tree | 7ef276681e019511337c3fb172f2521ddf248119 | |
| parent | 796b64a72db0b416f0aa1815e87aa28388b4715d (diff) | |
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
| -rw-r--r-- | sound/soc/soc-pcm.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 493d231a2ffd..3b4412183344 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1080,29 +1080,22 @@ start_err: /* * soc level wrapper for pointer callback * If cpu_dai, codec_dai, component driver has the delay callback, then - * the runtime->delay will be updated accordingly. + * the runtime->delay will be updated via snd_soc_pcm_component/dai_delay(). */ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_uframes_t offset = 0; - snd_pcm_sframes_t delay = 0; snd_pcm_sframes_t codec_delay = 0; snd_pcm_sframes_t cpu_delay = 0; - /* clearing the previous total delay */ - runtime->delay = 0; - offset = snd_soc_pcm_component_pointer(substream); - /* base delay if assigned in pointer callback */ - delay = runtime->delay; - /* should be called *after* snd_soc_pcm_component_pointer() */ snd_soc_pcm_dai_delay(substream, &cpu_delay, &codec_delay); snd_soc_pcm_component_delay(substream, &cpu_delay, &codec_delay); - runtime->delay = delay + cpu_delay + codec_delay; + runtime->delay = cpu_delay + codec_delay; return offset; } |