summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorKuninori Morimoto2019-01-21 01:32:32 +0100
committerMark Brown2019-01-21 19:12:19 +0100
commit910fdcabedd2354d161b1beab6ad7dc7e859651d (patch)
tree963348a19538e7dd5f6c186c4393f4ac7eddc440 /sound/soc/soc-core.c
parentASoC: soc.h: add explanation of legacy/modern style of dai_link (diff)
downloadkernel-qcow2-linux-910fdcabedd2354d161b1beab6ad7dc7e859651d.tar.gz
kernel-qcow2-linux-910fdcabedd2354d161b1beab6ad7dc7e859651d.tar.xz
kernel-qcow2-linux-910fdcabedd2354d161b1beab6ad7dc7e859651d.zip
ASoC: soc-core: add .num_platform for dai_link
Current snd_soc_dai_link is starting to use snd_soc_dai_link_component (= modern) style for Platform, but it is still assuming single Platform so far. We will need to have multi Platform support in the not far future. Currently only simple card is using it as sound card driver, and other drivers are converted to it from legacy style by snd_soc_init_platform(). To avoid future problem of multi Platform support, let's add num_platforms before it is too late. In the same time, to make it same naming mothed, "platform" should be "platforms". This patch fixup it too. Signed-off-by: Kuninori Morimoto <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.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index de2851f1b3df..2c63921675d5 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -915,7 +915,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card,
/* find one from the set of registered platforms */
for_each_component(component) {
- if (!snd_soc_is_matching_component(dai_link->platform,
+ if (!snd_soc_is_matching_component(dai_link->platforms,
component))
continue;
@@ -1026,7 +1026,7 @@ static void soc_remove_dai_links(struct snd_soc_card *card)
static int snd_soc_init_platform(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link)
{
- struct snd_soc_dai_link_component *platform = dai_link->platform;
+ struct snd_soc_dai_link_component *platform = dai_link->platforms;
/*
* REMOVE ME
@@ -1046,7 +1046,8 @@ static int snd_soc_init_platform(struct snd_soc_card *card,
if (!platform)
return -ENOMEM;
- dai_link->platform = platform;
+ dai_link->platforms = platform;
+ dai_link->num_platforms = 1;
dai_link->legacy_platform = 1;
platform->name = dai_link->platform_name;
platform->of_node = dai_link->platform_of_node;
@@ -1136,11 +1137,19 @@ static int soc_init_dai_link(struct snd_soc_card *card,
}
}
+ /* FIXME */
+ if (link->num_platforms > 1) {
+ dev_err(card->dev,
+ "ASoC: multi platform is not yet supported %s\n",
+ link->name);
+ return -EINVAL;
+ }
+
/*
* Platform may be specified by either name or OF node, but
* can be left unspecified, and a dummy platform will be used.
*/
- if (link->platform->name && link->platform->of_node) {
+ if (link->platforms->name && link->platforms->of_node) {
dev_err(card->dev,
"ASoC: Both platform name/of_node are set for %s\n",
link->name);
@@ -1151,8 +1160,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
* Defer card registartion if platform dai component is not added to
* component list.
*/
- if ((link->platform->of_node || link->platform->name) &&
- !soc_find_component(link->platform->of_node, link->platform->name))
+ if ((link->platforms->of_node || link->platforms->name) &&
+ !soc_find_component(link->platforms->of_node, link->platforms->name))
return -EPROBE_DEFER;
/*
@@ -1956,7 +1965,7 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
dev_err(card->dev, "init platform error");
continue;
}
- dai_link->platform->name = component->name;
+ dai_link->platforms->name = component->name;
/* convert non BE into BE */
dai_link->no_pcm = 1;