@@ -1380,6 +1380,8 @@ void snd_soc_of_parse_dynamic(struct device_node *np,
struct snd_soc_dai_link *dai_link);
void snd_soc_of_parse_no_pcm(struct device_node *np,
struct snd_soc_dai_link *dai_link);
+void snd_soc_of_parse_platform_name(struct device_node *np,
+ struct snd_soc_dai_link *dai_link);
int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name);
@@ -237,6 +237,7 @@ static int simple_card_dai_link_of(struct device_node *node,
snd_soc_of_parse_dpcm(node, dai_link);
snd_soc_of_parse_dynamic(node, dai_link);
snd_soc_of_parse_no_pcm(node, dai_link);
+ snd_soc_of_parse_platform_name(node, dai_link);
/* Factor to mclk, used in hw_params() */
of_property_read_u32(node, "mclk-fs",
@@ -295,8 +296,8 @@ static int simple_card_dai_link_of(struct device_node *node,
goto dai_link_of_err;
}
- /* simple-card assumes platform == cpu */
- dai_link->platform_of_node = dai_link->cpu_of_node;
+ if (!dai_link->platform_name)
+ dai_link->platform_of_node = dai_link->cpu_of_node;
/* Link name is created from CPU/CODEC dai name */
name = devm_kzalloc(dev,
@@ -4767,6 +4767,13 @@ void snd_soc_of_parse_no_pcm(struct device_node *np,
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_no_pcm);
+void snd_soc_of_parse_platform_name(struct device_node *np,
+ struct snd_soc_dai_link *dai_link)
+{
+ of_property_read_string(np, "platform_name", &dai_link->platform_name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_of_parse_platform_name);
+
int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name)
{
In order to use DPCM, we need to be able to set the platform name per DAI. In particular, we need to use the "snd-soc-dummy" platform for DPCM backends. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- include/sound/soc.h | 2 ++ sound/soc/generic/simple-card.c | 5 +++-- sound/soc/soc-core.c | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-)