summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-04-20 01:33:24 +0000
committerMark Brown <broonie@kernel.org>2017-05-17 10:21:19 +0100
commit5711c97920377827da4bbc18233ffb08c6e3bbef (patch)
tree1648e5ed010ad6a6afe3f910c599faa899560ef8 /sound/soc/soc-core.c
parentac1e6958d3be29a28889b09e4eec1798eccc1606 (diff)
ASoC: soc-core: enable "dai-format" on snd_soc_of_parse_daifmt()
Current snd_soc_of_parse_daifmt() detects [prefix]format, but "format" was unclear in some case. This patch checks "dai-format" first, and try to check "[prefix]format" if "dai-format" was not exist. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index aae099c0e502..ab7a07f86ab8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3960,11 +3960,15 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
prefix = "";
/*
- * check "[prefix]format = xxx"
+ * check "dai-format = xxx"
+ * or "[prefix]format = xxx"
* SND_SOC_DAIFMT_FORMAT_MASK area
*/
- snprintf(prop, sizeof(prop), "%sformat", prefix);
- ret = of_property_read_string(np, prop, &str);
+ ret = of_property_read_string(np, "dai-format", &str);
+ if (ret < 0) {
+ snprintf(prop, sizeof(prop), "%sformat", prefix);
+ ret = of_property_read_string(np, prop, &str);
+ }
if (ret == 0) {
for (i = 0; i < ARRAY_SIZE(of_fmt_table); i++) {
if (strcmp(str, of_fmt_table[i].name) == 0) {