mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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:
parent
05722a0ce6
commit
3c8b586185
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user