summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-12-13 21:32:43 -0500
committerMark Brown <broonie@kernel.org>2018-12-14 06:47:49 -0500
commit66164a4da30dd295a1b60568c02bee37cfd9895a (patch)
tree40a527ab1aabf9eda64f9b53690f90c85e239c49 /sound
parent7ced65ffb82fa58c6e314c16770288fe9ce3dfc8 (diff)
ASoC: audio-graph-card: tidyup prefix for snd_soc_codec_conf
Current audio-graph-card is handling "prefix" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch supports it. It will be overwrote if lower node has it. sound { prefix = "xxx"; // initial }; codec { audio-graph-card,prefix = "xxx"; // overwrite ports { prefix = "xxx"; // overwrite port { prefix = "xxx"; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 368b8ae463af..0d6144560a1e 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -179,12 +179,12 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
179 struct device *dev = graph_priv_to_dev(priv); 179 struct device *dev = graph_priv_to_dev(priv);
180 struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, link_idx); 180 struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, link_idx);
181 struct graph_dai_props *dai_props = graph_priv_to_props(priv, link_idx); 181 struct graph_dai_props *dai_props = graph_priv_to_props(priv, link_idx);
182 struct snd_soc_card *card = graph_priv_to_card(priv);
183 struct device_node *ep = is_cpu ? cpu_ep : codec_ep; 182 struct device_node *ep = is_cpu ? cpu_ep : codec_ep;
184 struct device_node *port = of_get_parent(ep); 183 struct device_node *port = of_get_parent(ep);
185 struct device_node *ports = of_get_parent(port); 184 struct device_node *ports = of_get_parent(port);
186 struct device_node *node = of_graph_get_port_parent(ep); 185 struct device_node *node = of_graph_get_port_parent(ep);
187 struct asoc_simple_dai *dai; 186 struct asoc_simple_dai *dai;
187 struct snd_soc_dai_link_component *codecs = dai_link->codecs;
188 int ret; 188 int ret;
189 189
190 dev_dbg(dev, "link_of DPCM (for %s)\n", is_cpu ? "CPU" : "Codec"); 190 dev_dbg(dev, "link_of DPCM (for %s)\n", is_cpu ? "CPU" : "Codec");
@@ -204,10 +204,8 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
204 of_node_put(port); 204 of_node_put(port);
205 205
206 if (is_cpu) { 206 if (is_cpu) {
207 struct snd_soc_dai_link_component *codecs;
208 207
209 /* BE is dummy */ 208 /* BE is dummy */
210 codecs = dai_link->codecs;
211 codecs->of_node = NULL; 209 codecs->of_node = NULL;
212 codecs->dai_name = "snd-soc-dummy-dai"; 210 codecs->dai_name = "snd-soc-dummy-dai";
213 codecs->name = "snd-soc-dummy"; 211 codecs->name = "snd-soc-dummy";
@@ -264,19 +262,19 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
264 262
265 ret = asoc_simple_card_set_dailink_name(dev, dai_link, 263 ret = asoc_simple_card_set_dailink_name(dev, dai_link,
266 "be.%s", 264 "be.%s",
267 dai_link->codecs->dai_name); 265 codecs->dai_name);
268 if (ret < 0) 266 if (ret < 0)
269 return ret; 267 return ret;
270 268
271 /* check "prefix" from top node */ 269 /* check "prefix" from top node */
272 snd_soc_of_parse_audio_prefix(card, cconf, 270 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,
273 dai_link->codecs->of_node,
274 "prefix"); 271 "prefix");
275 /* check "prefix" from each node if top doesn't have */ 272 snd_soc_of_parse_node_prefix(node, cconf, codecs->of_node,
276 if (!cconf->of_node) 273 PREFIX "prefix");
277 snd_soc_of_parse_node_prefix(node, cconf, 274 snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node,
278 dai_link->codecs->of_node, 275 "prefix");
279 PREFIX "prefix"); 276 snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node,
277 "prefix");
280 } 278 }
281 279
282 ret = asoc_simple_card_of_parse_tdm(ep, dai); 280 ret = asoc_simple_card_of_parse_tdm(ep, dai);