All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>,
	Laurent <laurent.pinchart@ideasonboard.com>,
	Lars-Peter Clausen <lars@metafoo.de>
Cc: Simon <horms@verge.net.au>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux-DT <devicetree@vger.kernel.org>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jose Abreu <Jose.Abreu@synopsys.com>
Subject: [PATCH 4/4] ASoC: simple-card: probe both sound-dai and remote-endpoint
Date: Thu, 14 Apr 2016 05:48:57 +0000	[thread overview]
Message-ID: <87vb3kvj7i.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <871t68wxxe.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current simple-card can probe "sound-dai" base connection on DT.
OTOH, V4L2 soc is using graph base connection. Because of this
different style, DT will be confusable if it support both
video/sound in same time.

This patch enables both "sound-dai" (= current simple-card style)
and "remote-endpoint" (= current V4L2 style) on simple-card.

	sound {
		compatible = "simple-audio-card";
		...
		sndcpu: simple-audio-card,cpu {
			sound-dai = <&xxxx>;
		};
		sndcodec: simple-audio-card,codec {
			remote-endpoint = <&yyyy>;
		};
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../devicetree/bindings/sound/simple-card.txt         | 19 +++++++++++++++++++
 sound/soc/generic/simple-card.c                       |  9 ++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index cf3979e..030edca 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -70,6 +70,7 @@ properties should also be placed in the codec node if needed.
 Required CPU/CODEC subnodes properties:
 
 - sound-dai				: phandle and port of CPU/CODEC
+- remote-endpoint			: graph endpoint of CPU/CODEC
 
 Optional CPU/CODEC subnodes properties:
 
@@ -162,3 +163,21 @@ sound {
 		};
 	};
 };
+
+Example 3 - sound-dai and remote-endpoint
+
+rsnd_ak4613: sound {
+	compatible = "simple-audio-card";
+
+	simple-audio-card,name = "R-Sound";
+	simple-audio-card,format = "left_j";
+	simple-audio-card,bitclock-master = <&sndcpu>;
+	simple-audio-card,frame-master = <&sndcpu>;
+
+	sndcpu: simple-audio-card,cpu {
+		sound-dai = <&rcar_sound 1>;
+	};
+	sndcodec: simple-audio-card,codec {
+		remote-endpoint = <&du_out_hdmi0>;
+	};
+};
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 2389ab4..a1d6001 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <sound/jack.h>
@@ -224,11 +225,13 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 	int ret;
 
 	/*
-	 * Get node via "sound-dai = <&phandle port>"
+	 * Get node via
+	 *	sound-dai = <&phandle port>
+	 * or
+	 *	remote-endpoint = <&phandle>
 	 * it will be used as xxx_of_node on soc_bind_dai_link()
 	 */
-	ret = of_parse_phandle_with_args(np, "sound-dai",
-					 "#sound-dai-cells", 0, &args);
+	ret = of_parse_snd_soc_connection_with_args(np, &args);
 	if (ret)
 		return ret;
 
-- 
1.9.1

  parent reply	other threads:[~2016-04-14  5:48 UTC|newest]

Thread overview: 26+ 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-04-14  7:07       ` Kuninori Morimoto
2016-05-10  2:53     ` [PATCH][RESEND] " Kuninori Morimoto
2016-05-10  2:53       ` 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 ` Kuninori Morimoto [this message]
     [not found] ` <871t68wxxe.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-04-14  9:01   ` [alsa-devel] [PATCH 0/4] ASoC: add graph base connection on simple-card Jean-Francois Moine
2016-04-14  9:01     ` Jean-Francois Moine
     [not found]     ` <20160414110128.56a0da97d526cdcb8d5f1ddf-GANU6spQydw@public.gmane.org>
2016-04-15  7:25       ` Kuninori Morimoto
2016-04-15  7:25         ` Kuninori Morimoto
2016-04-15  9:26         ` Kuninori Morimoto
2016-04-15 11:31           ` Jean-Francois Moine
2016-04-15 11:31             ` Jean-Francois Moine
2016-04-18  2:43             ` Kuninori Morimoto
2016-04-18  2:43               ` [alsa-devel] " Kuninori Morimoto
     [not found]               ` <87r3e3ej5t.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-04-18  7:38                 ` Jean-Francois Moine
2016-04-18  7:38                   ` Jean-Francois Moine
2016-04-20  2:55                   ` Kuninori Morimoto
2016-04-20 16:18                     ` Jean-Francois Moine
2016-04-20 16:18                       ` Jean-Francois Moine
2016-04-18 17:12 ` Rob Herring
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=87vb3kvj7i.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=horms@verge.net.au \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-renesas-soc@vger.kernel.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 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.