From e90c0220073862ccf66ea187d305971ba796e088 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 18 Sep 2026 01:43:16 +0000 Subject: [PATCH] ASoC: soc-dai: add snd_soc_dai_to_driver() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DAI parameter will be capsuled soon, will be not enable to access from each drivers. Add snd_soc_dai_to_driver() to get driver from DAI. Signed-off-by: Kuninori Morimoto Reviewed-by: Alvin Šipraga Link: https://patch.msgid.link/87jyojjpvv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc-dai.h | 1 + sound/soc/soc-dai.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 7f8a64db0dc7..375a8674d145 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -213,6 +213,7 @@ int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai, unsigned int *rx_num, unsigned int *rx_slot); struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai); +struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai); int snd_soc_dai_is_dummy(const struct snd_soc_dai *dai); int snd_soc_dai_add_controls(struct snd_soc_dai *dai, const struct snd_kcontrol_new *controls, int num_controls); diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index a859acc4b28f..3e553e8c0535 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -26,6 +26,12 @@ struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai } EXPORT_SYMBOL_GPL(snd_soc_dai_to_component); +struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai) +{ + return dai->driver; +} +EXPORT_SYMBOL_GPL(snd_soc_dai_to_driver); + /* * We might want to check substream by using list. * In such case, we can update these macros.