summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-04-14 01:20:15 +0200
committerMark Brown <broonie@kernel.org>2021-04-15 17:07:51 +0200
commit7ed5920995cea34d66e4af00c7f468cc933251cf (patch)
treed98b1970f5fc11587a6ff68aacced922b4ddbb25 /sound
parentASoC: simple-card: use simple_props_to_xxx() macro (diff)
downloadlinux-7ed5920995cea34d66e4af00c7f468cc933251cf.tar.xz
linux-7ed5920995cea34d66e4af00c7f468cc933251cf.zip
ASoC: audio-graph: use asoc_link_to_xxx() macro
We shouldn't use dai_link->cpus/codecs/platforms directly, because these are array now to supporting multi CPU/Codec/Platform. This patch uses asoc_link_to_xxx() macro for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lf9lzs9c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/generic/audio-graph-card.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 0582fe296471..55384f1415b3 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -224,9 +224,9 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
struct device_node *ports;
struct device_node *node;
struct asoc_simple_dai *dai;
- struct snd_soc_dai_link_component *cpus = dai_link->cpus;
- struct snd_soc_dai_link_component *codecs = dai_link->codecs;
- struct snd_soc_dai_link_component *platforms = dai_link->platforms;
+ struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
int ret;
port = of_get_parent(ep);
@@ -248,11 +248,11 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai = dai_props->cpu_dai;
- ret = asoc_simple_parse_dai(ep, dai_link->cpus, &is_single_links);
+ ret = asoc_simple_parse_dai(ep, cpus, &is_single_links);
if (ret)
goto out_put_node;
- ret = asoc_simple_parse_clk(dev, ep, dai, dai_link->cpus);
+ ret = asoc_simple_parse_clk(dev, ep, dai, cpus);
if (ret < 0)
goto out_put_node;
@@ -291,11 +291,11 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai = dai_props->codec_dai;
cconf = dai_props->codec_conf;
- ret = asoc_simple_parse_dai(ep, dai_link->codecs, NULL);
+ ret = asoc_simple_parse_dai(ep, codecs, NULL);
if (ret < 0)
goto out_put_node;
- ret = asoc_simple_parse_clk(dev, ep, dai, dai_link->codecs);
+ ret = asoc_simple_parse_clk(dev, ep, dai, codecs);
if (ret < 0)
goto out_put_node;
@@ -357,6 +357,9 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
struct device_node *top = dev->of_node;
struct asoc_simple_dai *cpu_dai = dai_props->cpu_dai;
struct asoc_simple_dai *codec_dai = dai_props->codec_dai;
+ struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
int ret, single_cpu = 0;
dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
@@ -372,11 +375,11 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
if (ret < 0)
return ret;
- ret = asoc_simple_parse_dai(cpu_ep, dai_link->cpus, &single_cpu);
+ ret = asoc_simple_parse_dai(cpu_ep, cpus, &single_cpu);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_dai(codec_ep, dai_link->codecs, NULL);
+ ret = asoc_simple_parse_dai(codec_ep, codecs, NULL);
if (ret < 0)
return ret;
@@ -388,26 +391,26 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
if (ret < 0)
return ret;
- ret = asoc_simple_parse_clk(dev, cpu_ep, cpu_dai, dai_link->cpus);
+ ret = asoc_simple_parse_clk(dev, cpu_ep, cpu_dai, cpus);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_clk(dev, codec_ep, codec_dai, dai_link->codecs);
+ ret = asoc_simple_parse_clk(dev, codec_ep, codec_dai, codecs);
if (ret < 0)
return ret;
ret = asoc_simple_set_dailink_name(dev, dai_link,
"%s-%s",
- dai_link->cpus->dai_name,
- dai_link->codecs->dai_name);
+ cpus->dai_name,
+ codecs->dai_name);
if (ret < 0)
return ret;
dai_link->ops = &graph_ops;
dai_link->init = asoc_simple_dai_init;
- asoc_simple_canonicalize_cpu(dai_link->cpus, single_cpu);
- asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus);
+ asoc_simple_canonicalize_cpu(cpus, single_cpu);
+ asoc_simple_canonicalize_platform(platforms, cpus);
return 0;
}