summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-27 18:16:32 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-27 22:33:11 +0100
commit848dd8beef44df18f2eb61e00981b0692adb801b (patch)
treec860d13902c98fab86390e7b29027c063ffc3af5 /sound/soc/soc-core.c
parent8842c72afe9f954d9462da577a25d4a32bfe0a2b (diff)
downloadlwn-848dd8beef44df18f2eb61e00981b0692adb801b.tar.gz
lwn-848dd8beef44df18f2eb61e00981b0692adb801b.zip
ASoC: Add more natural support for no-DMA DAIs
Since we can now support multiple platforms allow machines to not specify a platform in a DAI link. Since the rest of the code requires that we have a struct device for all objects we do this by substituting in a dummy device that we register automatically. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c16
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)
struct snd_soc_codec *codec;
struct snd_soc_platform *platform;
struct snd_soc_dai *codec_dai, *cpu_dai;
+ const char *platform_name;
if (rtd->complete)
return 1;
@@ -1351,13 +1352,18 @@ find_codec:
dai_link->codec_name);
find_platform:
- /* do we already have the CODEC DAI for this link ? */
- if (rtd->platform) {
+ /* do we need a platform? */
+ if (rtd->platform)
goto out;
- }
- /* no, then find CPU DAI from registered DAIs*/
+
+ /* if there's no platform we match on the empty platform */
+ platform_name = dai_link->platform_name;
+ if (!platform_name)
+ platform_name = "snd-soc-dummy";
+
+ /* no, then find one from the set of registered platforms */
list_for_each_entry(platform, &platform_list, list) {
- if (!strcmp(platform->name, dai_link->platform_name)) {
+ if (!strcmp(platform->name, platform_name)) {
rtd->platform = platform;
goto out;
}