devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "Clément Péron" <peron.clem@gmail.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Jernej Škrabec" <jernej.skrabec@siol.net>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Marcus Cooper" <codekipper@gmail.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Samuel Holland" <samuel@sholland.org>
Subject: Re: ASoC: Question regarding device-tree multi-lane I2S for Allwinner SoC
Date: Mon, 9 Nov 2020 21:15:15 +0000	[thread overview]
Message-ID: <20201109211515.GO6380@sirena.org.uk> (raw)
In-Reply-To: <CAJiuCcfBOHhniDQOaB8ixU0pY9u0GVivkj7po-kozBV8LqmB6A@mail.gmail.com>

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

On Sun, Nov 01, 2020 at 06:30:15PM +0100, Clément Péron wrote:

Sorry about the delay here.

>     dai-tdm-slot-tx-mask-0 = <1 1>;
>     dai-tdm-slot-tx-mask-1 = <1 1>;
>     dai-tdm-slot-tx-mask-2 = <1 1>;
>     dai-tdm-slot-tx-mask-3 = <1 1>;

...

> This kind of representation gives the information that 2 slots should
> be enabled as TX per lane but don't give which slot to map.

The way the above should be interpreted is as a bitmask of slots to use,
I'm hoping that the above is for a system with 4 TX data wires each
using two slots (such designs get used for things like surround sound
amps).  

> I was thinking about a representation per lane but maybe it's a bit
> complicated  ?

>     dai-format = "dsp_a";
>     dai-tdm-slot-width = <32>;
>     // Lane 0 : Output 8 channels 0-7 using TDM
>     dai-tdm-slot-tx-mask-0 = <1 1 1 1 1 1 1 1>;
>     dai-tdm-slot-chmap-0 = <0 1 2 3 4 5 6 7>;
>     // Lane 1 : Output 3 channels 5-7 using TDM
>     dai-tdm-slot-tx-mask-1 = <1 1 1>;
>     dai-tdm-slot-chmap-1 = <5 6 7>;

I'd expect lane 1 to end up as

     dai-tdm-slot-tx-mask-1 = < 0 0 0 0 0 1 1 1 >;

>     // Lane 0 : Output channels 0,1
>     dai-tdm-slot-tx-mask-0 = <1 1>;
>     dai-tdm-slot-chmap-0 = <0 1>;
>     // Lane 1: Output channels 2,3
>     dai-tdm-slot-tx-mask-1 = <1 1>;
>     dai-tdm-slot-chmap-1 = <2 3>;
>     // Lane 2: Output channels 4,5
>     dai-tdm-slot-tx-mask-2 = <1 1>;
>     dai-tdm-slot-chmap-2 = <4 5>;
>     // Lane 3: Output channels 6,7
>     dai-tdm-slot-tx-mask-3 = <1 1>;
>     dai-tdm-slot-chmap-3 = <6 7>;

> What do you think? Do you have any remark / idea about this ?

I can see the use for the chmap binding, I can see that we might have a
system which has for example outputs labelled in some unusual order and
we'd want to remap them.  I'm less sure about defining a channel map in
a way that changes the meaning of the masks though, that seems like it'd
lead to incompatibilities.  How about making chmap also an array like
the mask is with the bits set in the mask indicating which slots in the
chmap are valid, that way your -3 would end up as:

      dai-tdm-slot-tx-mask-3 = <0 0 0 0 0 0 0 1 1>;
      dai-tdm-slot-chmap-3   = <0 0 0 0 0 0 0 6 7>;

and something that only understands the mask would at least get the
correct channels even if in a jumbled order?

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

      reply	other threads:[~2020-11-09 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 17:30 ASoC: Question regarding device-tree multi-lane I2S for Allwinner SoC Clément Péron
2020-11-09 21:15 ` 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=20201109211515.GO6380@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=codekipper@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@siol.net \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=perex@perex.cz \
    --cc=peron.clem@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=wens@csie.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 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).