diff options
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9dc13113fa26..16be3e5cf9e7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1299,6 +1299,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num) | |||
1299 | struct snd_soc_codec *codec; | 1299 | struct snd_soc_codec *codec; |
1300 | struct snd_soc_platform *platform; | 1300 | struct snd_soc_platform *platform; |
1301 | struct snd_soc_dai *codec_dai, *cpu_dai; | 1301 | struct snd_soc_dai *codec_dai, *cpu_dai; |
1302 | const char *platform_name; | ||
1302 | 1303 | ||
1303 | if (rtd->complete) | 1304 | if (rtd->complete) |
1304 | return 1; | 1305 | return 1; |
@@ -1351,13 +1352,18 @@ find_codec: | |||
1351 | dai_link->codec_name); | 1352 | dai_link->codec_name); |
1352 | 1353 | ||
1353 | find_platform: | 1354 | find_platform: |
1354 | /* do we already have the CODEC DAI for this link ? */ | 1355 | /* do we need a platform? */ |
1355 | if (rtd->platform) { | 1356 | if (rtd->platform) |
1356 | goto out; | 1357 | goto out; |
1357 | } | 1358 | |
1358 | /* no, then find CPU DAI from registered DAIs*/ | 1359 | /* if there's no platform we match on the empty platform */ |
1360 | platform_name = dai_link->platform_name; | ||
1361 | if (!platform_name) | ||
1362 | platform_name = "snd-soc-dummy"; | ||
1363 | |||
1364 | /* no, then find one from the set of registered platforms */ | ||
1359 | list_for_each_entry(platform, &platform_list, list) { | 1365 | list_for_each_entry(platform, &platform_list, list) { |
1360 | if (!strcmp(platform->name, dai_link->platform_name)) { | 1366 | if (!strcmp(platform->name, platform_name)) { |
1361 | rtd->platform = platform; | 1367 | rtd->platform = platform; |
1362 | goto out; | 1368 | goto out; |
1363 | } | 1369 | } |