* [PATCH RFC 1/2] ASoC: core: Add is_cpu_dai_node-parameter to snd_soc_of_parse_daifmt()
2014-03-10 11:28 [PATCH RFC 0/2] Fix simple-card *-master DT parameter handling Jyri Sarha
@ 2014-03-10 11:28 ` Jyri Sarha
2014-03-10 11:28 ` [PATCH RFC 2/2] ASoC: simple-card: Take snd_soc_of_parse_daifmt() change in to account Jyri Sarha
1 sibling, 0 replies; 3+ messages in thread
From: Jyri Sarha @ 2014-03-10 11:28 UTC (permalink / raw)
To: alsa-devel, devicetree, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, bcousson, detheridge,
Jyri Sarha
The schematics of bitclock-master and frame-master DT parameters
should be inversed when parsing a cpu-dai node.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
sound/soc/soc-core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8ddb15c..dfff75f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4613,7 +4613,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
- const char *prefix)
+ const char *prefix,
+ bool is_cpu_dai_node)
{
int ret, i;
char prop[128];
@@ -4700,6 +4701,11 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
snprintf(prop, sizeof(prop), "%sframe-master", prefix);
frame = !!of_get_property(np, prop, NULL);
+ if (is_cpu_dai_node) {
+ bit = !bit;
+ frame = !frame;
+ }
+
switch ((bit << 4) + frame) {
case 0x11:
format |= SND_SOC_DAIFMT_CBM_CFM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH RFC 2/2] ASoC: simple-card: Take snd_soc_of_parse_daifmt() change in to account
2014-03-10 11:28 [PATCH RFC 0/2] Fix simple-card *-master DT parameter handling Jyri Sarha
2014-03-10 11:28 ` [PATCH RFC 1/2] ASoC: core: Add is_cpu_dai_node-parameter to snd_soc_of_parse_daifmt() Jyri Sarha
@ 2014-03-10 11:28 ` Jyri Sarha
1 sibling, 0 replies; 3+ messages in thread
From: Jyri Sarha @ 2014-03-10 11:28 UTC (permalink / raw)
To: alsa-devel, devicetree, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, bcousson, detheridge,
Jyri Sarha
snd_soc_of_parse_daifmt() needs to know if it is parsing a cpu-dai node.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
sound/soc/generic/simple-card.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 7cabcc5..7cbbf44 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -87,7 +87,8 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
unsigned int daifmt,
struct asoc_simple_dai *dai,
const struct device_node **p_node,
- const char **name)
+ const char **name,
+ bool is_cpu_dai_node)
{
struct device_node *node;
struct clk *clk;
@@ -117,7 +118,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
* bitclock-master, frame-master
* and specific "format" if it has
*/
- dai->fmt = snd_soc_of_parse_daifmt(np, NULL);
+ dai->fmt = snd_soc_of_parse_daifmt(np, NULL, is_cpu_dai_node);
dai->fmt |= daifmt;
/*
@@ -165,7 +166,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name");
/* get CPU/CODEC common format via simple-audio-card,format */
- priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
+ priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,", 0) &
(SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
/* off-codec widgets */
@@ -191,7 +192,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
&priv->cpu_dai,
&dai_link->cpu_of_node,
- &dai_link->cpu_dai_name);
+ &dai_link->cpu_dai_name,
+ true);
if (ret < 0)
return ret;
@@ -202,7 +204,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
&priv->codec_dai,
&dai_link->codec_of_node,
- &dai_link->codec_dai_name);
+ &dai_link->codec_dai_name,
+ false);
if (ret < 0)
return ret;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread