diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-07-10 10:20:17 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-17 06:15:46 +0100 |
commit | bbde4a30c6b18dd034dcce41612907dc64817175 (patch) | |
tree | 674f876bf81016b7a1d22e1816d6c1eff0e0733a /sound/soc/soc-core.c | |
parent | 988bad5ee4d7138d26081f3661779b63725605d8 (diff) | |
download | lwn-bbde4a30c6b18dd034dcce41612907dc64817175.tar.gz lwn-bbde4a30c6b18dd034dcce41612907dc64817175.zip |
ASoC: soc-core.c: add snd_soc_copy_dai_args()
To use multi Component support, we need to check dai_args whether
Card could get DAI from args (CPU/Codec needs set dai_args on DAI driver).
If it could, we need to allocate dai_args for dlc.
This patch adds snd_soc_copy_dai_args() for it.
This is helper function for multi Component support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkgko94e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9fd7e633d374..a5b96c17633a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -809,6 +809,19 @@ static struct device_node return of_node; } +struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, struct of_phandle_args *args) +{ + struct of_phandle_args *ret = devm_kzalloc(dev, sizeof(*ret), GFP_KERNEL); + + if (!ret) + return NULL; + + *ret = *args; + + return ret; +} +EXPORT_SYMBOL_GPL(snd_soc_copy_dai_args); + static int snd_soc_is_matching_component( const struct snd_soc_dai_link_component *dlc, struct snd_soc_component *component) |