Commit bbde4a30 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkgko94e.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 988bad5e
...@@ -1338,6 +1338,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, ...@@ -1338,6 +1338,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms, void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms,
struct snd_soc_dai_link_component *cpus); struct snd_soc_dai_link_component *cpus);
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
struct of_phandle_args *args);
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args); struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
struct snd_soc_dai_driver *dai_drv, struct snd_soc_dai_driver *dai_drv,
......
...@@ -809,6 +809,19 @@ static struct device_node ...@@ -809,6 +809,19 @@ static struct device_node
return of_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( static int snd_soc_is_matching_component(
const struct snd_soc_dai_link_component *dlc, const struct snd_soc_dai_link_component *dlc,
struct snd_soc_component *component) struct snd_soc_component *component)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment