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>
This commit is contained in:
Kuninori Morimoto 2023-06-20 02:14:11 +00:00 committed by Mark Brown
parent 05722a0ce6
commit 3c8b586185
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
7 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -151,8 +151,8 @@ static int loongson_card_parse_of(struct loongson_card_data *data)
for (i = 0; i < card->num_links; i++)
loongson_dai_links[i].codecs->of_node = args.np;
snd_soc_of_get_dai_name(cpu, &cpu_dai_name);
snd_soc_of_get_dai_name(codec, &codec_dai_name);
snd_soc_of_get_dai_name(cpu, &cpu_dai_name, 0);
snd_soc_of_get_dai_name(codec, &codec_dai_name, 0);
for (i = 0; i < card->num_links; i++) {
loongson_dai_links[i].cpus->dai_name = cpu_dai_name;
loongson_dai_links[i].codecs->dai_name = codec_dai_name;

View File

@ -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,

View File

@ -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);

View File

@ -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;