summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-07-20 10:17:39 +0900
committerMark Brown <broonie@kernel.org>2020-07-23 19:07:19 +0100
commit0ceef681e34a61afcd77af0837b2132925c5bad4 (patch)
tree97c8af1bd0a9a2df249a69fa17cb0ac5eea42ff3 /include/sound
parent0c5b270b2e6c92b6a752868a3a1abddc3c52186f (diff)
downloadlinux-0ceef681e34a61afcd77af0837b2132925c5bad4.tar.gz
linux-0ceef681e34a61afcd77af0837b2132925c5bad4.tar.bz2
linux-0ceef681e34a61afcd77af0837b2132925c5bad4.zip
ASoC: soc-xxx: add asoc_substream_to_rtd()
Current soc-xxx are getting rtd from substream by rtd = substream->private_data; But, getting data from "private_data" is very unclear. This patch adds asoc_substream_to_rtd() macro which is easy to understand that rtd from substream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wo2z0yve.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 59235e553630..acbb5efb28ef 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1168,6 +1168,8 @@ struct snd_soc_pcm_runtime {
/* see soc_new_pcm_runtime() */
#define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
#define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->num_cpus]
+#define asoc_substream_to_rtd(substream) \
+ (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream)
#define for_each_rtd_components(rtd, i, component) \
for ((i) = 0, component = NULL; \