Skip to content

Commit 3c8b586

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()
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> Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 05722a0 commit 3c8b586

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

include/sound/soc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ int snd_soc_get_dai_id(struct device_node *ep);
13191319
int snd_soc_get_dai_name(const struct of_phandle_args *args,
13201320
const char **dai_name);
13211321
int snd_soc_of_get_dai_name(struct device_node *of_node,
1322-
const char **dai_name);
1322+
const char **dai_name, int index);
13231323
int snd_soc_of_get_dai_link_codecs(struct device *dev,
13241324
struct device_node *of_node,
13251325
struct snd_soc_dai_link *dai_link);

sound/soc/fsl/imx-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
586586
link->platforms->of_node = link->cpus->of_node;
587587
link->id = args.args[0];
588588

589-
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
589+
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, 0);
590590
if (ret) {
591591
dev_err_probe(card->dev, ret,
592592
"%s: error getting cpu dai name\n", link->name);

sound/soc/generic/simple-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static int asoc_simple_parse_dai(struct device_node *node,
8989
* 2) user need to rebind Sound Card everytime
9090
* if he unbinded CPU or Codec.
9191
*/
92-
ret = snd_soc_of_get_dai_name(node, &dlc->dai_name);
92+
ret = snd_soc_of_get_dai_name(node, &dlc->dai_name, 0);
9393
if (ret < 0)
9494
return ret;
9595

sound/soc/loongson/loongson_card.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ static int loongson_card_parse_of(struct loongson_card_data *data)
151151
for (i = 0; i < card->num_links; i++)
152152
loongson_dai_links[i].codecs->of_node = args.np;
153153

154-
snd_soc_of_get_dai_name(cpu, &cpu_dai_name);
155-
snd_soc_of_get_dai_name(codec, &codec_dai_name);
154+
snd_soc_of_get_dai_name(cpu, &cpu_dai_name, 0);
155+
snd_soc_of_get_dai_name(codec, &codec_dai_name, 0);
156156
for (i = 0; i < card->num_links; i++) {
157157
loongson_dai_links[i].cpus->dai_name = cpu_dai_name;
158158
loongson_dai_links[i].codecs->dai_name = codec_dai_name;

sound/soc/mediatek/mt8173/mt8173-rt5650.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)
288288

289289
np = of_get_child_by_name(pdev->dev.of_node, "codec-capture");
290290
if (np) {
291-
ret = snd_soc_of_get_dai_name(np, &codec_capture_dai);
291+
ret = snd_soc_of_get_dai_name(np, &codec_capture_dai, 0);
292292
of_node_put(np);
293293
if (ret < 0) {
294294
dev_err(&pdev->dev,

sound/soc/qcom/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
105105
link->cpus->of_node = args.np;
106106
link->id = args.args[0];
107107

108-
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
108+
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, 0);
109109
if (ret) {
110110
dev_err_probe(card->dev, ret,
111111
"%s: error getting cpu dai name\n", link->name);

sound/soc/soc-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,10 +3355,10 @@ int snd_soc_get_dai_name(const struct of_phandle_args *args,
33553355
EXPORT_SYMBOL_GPL(snd_soc_get_dai_name);
33563356

33573357
int snd_soc_of_get_dai_name(struct device_node *of_node,
3358-
const char **dai_name)
3358+
const char **dai_name, int index)
33593359
{
33603360
struct snd_soc_dai_link_component dlc;
3361-
int ret = snd_soc_of_get_dlc(of_node, NULL, &dlc, 0);
3361+
int ret = snd_soc_of_get_dlc(of_node, NULL, &dlc, index);
33623362

33633363
if (ret == 0)
33643364
*dai_name = dlc.dai_name;

0 commit comments

Comments
 (0)