From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Current snd_soc_of_parse_daifmt() detects [prefix]format, but "format" was unclear in some case. This patch enables [prefix]dai-format, too.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v4 -> v5
- don't exchange simle-xxx-card side
sound/soc/soc-core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d267a01..f8608b7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3946,11 +3946,16 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np, prefix = "";
/* - * check "[prefix]format = xxx" + * check "[prefix]dai-format = xxx" + * or "[prefix]format = xxx" * SND_SOC_DAIFMT_FORMAT_MASK area */ - snprintf(prop, sizeof(prop), "%sformat", prefix); + snprintf(prop, sizeof(prop), "%sdai-format", prefix); ret = of_property_read_string(np, prop, &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) {