aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/generic/simple-card.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 33feee9ca8c3..c87e58504a62 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -307,6 +307,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
307 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx); 307 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx);
308 struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx); 308 struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx);
309 struct device_node *cpu = NULL; 309 struct device_node *cpu = NULL;
310 struct device_node *plat = NULL;
310 struct device_node *codec = NULL; 311 struct device_node *codec = NULL;
311 char *name; 312 char *name;
312 char prop[128]; 313 char prop[128];
@@ -320,6 +321,9 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
320 snprintf(prop, sizeof(prop), "%scpu", prefix); 321 snprintf(prop, sizeof(prop), "%scpu", prefix);
321 cpu = of_get_child_by_name(node, prop); 322 cpu = of_get_child_by_name(node, prop);
322 323
324 snprintf(prop, sizeof(prop), "%splat", prefix);
325 plat = of_get_child_by_name(node, prop);
326
323 snprintf(prop, sizeof(prop), "%scodec", prefix); 327 snprintf(prop, sizeof(prop), "%scodec", prefix);
324 codec = of_get_child_by_name(node, prop); 328 codec = of_get_child_by_name(node, prop);
325 329
@@ -352,8 +356,16 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
352 goto dai_link_of_err; 356 goto dai_link_of_err;
353 } 357 }
354 358
355 /* Simple Card assumes platform == cpu */ 359 if (plat) {
356 dai_link->platform_of_node = dai_link->cpu_of_node; 360 struct of_phandle_args args;
361
362 ret = of_parse_phandle_with_args(plat, "sound-dai",
363 "#sound-dai-cells", 0, &args);
364 dai_link->platform_of_node = args.np;
365 } else {
366 /* Assumes platform == cpu */
367 dai_link->platform_of_node = dai_link->cpu_of_node;
368 }
357 369
358 /* DAI link name is created from CPU/CODEC dai name */ 370 /* DAI link name is created from CPU/CODEC dai name */
359 name = devm_kzalloc(dev, 371 name = devm_kzalloc(dev,