devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Sameer Pujar <spujar@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	devicetree@vger.kernel.org, robh+dt@kernel.org,
	Jon Hunter <jonathanh@nvidia.com>,
	linux-tegra@vger.kernel.org
Subject: Re: Query on audio-graph-card DT binding
Date: Fri, 5 Jan 2024 09:11:29 +0100	[thread overview]
Message-ID: <ZZe5sTNz005Tt4jk@orome.fritz.box> (raw)
In-Reply-To: <3faec2e9-8cd9-46f9-8807-801922de0edf@nvidia.com>

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

On Fri, Jan 05, 2024 at 10:24:18AM +0530, Sameer Pujar wrote:
> 
> 
> On 04-01-2024 22:52, Mark Brown wrote:
> > On Thu, Jan 04, 2024 at 06:07:22PM +0100, Thierry Reding wrote:
> > > On Tue, Dec 26, 2023 at 09:58:02PM +0530, Sameer Pujar wrote:
> > > >                /-----> codec1 endpoint
> > > >               /
> > > > CPU endpoint \
> > > >                \-----> codec2 endpoint
> > > Can you describe the use-case? Is there a need to switch between codec1
> > > and codec2 endpoints or do they receive the same data in parallel all
> > > the time?
> > > Could this perhaps be described by adding multiple CPU ports with one
> > > endpoint each?
> > Don't know about the specific use case that Sameer is looking at but to
> > me this looks like a surround sound setup where multiple stereo (or
> > mono) DACs are wired in parallel, either with a TDM setup or with
> > multiple data lines.  There's multiple CODECs all taking input from a
> > single host controller.
> 
> Yes, it is a TDM use case where the same clock and data line is shared with
> multiple CODECs. Each CODEC is expected to pickup data based on the allotted
> TDM slot.
> 
> It is possible to create multiple CPU dummy endpoints and use these in DT
> binding for each CODEC. I am not sure if this is the best way right now.
> There are few things to note here with dummy endpoints. First, it leads to
> bit of duplication of endpoint DAIs and DAI links for these. Please note
> that host controller pins are actually shared with external CODECs. So
> shouldn't DT provide a way to represent this connection? Second, ASoC
> provides a way to represent multiple CODECs on a single DAI link in the
> driver and my concern is to understand if present binding can be extended to
> represent this scenario. Third, one of the user wanted to connect 6 CODECs
> and that is the maximum request I have seen so far. I can expose additional
> dummy CPU DAIs keeping this maximum request in mind, but not sure if users
> would like to extend it further. The concern I have is, how can we make this
> easily extendible and simpler to use?
> 
> With custom DT bindings it may be simpler to resolve this, but Tegra audio
> presently relies on standard graph remote-endpoints binding. So I guess
> diverging from this may not be preferable?

This seems like a legitimate use-case for the graph bindings, but
perhaps one that nobody has run into yet. It might be worth looking into
extending the bindings to account for this.

I think there are two pieces for this. On one hand we have the DTC that
complains, which I think is what you were seeing. It's a bit tricky to
update because it checks for bidirectionality of the endpoints, which is
trivial to do with 1:1 but more complicated with 1:N relationships. I've
done some prototyping but not sure if my test DT is exactly what you
need. Can you send a snippet of what your DT looks like to test the DTC
changes against?

The other part is the DT schema which currently restricts the
remote-endpoint property to be a single phandle. We would want
phandle-array in this case with an updated description. Something like
this:

--- >8 ---
diff --git a/dtschema/schemas/graph.yaml b/dtschema/schemas/graph.yaml
index bca450514640..1459b88b9b77 100644
--- a/dtschema/schemas/graph.yaml
+++ b/dtschema/schemas/graph.yaml
@@ -42,8 +42,9 @@ $defs:
 
       remote-endpoint:
         description: |
-          phandle to an 'endpoint' subnode of a remote device node.
-        $ref: /schemas/types.yaml#/definitions/phandle
+          A list of phandles to 'endpoint' subnodes of one or more remote
+          device node.
+        $ref: /schemas/types.yaml#/definitions/phandle-array
 
   port-base:
     type: object
--- >8 ---

Thierry

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

  reply	other threads:[~2024-01-05  8:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 16:28 Query on audio-graph-card DT binding Sameer Pujar
2024-01-03  7:02 ` ASoC: dt-bindings: " Sameer Pujar
2024-01-04 17:07 ` Thierry Reding
2024-01-04 17:22   ` Mark Brown
2024-01-05  4:54     ` Sameer Pujar
2024-01-05  8:11       ` Thierry Reding [this message]
2024-01-05 11:19         ` Sameer Pujar
2024-01-09  2:17           ` Kuninori Morimoto
2024-01-09 11:49             ` Sameer Pujar
2024-01-09 23:15               ` Kuninori Morimoto
2024-01-10  5:01                 ` Sameer Pujar
2024-01-11  0:44                   ` Kuninori Morimoto
2024-01-11  4:28                     ` Sameer Pujar
2024-01-11  4:56                       ` Kuninori Morimoto
2024-01-11  5:09                         ` Sameer Pujar
2024-01-11  5:32                           ` Kuninori Morimoto
2024-01-11  6:49                             ` Sameer Pujar
2024-01-11 22:59                               ` Kuninori Morimoto
2024-01-12  8:09                                 ` Sameer Pujar
2024-01-15  1:43                                   ` Kuninori Morimoto

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=ZZe5sTNz005Tt4jk@orome.fritz.box \
    --to=thierry.reding@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=spujar@nvidia.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).