All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, shiiba <naoya.shiiba.nx@renesas.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Das Biju <biju.das@bp.renesas.com>
Subject: [PATCH 02/12 v2] ASoC: core: add snd_soc_get_dai_info() to get driver infomation
Date: Mon, 16 Mar 2015 04:45:05 +0000	[thread overview]
Message-ID: <87bnjtk0uc.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87egopk13d.wl%kuninori.morimoto.gx@renesas.com>

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

Sometimes sound card driver want to get cpu/codec driver information.
This patch adds snd_soc_get_dai_info() and enable it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - no change

 include/sound/soc.h  |  3 +++
 sound/soc/soc-core.c | 29 ++++++++++++++++++++++++-----
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 235db71..709f058 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1505,6 +1505,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
 				     const char *prefix,
 				     struct device_node **bitclkmaster,
 				     struct device_node **framemaster);
+int snd_soc_get_dai_info(struct of_phandle_args *args,
+			 struct snd_soc_component **cmpnt,
+			 struct snd_soc_dai_driver **dai_drv);
 int snd_soc_of_get_dai_name(struct device_node *of_node,
 			    const char **dai_name);
 int snd_soc_of_get_dai_link_codecs(struct device *dev,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3a68f13..5b01505 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3454,8 +3454,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
 }
 EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
 
-static int snd_soc_get_dai_name(struct of_phandle_args *args,
-				const char **dai_name)
+int snd_soc_get_dai_info(struct of_phandle_args *args,
+			 struct snd_soc_component **cmpnt,
+			 struct snd_soc_dai_driver **dai_drv)
 {
 	struct snd_soc_component *pos;
 	int ret = -EPROBE_DEFER;
@@ -3486,15 +3487,33 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
 
 		ret = 0;
 
-		*dai_name = pos->dai_drv[id].name;
-		if (!*dai_name)
-			*dai_name = pos->name;
+		*cmpnt = pos;
+		*dai_drv = pos->dai_drv + id;
 
 		break;
 	}
 	mutex_unlock(&client_mutex);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(snd_soc_get_dai_info);
+
+static int snd_soc_get_dai_name(struct of_phandle_args *args,
+				const char **dai_name)
+{
+	struct snd_soc_component *cmpnt;
+	struct snd_soc_dai_driver *dai_drv;
+	int ret;
+
+	ret = snd_soc_get_dai_info(args, &cmpnt, &dai_drv);
+	if (ret)
+		return ret;
+
+	*dai_name = dai_drv->name;
+	if (!*dai_name)
+		*dai_name = cmpnt->name;
+
+	return ret;
+}
 
 int snd_soc_of_get_dai_name(struct device_node *of_node,
 			    const char **dai_name)
-- 
1.9.1

  parent reply	other threads:[~2015-03-16  4:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16  4:39 [PATCH 0/12 v2] ASoC: Renesas adds DPCM based sampling rate convert Kuninori Morimoto
2015-03-16  4:44 ` [PATCH 01/12 v2] ASoC: core: remove of_xlate_dai_name from snd_soc_component_driver Kuninori Morimoto
2015-03-18  9:03   ` Lars-Peter Clausen
2015-03-18 23:59     ` Kuninori Morimoto
2015-03-16  4:45 ` Kuninori Morimoto [this message]
2015-03-16  4:45 ` [PATCH 03/12 v2] ASoC: rsnd-dpcm-card: add Renesas sound card support for DPCM Kuninori Morimoto
2015-03-18  9:05   ` Lars-Peter Clausen
2015-03-19  0:08     ` Kuninori Morimoto
2015-03-16  4:45 ` [PATCH 04/12 v2] ASoC: rsnd-dpcm-card: add .be_hw_params_fixup support for convert rate Kuninori Morimoto
2015-03-16  4:45 ` [PATCH 05/12 v2] ASoC: ak4642: tidyup DAPM route for playback Kuninori Morimoto
2015-03-17 12:22   ` Mark Brown
2015-03-16  4:46 ` [PATCH 06/12 v2] ASoC: rsnd: no more SSI restart when unusual situation Kuninori Morimoto
2015-03-16  4:46 ` [PATCH 07/12 v2] ASoC: rsnd: no more SRC " Kuninori Morimoto
2015-03-16  4:46 ` [PATCH 08/12 v2] ASoC: rsnd: tidyup error message format Kuninori Morimoto
2015-03-16  4:46 ` [PATCH 09/12 v2] ASoC: rsnd: show debug info for sampling rate convert Kuninori Morimoto
2015-03-16  4:47 ` [PATCH 10/12 v2] ASoC: rsnd: don't call clk_prepare_enable/unprepare() from inside spin lock Kuninori Morimoto
2015-03-16  4:47 ` [PATCH 11/12 v2] ASoC: rsnd: add dai_link stream name Kuninori Morimoto
2015-03-16  4:47 ` [PATCH 12/12 v2] ASoC: rsnd: add DPCM based sampling rate convert 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=87bnjtk0uc.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=biju.das@bp.renesas.com \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=lgirdwood@gmail.com \
    --cc=naoya.shiiba.nx@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.