Commit 069d037a authored by Jon Hunter's avatar Jon Hunter Committed by Mark Brown

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: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 30d9d4ff
...@@ -283,11 +283,6 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, ...@@ -283,11 +283,6 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
codec_dai = codec_dai =
dai_props->codec_dai = &priv->dais[li->dais++]; dai_props->codec_dai = &priv->dais[li->dais++];
ret = asoc_simple_parse_daifmt(dev, node, codec,
prefix, &dai_link->dai_fmt);
if (ret < 0)
goto dai_link_of_err;
simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix); simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix);
ret = asoc_simple_parse_cpu(cpu, dai_link, &single_cpu); 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,6 +293,11 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
if (ret < 0) if (ret < 0)
goto dai_link_of_err; goto dai_link_of_err;
ret = asoc_simple_parse_daifmt(dev, node, dai_link->codecs->of_node,
prefix, &dai_link->dai_fmt);
if (ret < 0)
goto dai_link_of_err;
ret = asoc_simple_parse_platform(plat, dai_link); ret = asoc_simple_parse_platform(plat, dai_link);
if (ret < 0) if (ret < 0)
goto dai_link_of_err; goto dai_link_of_err;
......
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