aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2016-11-10 20:18:08 -0500
committerMark Brown <broonie@kernel.org>2016-11-11 10:22:02 -0500
commit1ef5bcd57be5c8b31286b7b47828064be25f266b (patch)
treebe392096d559dd3f8b06a53507769264bb185164
parent8f5ebb1bee15b5720741a98414767bb86f6c2b23 (diff)
ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_simple_widgets
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> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h8
-rw-r--r--sound/soc/soc-core.c9
2 files changed, 12 insertions, 5 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 8457aab9eab0..77b01c45ee8d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1647,8 +1647,12 @@ void snd_soc_util_exit(void);
1647int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card, 1647int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card,
1648 struct device_node *np, 1648 struct device_node *np,
1649 const char *propname); 1649 const char *propname);
1650int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, 1650#define snd_soc_of_parse_audio_simple_widgets(card, propname)\
1651 const char *propname); 1651 snd_soc_of_parse_audio_simple_widgets_from_node(card, NULL, propname)
1652int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card,
1653 struct device_node *np,
1654 const char *propname);
1655
1652int snd_soc_of_parse_tdm_slot(struct device_node *np, 1656int snd_soc_of_parse_tdm_slot(struct device_node *np,
1653 unsigned int *tx_mask, 1657 unsigned int *tx_mask,
1654 unsigned int *rx_mask, 1658 unsigned int *rx_mask,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 17132fb57930..6f911f4d413a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3462,14 +3462,17 @@ static const struct snd_soc_dapm_widget simple_widgets[] = {
3462 SND_SOC_DAPM_SPK("Speaker", NULL), 3462 SND_SOC_DAPM_SPK("Speaker", NULL),
3463}; 3463};
3464 3464
3465int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, 3465int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card,
3466 struct device_node *np,
3466 const char *propname) 3467 const char *propname)
3467{ 3468{
3468 struct device_node *np = card->dev->of_node;
3469 struct snd_soc_dapm_widget *widgets; 3469 struct snd_soc_dapm_widget *widgets;
3470 const char *template, *wname; 3470 const char *template, *wname;
3471 int i, j, num_widgets, ret; 3471 int i, j, num_widgets, ret;
3472 3472
3473 if (!np)
3474 np = card->dev->of_node;
3475
3473 num_widgets = of_property_count_strings(np, propname); 3476 num_widgets = of_property_count_strings(np, propname);
3474 if (num_widgets < 0) { 3477 if (num_widgets < 0) {
3475 dev_err(card->dev, 3478 dev_err(card->dev,
@@ -3540,7 +3543,7 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
3540 3543
3541 return 0; 3544 return 0;
3542} 3545}
3543EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets); 3546EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets_from_node);
3544 3547
3545static int snd_soc_of_get_slot_mask(struct device_node *np, 3548static int snd_soc_of_get_slot_mask(struct device_node *np,
3546 const char *prop_name, 3549 const char *prop_name,