From: Jyri Sarha <jsarha@ti.com>
To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
linux-omap@vger.kernel.org
Cc: peter.ujfalusi@ti.com, broonie@kernel.org,
liam.r.girdwood@linux.intel.com, bcousson@baylibre.com,
detheridge@ti.com, Jyri Sarha <jsarha@ti.com>
Subject: [PATCH RFC v2 1/2] ASoC: core: Add is_cpu_dai_node-parameter to snd_soc_of_parse_daifmt()
Date: Mon, 10 Mar 2014 13:41:15 +0200 [thread overview]
Message-ID: <2fdbb57b2598e014a443bbe882af75072bddac6f.1394451329.git.jsarha@ti.com> (raw)
In-Reply-To: <cover.1394451329.git.jsarha@ti.com>
The sematics 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>
---
include/sound/soc.h | 3 ++-
sound/soc/soc-core.c | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index c0b6656..ecd0745 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1231,7 +1231,8 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
- const char *prefix);
+ const char *prefix,
+ bool is_cpu_dai_node);
int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name);
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
next prev parent reply other threads:[~2014-03-10 11:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 11:41 [PATCH RFC v2 0/2] Fix simple-card *-master DT parameter handling Jyri Sarha
2014-03-10 11:41 ` Jyri Sarha [this message]
2014-03-10 11:41 ` [PATCH RFC v2 2/2] ASoC: simple-card: Take snd_soc_of_parse_daifmt() change in to account Jyri Sarha
2014-03-11 10:50 ` [PATCH RFC v2 0/2] Fix simple-card *-master DT parameter handling Mark Brown
2014-03-12 1:13 ` [alsa-devel] " Kuninori Morimoto
2014-03-12 4:07 ` Kuninori Morimoto
2014-03-12 5:00 ` Richard Lee
2014-03-12 6:11 ` Kuninori Morimoto
2014-03-12 9:27 ` Jyri Sarha
2014-04-14 5:07 ` Kuninori Morimoto
2014-04-14 9:53 ` Jyri Sarha
2014-04-15 0:23 ` Kuninori Morimoto
2014-03-12 12:30 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2fdbb57b2598e014a443bbe882af75072bddac6f.1394451329.git.jsarha@ti.com \
--to=jsarha@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=bcousson@baylibre.com \
--cc=broonie@kernel.org \
--cc=detheridge@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).