devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
To: Kuninori Morimoto
	<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Laurent
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Jose Abreu <Jose.Abreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	Linux-DT <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux-ALSA <alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Linux-Renesas
	<linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Simon <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
Subject: Re: [alsa-devel] [PATCH 0/4] ASoC: add graph base connection on simple-card
Date: Thu, 14 Apr 2016 11:01:28 +0200	[thread overview]
Message-ID: <20160414110128.56a0da97d526cdcb8d5f1ddf@free.fr> (raw)
In-Reply-To: <871t68wxxe.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>

On Thu, 14 Apr 2016 05:45:41 +0000
Kuninori Morimoto <kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:

> Current simple-card is using "sound-dai" base connection on DT,
> but V4L2 is using graph base connection.
> For example HDMI case, we would like to use both connection.
> To above confusable connection method, and to reuse current resource,
> this patch adds new function, and detect both "sound-dai" and "remote-endpoint"
> on simple-card. like this
> 
> 	sound {
> 		compatible = "simple-audio-card";
> 		...
> 		sndcpu: simple-audio-card,cpu {
> 			sound-dai = <&xxx>;
> 		};
> 		sndcodec: simple-audio-card,codec {
> =>			remote-endpoint = <&out_hdmi>;
> 		};
> 	};
> 
> 	xxx {
> 		...
> 		ports {
> 			...
> 			port@0 {
> 				reg = <0>;
> 				out_rgb: endpoint {
> 				};
> 			};
> 			port@1 {
> 				reg = <1>;
> =>				out_hdmi: endpoint {
> 				};
> 			};
> 			...
> 		};
> 	};
	[snip]

Hi Kuninori,

Thanks for this first step towards the graph of ports in audio,
but I don't see exactly the use of this remote-endpoint.

According to Documentation/devicetree/bindings/graph.txt section
"Links between endpoints", the endpoint/remote-endpoint links are
bi-directional and describe the physical links: the audio port of the
codec is connected to the audio controller and reverse.
There is no reverse link from the codec to the 'simple-card'.

If the codec has only one DAI, using the remote-port just complexifies
the access to the codec (remote-port -> endpoint -> parent [->parent]).

If the codec has more than one audio input, a DT may look like:

	hdmi_transmitter {
		...
		port@1 {			/* audio from I2S */
			reg = <1>;
			...
			i2s: endpoint {
				remote-endpoint = <&audio_i2s>;
			};
		};
		port@2 {			 /* audio from S/PDIF */
			reg = <2>;
			...
			spdif: endpoint {
				remote-endpoint = <&audio_spdif>;
			};
		};
	};
(the video port is not shown and may be declared before, between or
after the audio ports)

The codec associated to the HDMI transmitter declares 2 DAIs.
It may choose to define the DAI numbers either in a fixed order
(say 0 is always S/PDIF and 1 is always I2S), or dynamically, following
the declaration of the ports (in the example, 0 is I2S and 1 is S/PDIF).

As the DAI numbers are used by the simple card to get the DAI names,
their values must be know.

With the standard declaration of the codec DAIs in the simple card
(phandle to the codec - hdmi -  plus DAI number), either numbering
scheme works (the documentation of the hdmi transmitter tells which
scheme is used and the DAI number in the DT is set accordingly).

When using a phandle to the remote-endpoint (without DAI number), the
simple card has no direct way to find the DAI number:
- with a fixed order, some more information must be set in the DT
  (audio port type),
- with a dynamic order, a loop on all ports must be done, counting the
  audio ports and skipping the video port(s).

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-14  9:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  5:45 [PATCH 0/4] ASoC: add graph base connection on simple-card Kuninori Morimoto
2016-04-14  5:47 ` [PATCH 1/4] of_graph: add of_graph_get_endpoint_count() Kuninori Morimoto
2016-04-14  5:47 ` [PATCH 2/4] ASoC: add of_parse_snd_connection_with_args() for sound-dai/graph connection Kuninori Morimoto
2016-04-14  6:17   ` [alsa-devel] " kbuild test robot
2016-04-14  7:07     ` [PATCH] of: add missing const for of_parse_phandle_with_args() in !CONFIG_OF Kuninori Morimoto
2016-05-10  2:53     ` [PATCH][RESEND] " Kuninori Morimoto
2016-04-14  5:48 ` [PATCH 3/4] ASoC: snd_soc_of_get_dai_name() uses of_parse_snd_soc_connection_with_args() Kuninori Morimoto
2016-04-14  5:48 ` [PATCH 4/4] ASoC: simple-card: probe both sound-dai and remote-endpoint Kuninori Morimoto
     [not found] ` <871t68wxxe.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-04-14  9:01   ` Jean-Francois Moine [this message]
     [not found]     ` <20160414110128.56a0da97d526cdcb8d5f1ddf-GANU6spQydw@public.gmane.org>
2016-04-15  7:25       ` [alsa-devel] [PATCH 0/4] ASoC: add graph base connection on simple-card Kuninori Morimoto
2016-04-15  9:26         ` Kuninori Morimoto
2016-04-15 11:31           ` Jean-Francois Moine
2016-04-18  2:43             ` Kuninori Morimoto
     [not found]               ` <87r3e3ej5t.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-04-18  7:38                 ` [alsa-devel] " Jean-Francois Moine
2016-04-20  2:55                   ` Kuninori Morimoto
2016-04-20 16:18                     ` Jean-Francois Moine
2016-04-18 17:12 ` Rob Herring

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=20160414110128.56a0da97d526cdcb8d5f1ddf@free.fr \
    --to=moinejf-ganu6spqydw@public.gmane.org \
    --cc=Jose.Abreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
    --cc=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).