Commit b24c539b authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: core: Allow codec_conf DT lookups to match parent of_node

For devices implemented as a MFD it is common to only have a single node
in devicetree representing the whole device. As such when looking up
codec_conf mappings we should match against both the devices of_node and
the devices parent's of_node, as is already done for DAIs and platform
components.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 58edf325
...@@ -1383,7 +1383,12 @@ static void soc_set_name_prefix(struct snd_soc_card *card, ...@@ -1383,7 +1383,12 @@ static void soc_set_name_prefix(struct snd_soc_card *card,
for (i = 0; i < card->num_configs; i++) { for (i = 0; i < card->num_configs; i++) {
struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct snd_soc_codec_conf *map = &card->codec_conf[i];
if (map->of_node && component->dev->of_node != map->of_node) struct device_node *component_of_node = component->dev->of_node;
if (!component_of_node && component->dev->parent)
component_of_node = component->dev->parent->of_node;
if (map->of_node && component_of_node != map->of_node)
continue; continue;
if (map->dev_name && strcmp(component->name, map->dev_name)) if (map->dev_name && strcmp(component->name, map->dev_name))
continue; continue;
......
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