aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2016-11-10 20:19:03 -0500
committerMark Brown <broonie@kernel.org>2016-11-11 10:19:35 -0500
commitb6defcca0a604129155ae472b116a2e1688d8995 (patch)
tree6ec8c4baa3888f9815a7c9c6391556868979b0d9
parent1ad8ec535b997ed36c0f32c2616206725258dd30 (diff)
ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_prefix
It is assuming that the card related information is located on "card" node, but graph case doesn't have it. This patch adds node parameter to adjust for graph support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h6
-rw-r--r--sound/soc/soc-core.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6dffa9540a30..346223b38e0d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1651,7 +1651,11 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
1651 unsigned int *rx_mask, 1651 unsigned int *rx_mask,
1652 unsigned int *slots, 1652 unsigned int *slots,
1653 unsigned int *slot_width); 1653 unsigned int *slot_width);
1654void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, 1654#define snd_soc_of_parse_audio_prefix(card, codec_conf, of_node, propname) \
1655 snd_soc_of_parse_audio_prefix_from_node(card, NULL, codec_conf, \
1656 of_node, propname)
1657void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
1658 struct device_node *np,
1655 struct snd_soc_codec_conf *codec_conf, 1659 struct snd_soc_codec_conf *codec_conf,
1656 struct device_node *of_node, 1660 struct device_node *of_node,
1657 const char *propname); 1661 const char *propname);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 81b604151f26..e4c90806fa10 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3595,15 +3595,18 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
3595} 3595}
3596EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); 3596EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);
3597 3597
3598void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, 3598void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
3599 struct device_node *np,
3599 struct snd_soc_codec_conf *codec_conf, 3600 struct snd_soc_codec_conf *codec_conf,
3600 struct device_node *of_node, 3601 struct device_node *of_node,
3601 const char *propname) 3602 const char *propname)
3602{ 3603{
3603 struct device_node *np = card->dev->of_node;
3604 const char *str; 3604 const char *str;
3605 int ret; 3605 int ret;
3606 3606
3607 if (!np)
3608 np = card->dev->of_node;
3609
3607 ret = of_property_read_string(np, propname, &str); 3610 ret = of_property_read_string(np, propname, &str);
3608 if (ret < 0) { 3611 if (ret < 0) {
3609 /* no prefix is not error */ 3612 /* no prefix is not error */
@@ -3613,7 +3616,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
3613 codec_conf->of_node = of_node; 3616 codec_conf->of_node = of_node;
3614 codec_conf->name_prefix = str; 3617 codec_conf->name_prefix = str;
3615} 3618}
3616EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix); 3619EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix_from_node);
3617 3620
3618int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card, 3621int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card,
3619 struct device_node *np, 3622 struct device_node *np,