Commit cfc652a7 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: simple-card: tidyup prefix for snd_soc_codec_conf

Current simple-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 {
	simple-audio-card,prefix = "xxx"; // initial

	simple-audio-card,dai-link {
		prefix = "xxx"; // overwrite
		cpu {
			...
		};
		codec {
			prefix = "xxx"; // overwrite
		};
	};
};
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent dd82410f
...@@ -177,8 +177,9 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top, ...@@ -177,8 +177,9 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, link_idx); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, link_idx);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, link_idx); struct simple_dai_props *dai_props = simple_priv_to_props(priv, link_idx);
struct snd_soc_card *card = simple_priv_to_card(priv);
struct asoc_simple_dai *dai; struct asoc_simple_dai *dai;
struct snd_soc_dai_link_component *codecs = dai_link->codecs;
char prop[128]; char prop[128];
char *prefix = ""; char *prefix = "";
int ret; int ret;
...@@ -189,10 +190,8 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top, ...@@ -189,10 +190,8 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
if (is_fe) { if (is_fe) {
int is_single_links = 0; int is_single_links = 0;
struct snd_soc_dai_link_component *codecs;
/* BE is dummy */ /* BE is dummy */
codecs = dai_link->codecs;
codecs->of_node = NULL; codecs->of_node = NULL;
codecs->dai_name = "snd-soc-dummy-dai"; codecs->dai_name = "snd-soc-dummy-dai";
codecs->name = "snd-soc-dummy"; codecs->name = "snd-soc-dummy";
...@@ -248,19 +247,17 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top, ...@@ -248,19 +247,17 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
ret = asoc_simple_card_set_dailink_name(dev, dai_link, ret = asoc_simple_card_set_dailink_name(dev, dai_link,
"be.%s", "be.%s",
dai_link->codecs->dai_name); codecs->dai_name);
if (ret < 0) if (ret < 0)
return ret; return ret;
/* check "prefix" from top node */ /* check "prefix" from top node */
snd_soc_of_parse_audio_prefix(card, cconf, snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,
dai_link->codecs->of_node,
PREFIX "prefix"); PREFIX "prefix");
/* check "prefix" from each node if top doesn't have */ snd_soc_of_parse_node_prefix(node, cconf, codecs->of_node,
if (!cconf->of_node) "prefix");
snd_soc_of_parse_node_prefix(np, cconf, snd_soc_of_parse_node_prefix(np, cconf, codecs->of_node,
dai_link->codecs->of_node, "prefix");
"prefix");
} }
asoc_simple_card_parse_convert(dev, top, PREFIX, &dai_props->adata); asoc_simple_card_parse_convert(dev, top, PREFIX, &dai_props->adata);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment