From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
It is assuming that the card related information is located on "card" node, but graph case doesn't have it. This patch adds node parameter to adjust for graph support
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- v2 -> v3
- no change
include/sound/simple_card_utils.h | 1 + sound/soc/generic/simple-card-utils.c | 3 ++- sound/soc/generic/simple-card.c | 2 +- sound/soc/generic/simple-scu-card.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 7006150..afca6bd 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -36,6 +36,7 @@ int asoc_simple_card_set_dailink_name(struct device *dev, struct snd_soc_dai_link *dai_link, const char *fmt, ...); int asoc_simple_card_parse_card_name(struct snd_soc_card *card, + struct device_node *node, char *prefix);
#define asoc_simple_card_parse_clk_cpu(node, dai_link, simple_dai) \ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 85120f5..604f1f9 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -81,6 +81,7 @@ int asoc_simple_card_set_dailink_name(struct device *dev, EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name);
int asoc_simple_card_parse_card_name(struct snd_soc_card *card, + struct device_node *node, char *prefix) { char prop[128]; @@ -89,7 +90,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, snprintf(prop, sizeof(prop), "%sname", prefix);
/* Parse the card name from DT */ - ret = snd_soc_of_parse_card_name(card, prop); + ret = snd_soc_of_parse_card_name_from_node(card, node, prop); if (ret < 0) return ret;
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index f608f8d2..342ff53 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -401,7 +401,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, goto card_parse_end; }
- ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX); + ret = asoc_simple_card_parse_card_name(&priv->snd_card, NULL, PREFIX); if (ret < 0) goto card_parse_end;
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index 348e9a7..a8164a2 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -239,7 +239,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, i++; }
- ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX); + ret = asoc_simple_card_parse_card_name(&priv->snd_card, NULL, PREFIX); if (ret < 0) return ret;