All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH RFC 01/15] of: property: add port base loop
Date: Tue, 22 Jun 2021 08:31:14 -0600	[thread overview]
Message-ID: <CAL_JsqKXEEXYJyrbTp_mqgoJ6DGw42Zdz1YFYih0q+HDZ+q4PA@mail.gmail.com> (raw)
In-Reply-To: <87zgvi3dlm.wl-kuninori.morimoto.gx@renesas.com>

On Mon, Jun 21, 2021 at 7:14 PM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> We have endpoint base functions
>         - of_graph_get_next_endpoint()
>         - of_graph_get_endpoint_count()
>         - for_each_endpoint_of_node()
>
> for_each_endpoint_of_node() loop finds endpoint.
>
>         ports {
>                 port@0 {
> (1)                     endpoint {...};
>                 };
>                 port@1 {
> (2)                     endpoint {...};
>                 };
>                 ...
>         };
>
> In above case, for_each_endpoint_of_node() loop
> finds endpoint as (1) -> (2) -> ...

Wanting to iterate endpoints across ports like that is odd given the
ports represent different things. I think you will find there aren't
too many users as I tried to get rid of most of them some time ago.
(I'm sure more have slipped in)

> If we want to get port@0 -> port@1 -> ...
> instead of endpoint, we need do like below
>
>         for_each_endpoint_of_node(node, endpoint) {
>                 port = of_get_parent(endpoint);
>                 ...
>         }
>
> But port might have multi endpoints.
>
>         ports {
>                 port@0 {
> (1)                     endpoint@0 {...};
> (2)                     endpoint@1 {...};
>                 };
>                 port@1 {
> (3)                     endpoint {...};
>                 };
>                 ...
>         };
>
> In such case, people want to have "port base" loop
> instead of "endpoints base" loop.
> This patch adds such functions/macros.

As bindings should be defining what each port number represents, I
don't think iterating thru them without regard to port numbers is the
right model. Drivers should be requesting specific port numbers.

Rob

  reply	other threads:[~2021-06-22 14:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  1:13 [PATCH RFC 00/15] ASoC: add Audio Graph Card2 driver Kuninori Morimoto
2021-06-22  1:14 ` [PATCH RFC 01/15] of: property: add port base loop Kuninori Morimoto
2021-06-22 14:31   ` Rob Herring [this message]
2021-06-22  1:14 ` [PATCH RFC 02/15] ASoC: dt-bindings: test-component: add Test Component YAML bindings Kuninori Morimoto
2021-06-22  1:14 ` [PATCH RFC 03/15] ASoC: test-component: add Test Component for Sound debug/test Kuninori Morimoto
2021-06-22  1:14 ` [PATCH RFC 04/15] ASoC: simple-card-utils: add asoc_graph_is_ports0() Kuninori Morimoto
2021-06-22  1:14 ` [PATCH RFC 05/15] ASoC: simple-card-utils: add codec2codec support Kuninori Morimoto
2021-06-22  1:14 ` [PATCH RFC 06/15] ASoC: audio-graph-card2: add Audio Graph Card2 driver Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 07/15] ASoC: audio-graph-card2: add DPCM support Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 08/15] ASoC: audio-graph-card2: add Multi CPU/Codec support Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 09/15] ASoC: audio-graph-card2: add Codec2Codec support Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 10/15] ASoC: audio-graph-card2: add Yaml Document Kuninori Morimoto
2021-06-22 13:55   ` Rob Herring
2021-06-22  1:15 ` [PATCH RFC 11/15] ASoC: sample-custom-card: add Audio Graph Card2 custome sample Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 12/15] ASoC: audio-graph-card2-sample.dtsi: add Sample DT for Audio Graph Card2 Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 13/15] ASoC: audio-graph-card2-sample.dtsi: add DPCM sample Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 14/15] ASoC: audio-graph-card2-sample.dtsi: add Multi CPU/Codec sample Kuninori Morimoto
2021-06-22  1:15 ` [PATCH RFC 15/15] ASoC: audio-graph-card2-sample.dtsi: add Codec2Codec sample 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=CAL_JsqKXEEXYJyrbTp_mqgoJ6DGw42Zdz1YFYih0q+HDZ+q4PA@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.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 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.