Commit 5711c979 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ac1e6958
...@@ -3960,11 +3960,15 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np, ...@@ -3960,11 +3960,15 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
prefix = ""; prefix = "";
/* /*
* check "[prefix]format = xxx" * check "dai-format = xxx"
* or "[prefix]format = xxx"
* SND_SOC_DAIFMT_FORMAT_MASK area * SND_SOC_DAIFMT_FORMAT_MASK area
*/ */
snprintf(prop, sizeof(prop), "%sformat", prefix); ret = of_property_read_string(np, "dai-format", &str);
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) { if (ret == 0) {
for (i = 0; i < ARRAY_SIZE(of_fmt_table); i++) { for (i = 0; i < ARRAY_SIZE(of_fmt_table); i++) {
if (strcmp(str, of_fmt_table[i].name) == 0) { if (strcmp(str, of_fmt_table[i].name) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment