diff mbox

[10/49] ASoC: simple-card-core: add asoc_simple_card_parse_card_widgets()

Message ID 877feprrub.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Kuninori Morimoto May 20, 2016, 9:45 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

simple-card is supporting widgets.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/simple_card_core.h     |  2 ++
 sound/soc/generic/simple-card-core.c | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)
diff mbox

Patch

diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h
index 89172aa..d66b536 100644
--- a/include/sound/simple_card_core.h
+++ b/include/sound/simple_card_core.h
@@ -37,5 +37,7 @@  int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card,
 				       struct snd_soc_dai_link *dai_link,
 				       struct snd_soc_codec_conf *codec_conf,
 				       char *prefix);
+int asoc_simple_card_parse_card_route(struct snd_soc_card *card,
+				      char *prefix);
 
 #endif /* __SIMPLE_CARD_CORE_H */
diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c
index bc1f2a9..bfe3bf4 100644
--- a/sound/soc/generic/simple-card-core.c
+++ b/sound/soc/generic/simple-card-core.c
@@ -142,3 +142,19 @@  int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card,
 	return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_prefix);
+
+int asoc_simple_card_parse_card_route(struct snd_soc_card *card,
+				      char *prefix)
+{
+	struct device_node *np = card->dev->of_node;
+	char prop[128];
+	int ret = 0;
+
+	snprintf(prop, sizeof(prop), "%srouting", prefix);
+
+	if (of_property_read_bool(np, prop))
+		ret = snd_soc_of_parse_audio_routing(card, prop);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_route);