aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorLars-Peter Clausen2014-06-16 18:13:01 +0200
committerMark Brown2014-06-21 21:03:22 +0100
commit94f99c875c109e51decf0d8c25ec2c946db20c56 (patch)
tree29bdcf055b85588e64553eec9353bf47919100c0 /sound/soc/soc-core.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
ASoC: Move name_prefix from CODEC to component
Move the name_prefix from the CODEC struct to the component struct. This will eventually allow to specify prefixes for all types of components. It is also necessary to make the DAPM code component type independent (i.e. a DAPM context does not need to know whether it belongs to a CODEC or a platform or something else). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b87d7d882e6d..ba822e927187 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1108,7 +1108,7 @@ static void soc_remove_dai_links(struct snd_soc_card *card)
}
static void soc_set_name_prefix(struct snd_soc_card *card,
- struct snd_soc_codec *codec)
+ struct snd_soc_component *component)
{
int i;
@@ -1117,11 +1117,11 @@ static void soc_set_name_prefix(struct snd_soc_card *card,
for (i = 0; i < card->num_configs; i++) {
struct snd_soc_codec_conf *map = &card->codec_conf[i];
- if (map->of_node && codec->dev->of_node != map->of_node)
+ if (map->of_node && component->dev->of_node != map->of_node)
continue;
- if (map->dev_name && strcmp(codec->name, map->dev_name))
+ if (map->dev_name && strcmp(component->name, map->dev_name))
continue;
- codec->name_prefix = map->name_prefix;
+ component->name_prefix = map->name_prefix;
break;
}
}
@@ -1135,7 +1135,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
codec->card = card;
codec->dapm.card = card;
- soc_set_name_prefix(card, codec);
+ soc_set_name_prefix(card, &codec->component);
if (!try_module_get(codec->dev->driver->owner))
return -ENODEV;
@@ -2403,7 +2403,7 @@ int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
struct snd_card *card = codec->card->snd_card;
return snd_soc_add_controls(card, codec->dev, controls, num_controls,
- codec->name_prefix, &codec->component);
+ codec->component.name_prefix, &codec->component);
}
EXPORT_SYMBOL_GPL(snd_soc_add_codec_controls);