diff mbox series

[2/8] ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()

Message ID 87jzw6hp5c.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series add snd_soc_{of_}get_dlc() | expand

Commit Message

Kuninori Morimoto June 14, 2023, 12:18 a.m. UTC
Current snd_soc_of_get_dai_name() doesn't accept index
for #sound-dai-cells. It is not useful for user.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h                       | 2 +-
 sound/soc/fsl/imx-card.c                  | 2 +-
 sound/soc/generic/simple-card.c           | 2 +-
 sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 +-
 sound/soc/qcom/common.c                   | 2 +-
 sound/soc/soc-core.c                      | 4 ++--
 6 files changed, 7 insertions(+), 7 deletions(-)

Comments

Mark Brown June 19, 2023, 12:59 p.m. UTC | #1
On Wed, Jun 14, 2023 at 12:18:55AM +0000, Kuninori Morimoto wrote:
> Current snd_soc_of_get_dai_name() doesn't accept index
> for #sound-dai-cells. It is not useful for user.
> This patch adds it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  include/sound/soc.h                       | 2 +-
>  sound/soc/fsl/imx-card.c                  | 2 +-
>  sound/soc/generic/simple-card.c           | 2 +-
>  sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 +-
>  sound/soc/qcom/common.c                   | 2 +-
>  sound/soc/soc-core.c                      | 4 ++--
>  6 files changed, 7 insertions(+), 7 deletions(-)

This series all looks good but unfortunately the recently added Longsoon
driver added a new user of snd_soc_of_get_dai_name() - could you rebase
against for-6.5 to take account of the new driver please?
diff mbox series

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 943f0a1b2d27..b27f84580c5b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1319,7 +1319,7 @@  int snd_soc_get_dai_id(struct device_node *ep);
 int snd_soc_get_dai_name(const struct of_phandle_args *args,
 			 const char **dai_name);
 int snd_soc_of_get_dai_name(struct device_node *of_node,
-			    const char **dai_name);
+			    const char **dai_name, int index);
 int snd_soc_of_get_dai_link_codecs(struct device *dev,
 				   struct device_node *of_node,
 				   struct snd_soc_dai_link *dai_link);
diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index 78e2e3932ba5..6f3b1428a5ba 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -586,7 +586,7 @@  static int imx_card_parse_of(struct imx_card_data *data)
 		link->platforms->of_node = link->cpus->of_node;
 		link->id = args.args[0];
 
-		ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
+		ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, 0);
 		if (ret) {
 			dev_err_probe(card->dev, ret,
 				      "%s: error getting cpu dai name\n", link->name);
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 6f044cc8357e..9e1047b46b68 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -89,7 +89,7 @@  static int asoc_simple_parse_dai(struct device_node *node,
 	 * 2) user need to rebind Sound Card everytime
 	 *    if he unbinded CPU or Codec.
 	 */
-	ret = snd_soc_of_get_dai_name(node, &dlc->dai_name);
+	ret = snd_soc_of_get_dai_name(node, &dlc->dai_name, 0);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index e05f2b0231fe..3ece4b5eaca2 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -288,7 +288,7 @@  static int mt8173_rt5650_dev_probe(struct platform_device *pdev)
 
 	np = of_get_child_by_name(pdev->dev.of_node, "codec-capture");
 	if (np) {
-		ret = snd_soc_of_get_dai_name(np, &codec_capture_dai);
+		ret = snd_soc_of_get_dai_name(np, &codec_capture_dai, 0);
 		of_node_put(np);
 		if (ret < 0) {
 			dev_err(&pdev->dev,
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index cab5a7937a57..d9ebb883b999 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -105,7 +105,7 @@  int qcom_snd_parse_of(struct snd_soc_card *card)
 		link->cpus->of_node = args.np;
 		link->id = args.args[0];
 
-		ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
+		ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, 0);
 		if (ret) {
 			dev_err_probe(card->dev, ret,
 				      "%s: error getting cpu dai name\n", link->name);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8dba5bb26ffe..7b13b1b232ef 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3355,10 +3355,10 @@  int snd_soc_get_dai_name(const struct of_phandle_args *args,
 EXPORT_SYMBOL_GPL(snd_soc_get_dai_name);
 
 int snd_soc_of_get_dai_name(struct device_node *of_node,
-			    const char **dai_name)
+			    const char **dai_name, int index)
 {
 	struct snd_soc_dai_link_component dlc;
-	int ret = snd_soc_of_get_dlc(of_node, NULL, &dlc, 0);
+	int ret = snd_soc_of_get_dlc(of_node, NULL, &dlc, index);
 
 	if (ret == 0)
 		*dai_name = dlc.dai_name;