All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatol Pomozov <anatol.pomozov@gmail.com>
To: alsa-devel@alsa-project.org
Cc: broonie@kernel.org, Anatol Pomozov <anatol.pomozov@gmail.com>
Subject: [PATCH] ASoC: Document DAI signal polarity
Date: Thu,  8 Oct 2015 09:37:51 -0700	[thread overview]
Message-ID: <1444322271-2819-1-git-send-email-anatol.pomozov@gmail.com> (raw)

Currently there is no clear definition of what FSYNC polarity is.
Different drivers use its own definition of what is "normal" and what is
"inverted" fsync. This leads to compatibility problems between drivers.

For example TegraX1 driver assumes that DSP-A format with frames
starting at rising FSYNC edge has "inverted" polarity,
while RT5677 assumes it is "normal" polarity.

Explicitly specify meaning of BCLK/FSYNC polarity to avoid future
compatibility problems.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
---
 include/sound/soc-dai.h | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 2df96b1..91e2e61 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -48,10 +48,25 @@ struct snd_compr_stream;
 #define SND_SOC_DAIFMT_GATED		(0 << 4) /* clock is gated */
 
 /*
- * DAI hardware signal inversions.
+ * DAI hardware signal polarity.
  *
  * Specifies whether the DAI can also support inverted clocks for the specified
  * format.
+ *
+ * BCLK:
+ * - "normal" polarity means signal is available at rising edge of BCLK
+ * - "inverted" polarity means signal is available at falling edge of BCLK
+ *
+ * FSYNC "normal" polarity depends on the frame format:
+ * - I2S: frame consists of left then right channel data. Left channel starts
+ *      with falling FSYNC edge, right channel starts with rising FSYNC edge.
+ * - Left/Right Justified: frame consists of left then right channel data.
+ *      Left channel starts with rising FSYNC edge, right channel starts with
+ *      falling FSYNC edge.
+ * - DSP A/B: Frame starts with rising FSYNC edge.
+ * - AC97: Frame starts with rising FSYNC edge.
+ *
+ * "Negative" FSYNC polarity is the one opposite of "normal" polarity.
  */
 #define SND_SOC_DAIFMT_NB_NF		(0 << 8) /* normal bit clock + frame */
 #define SND_SOC_DAIFMT_NB_IF		(2 << 8) /* normal BCLK + inv FRM */
-- 
2.6.0.rc2.230.g3dd15c0

             reply	other threads:[~2015-10-08 16:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 16:37 Anatol Pomozov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-10-02 15:33 [PATCH] ASoC: Document DAI signal polarity Anatol Pomozov
2015-10-02 17:01 ` Benoît Thébaudeau
2015-10-01 18:09 Anatol Pomozov
2015-10-01 19:18 ` Benoît Thébaudeau
2015-10-05 15:12 ` Mark Brown
2015-10-05 19:20   ` Benoît Thébaudeau
2015-10-06  9:33     ` Mark Brown
2015-08-31 20:50 Anatol Pomozov
2015-09-01  1:27 ` Albert Chen
2015-09-01  7:20 ` arnaud.mouiche
2015-09-18 13:54 ` Mark Brown
2015-09-29 21:34   ` Anatol Pomozov
2015-09-30 18:10     ` Mark Brown
2015-09-30 19:08       ` Anatol Pomozov
2015-09-30 19:22         ` Benoît Thébaudeau
2015-09-30 22:33           ` Mark Brown
2015-09-30 19:28         ` Mark Brown
2015-09-30 19:34         ` Lars-Peter Clausen

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=1444322271-2819-1-git-send-email-anatol.pomozov@gmail.com \
    --to=anatol.pomozov@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.