mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Peter Rosin <peda@axentia.se>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	peda@lysator.liu.se
Subject: Re: [PATCH v3] ASoC: docs: add clocking examples for DAI formats
Date: Tue, 19 Apr 2016 11:38:59 +0100	[thread overview]
Message-ID: <20160419103859.GQ3217@sirena.org.uk> (raw)
In-Reply-To: <1461060688-19410-1-git-send-email-peda@axentia.se>

[-- Attachment #1: Type: text/plain, Size: 2724 bytes --]

On Tue, Apr 19, 2016 at 12:11:28PM +0200, Peter Rosin wrote:

> +I2S
> +
> +LRC should have its flanks synchronized with a negative flank of BCLK.
> +The left channel word starts one BCLK cycle after a negative flank of LRC, and

Clock edges are normally referred to as such and have rising and falling
edges, please don't invent new terminology.  In general this is using
really strange language which makes it hard to follow.  Note also that
except for modes where clocks need to be exactly synchronized like left
justified the important thing is usually when the data can be sampled.
It takes time for changes to propagate so there's a distinction between
setting a state and when the state is looked at.

> +if LRC is not matching the word size. Also, see
> +https://www.sparkfun.com/datasheets/BreakoutBoards/I2SBUS.pdf

Please make it clear that this is the official spec (there must be a
better link for it, this was literally the first hit on Google).

> +Left Justified (aka MSB)
> +
> +LRC should have its flanks synchronized with a negative flank of BCLK.
> +The left channel word starts directly after a positive flank of LRC, and the
> +right channel word starts directly after a negative flank of LRC. The words

This is unclear - what does "directly after" mean?  Is it the clock
after or do you mean that the data signal needs to change at the same
time as the falling edge of the LRCLK?  It should be the latter.

> +start with the MSB. Receivers must truncate words if more bits per word are
> +transmitted than they can use, and transmitters must pad words with zeros if
> +LRC is not matching the word size.

Neither of these is really true, both things are undefined behaviour
(this is how TDM works).  Transmitters can send anything or tristate and
it doesn't make much practical difference what happens on the recieve
side unless there's TDM.

> +Right Justified (aka LSB)
> +
> +LRC should have its flanks synchronized with a negative flank of BCLK.
> +The left channel word end right before a negative flank of LRC, and the right

Again, this is unclear - what is "right before"?  The final bit needs to
be sent on the BCLK edge preceeding the LRCLK transition.

> +DSP mode A

> +LRC should have positive flanks synchronized with a negative flank of BCLK.

LRCLK needs to rise before BCLK, it's good to do it on the preceeding
falling edge such that the timing is as relaxed as possible for the
reciever but not 100% a requirement.

> +The left channel word starts one BCLK after a positive flank of LRC, and the

It can be sampled...

> +right channel word starts directly after the left channel word. The words
> +start with MSB.

This isn't a stereo format, there can be any number of channels.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2016-04-19 10:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 10:11 Peter Rosin
2016-04-19 10:38 ` Mark Brown [this message]

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=20160419103859.GQ3217@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=corbet@lwn.net \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=peda@lysator.liu.se \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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

all inboxes | Powered by JetHome®