[alsa-devel] [PATCH 11/49] ASoC: simple-card-core: add asoc_simple_card_parse_card_widgets()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Fri May 20 11:46:04 CEST 2016
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
simple-card is supporting widgets.
This patch makes this method simple style standard.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
include/sound/simple_card_core.h | 2 ++
sound/soc/generic/simple-card-core.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h
index d66b536..41a66e8 100644
--- a/include/sound/simple_card_core.h
+++ b/include/sound/simple_card_core.h
@@ -39,5 +39,7 @@ int asoc_simple_card_parse_card_prefix(struct snd_soc_card *card,
char *prefix);
int asoc_simple_card_parse_card_route(struct snd_soc_card *card,
char *prefix);
+int asoc_simple_card_parse_card_widgets(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 bfe3bf4..baabb50 100644
--- a/sound/soc/generic/simple-card-core.c
+++ b/sound/soc/generic/simple-card-core.c
@@ -158,3 +158,19 @@ int asoc_simple_card_parse_card_route(struct snd_soc_card *card,
return ret;
}
EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_route);
+
+int asoc_simple_card_parse_card_widgets(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), "%swidgets", prefix);
+
+ if (of_property_read_bool(np, prop))
+ ret = snd_soc_of_parse_audio_simple_widgets(card, prop);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_widgets);
--
1.9.1
More information about the Alsa-devel
mailing list