summaryrefslogtreecommitdiffstats
path: root/sound/soc/generic
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2019-05-16 13:51:26 -0400
committerMark Brown <broonie@kernel.org>2019-05-20 10:31:56 -0400
commit069d037aea98ffa64c26d4b1dc958fb8f39f5c2b (patch)
tree3e642fd4af6c8af6952fc75d540dc11ccfbbe7bc /sound/soc/generic
parent30d9d4ff53532087bc13ed29d7715df868794b5e (diff)
ASoC: simple-card: Fix configuration of DAI format
When configuring a codec to be both bit-clock and frame-master, it was found that the codec was always configured as bit-clock and frame-slave. Looking at the simple_dai_link_of() function there appears to be two problems with the configuration of the DAI format, which are ... 1. The function asoc_simple_parse_daifmt() is called before the function asoc_simple_parse_codec() and this means that the device-tree node for the codec has not been parsed yet, which is needed by the function asoc_simple_parse_daifmt() to determine who is the codec. 2. The phandle passed to asoc_simple_parse_daifmt() is the phandle to the 'codec' node and not the phandle of the actual codec defined by the 'sound-dai' property under the 'codec' node. Fix the above by moving the call to asoc_simple_parse_daifmt() after the the call to asoc_simple_parse_codec() and pass the phandle for the codec to asoc_simple_parse_daifmt(). Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r--sound/soc/generic/simple-card.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 9b568f578bcd..c2c8dcbcf795 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -283,11 +283,6 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
283 codec_dai = 283 codec_dai =
284 dai_props->codec_dai = &priv->dais[li->dais++]; 284 dai_props->codec_dai = &priv->dais[li->dais++];
285 285
286 ret = asoc_simple_parse_daifmt(dev, node, codec,
287 prefix, &dai_link->dai_fmt);
288 if (ret < 0)
289 goto dai_link_of_err;
290
291 simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix); 286 simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix);
292 287
293 ret = asoc_simple_parse_cpu(cpu, dai_link, &single_cpu); 288 ret = asoc_simple_parse_cpu(cpu, dai_link, &single_cpu);
@@ -298,6 +293,11 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
298 if (ret < 0) 293 if (ret < 0)
299 goto dai_link_of_err; 294 goto dai_link_of_err;
300 295
296 ret = asoc_simple_parse_daifmt(dev, node, dai_link->codecs->of_node,
297 prefix, &dai_link->dai_fmt);
298 if (ret < 0)
299 goto dai_link_of_err;
300
301 ret = asoc_simple_parse_platform(plat, dai_link); 301 ret = asoc_simple_parse_platform(plat, dai_link);
302 if (ret < 0) 302 if (ret < 0)
303 goto dai_link_of_err; 303 goto dai_link_of_err;