aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-07-15 03:07:42 -0400
committerMark Brown <broonie@kernel.org>2015-07-16 16:59:41 -0400
commit5e3cdaa20816dd2fe4dc17d06a9f0dae0abc930c (patch)
treef0befb114f986347a7eadcf1db7c6f3c7b990b86
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff)
ASoC: core: add snd_soc_of_parse_audio_prefix()
Current ASoC can add name_prefix for DAPM, and it is necessary for route settings. This patch adds snd_soc_of_parse_audio_prefix() for this purpose. It will be used with snd_soc_of_parse_audio_routing(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h4
-rw-r--r--sound/soc/soc-core.c20
2 files changed, 24 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 93df8bf9d54a..75cd19ced804 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1604,6 +1604,10 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
1604int snd_soc_of_parse_tdm_slot(struct device_node *np, 1604int snd_soc_of_parse_tdm_slot(struct device_node *np,
1605 unsigned int *slots, 1605 unsigned int *slots,
1606 unsigned int *slot_width); 1606 unsigned int *slot_width);
1607void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
1608 struct snd_soc_codec_conf *codec_conf,
1609 struct device_node *of_node,
1610 const char *propname);
1607int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, 1611int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
1608 const char *propname); 1612 const char *propname);
1609unsigned int snd_soc_of_parse_daifmt(struct device_node *np, 1613unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3a4a5c0e3f97..fd15d5418647 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3303,6 +3303,26 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
3303} 3303}
3304EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); 3304EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);
3305 3305
3306void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
3307 struct snd_soc_codec_conf *codec_conf,
3308 struct device_node *of_node,
3309 const char *propname)
3310{
3311 struct device_node *np = card->dev->of_node;
3312 const char *str;
3313 int ret;
3314
3315 ret = of_property_read_string(np, propname, &str);
3316 if (ret < 0) {
3317 /* no prefix is not error */
3318 return;
3319 }
3320
3321 codec_conf->of_node = of_node;
3322 codec_conf->name_prefix = str;
3323}
3324EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix);
3325
3306int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, 3326int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
3307 const char *propname) 3327 const char *propname)
3308{ 3328{