alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: "Mark Brown" <broonie@kernel.org>,
	"Cezary Rojewski" <cezary.rojewski@intel.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"\"Amadeusz Sławiński\"" <amadeuszx.slawinski@linux.intel.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH v2 08/15] ASoC: soc-core.c: add snd_soc_copy_dai_args()
Date: 10 Jul 2023 10:20:17 +0900	[thread overview]
Message-ID: <87bkgko94e.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87mt04o96f.wl-kuninori.morimoto.gx@renesas.com>

To use multi Component support, we need to check dai_args whether
Card could get DAI from args (CPU/Codec needs set dai_args on DAI driver).
If it could, we need to allocate dai_args for dlc.
This patch adds snd_soc_copy_dai_args() for it.

This is helper function for multi Component support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h  |  2 ++
 sound/soc/soc-core.c | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 94fca10f01ad..fa2337a3cf4c 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1338,6 +1338,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
 
 void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms,
 				     struct snd_soc_dai_link_component *cpus);
+struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
+					      struct of_phandle_args *args);
 struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args);
 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
 					 struct snd_soc_dai_driver *dai_drv,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9fd7e633d374..a5b96c17633a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -809,6 +809,19 @@ static struct device_node
 	return of_node;
 }
 
+struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, struct of_phandle_args *args)
+{
+	struct of_phandle_args *ret = devm_kzalloc(dev, sizeof(*ret), GFP_KERNEL);
+
+	if (!ret)
+		return NULL;
+
+	*ret = *args;
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(snd_soc_copy_dai_args);
+
 static int snd_soc_is_matching_component(
 	const struct snd_soc_dai_link_component *dlc,
 	struct snd_soc_component *component)
-- 
2.25.1


  parent reply	other threads:[~2023-07-10  1:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  1:19 [PATCH v2 00/15] ASoC: add multi Component support Kuninori Morimoto
2023-07-10  1:19 ` [PATCH v2 01/15] ASoC: soc-core: protect dlc->of_node under mutex Kuninori Morimoto
2023-07-10  1:19 ` [PATCH v2 02/15] ASoC: soc-core.c: initialize dlc on snd_soc_get_dai_id() Kuninori Morimoto
2023-07-10  1:19 ` [PATCH v2 03/15] ASoC: soc-core.c: cleanup soc_dai_link_sanity_check() Kuninori Morimoto
2023-07-10  1:19 ` [PATCH v2 04/15] ASoC: soc-dai.c: add DAI get/match functions Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 05/15] ASoC: soc-core.c: enable multi Component Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 06/15] ASoC: soc-core.c: add snd_soc_get_dai_via_args() Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 07/15] ASoC: soc-core.c: add snd_soc_dlc_use_cpu_as_platform() Kuninori Morimoto
2023-07-10  1:20 ` Kuninori Morimoto [this message]
2023-07-10  1:20 ` [PATCH v2 09/15] ASoC: simple-card-utils.c: enable multi Component support Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 10/15] ASoC: simple-card.c: " Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 11/15] ASoC: rsnd: use DAI driver ID instead of DAI ID Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 12/15] ASoC: rsnd: cleanup rsnd_dai_of_node() Kuninori Morimoto
2023-07-10  1:20 ` [PATCH v2 13/15] ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2 Kuninori Morimoto
2023-07-10  1:21 ` [PATCH v2 14/15] ASoC: dt-bindings: renesas,rsnd.yaml: add common port-def Kuninori Morimoto
2023-07-10 15:19   ` Rob Herring
2023-07-11  0:00     ` Kuninori Morimoto
2023-07-14 14:42       ` Rob Herring
2023-07-19  0:11         ` Kuninori Morimoto
2023-07-19 23:36         ` Kuninori Morimoto
2023-08-04 17:56           ` Rob Herring
2023-07-10  1:21 ` [PATCH v2 15/15] ASoC: dt-bindings: renesas,rsnd.yaml: enable multi ports for multi Component support Kuninori Morimoto
2023-07-10 15:23   ` Rob Herring
2023-07-11  0:05     ` Kuninori Morimoto
2023-07-16 12:51 ` (subset) [PATCH v2 00/15] ASoC: add " Mark Brown

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=87bkgko94e.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=pierre-louis.bossart@linux.intel.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).