Commit 1a456b1c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c

audio-graph-card2 can reuse audio_graph_card_probe().
This patch moves it to simple-card-utils.c.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgxv3uc4.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ec1af6c6
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <sound/simple_card_utils.h> #include <sound/simple_card_utils.h>
int audio_graph_card_probe(struct snd_soc_card *card);
int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev); int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
int audio_graph_remove(struct platform_device *pdev); int audio_graph_remove(struct platform_device *pdev);
......
...@@ -178,6 +178,9 @@ int asoc_simple_init_jack(struct snd_soc_card *card, ...@@ -178,6 +178,9 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
int asoc_simple_init_priv(struct asoc_simple_priv *priv, int asoc_simple_init_priv(struct asoc_simple_priv *priv,
struct link_info *li); struct link_info *li);
int asoc_graph_card_probe(struct snd_soc_card *card);
#ifdef DEBUG #ifdef DEBUG
static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv, static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
char *name, char *name,
......
...@@ -721,23 +721,6 @@ static int graph_get_dais_count(struct asoc_simple_priv *priv, ...@@ -721,23 +721,6 @@ static int graph_get_dais_count(struct asoc_simple_priv *priv,
graph_count_dpcm); graph_count_dpcm);
} }
int audio_graph_card_probe(struct snd_soc_card *card)
{
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
int ret;
ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
if (ret < 0)
return ret;
ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
if (ret < 0)
return ret;
return 0;
}
EXPORT_SYMBOL_GPL(audio_graph_card_probe);
static int graph_probe(struct platform_device *pdev) static int graph_probe(struct platform_device *pdev)
{ {
struct asoc_simple_priv *priv; struct asoc_simple_priv *priv;
...@@ -752,7 +735,7 @@ static int graph_probe(struct platform_device *pdev) ...@@ -752,7 +735,7 @@ static int graph_probe(struct platform_device *pdev)
card = simple_priv_to_card(priv); card = simple_priv_to_card(priv);
card->dapm_widgets = graph_dapm_widgets; card->dapm_widgets = graph_dapm_widgets;
card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets); card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets);
card->probe = audio_graph_card_probe; card->probe = asoc_graph_card_probe;
if (of_device_get_match_data(dev)) if (of_device_get_match_data(dev))
priv->dpcm_selectable = 1; priv->dpcm_selectable = 1;
......
...@@ -740,6 +740,23 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv, ...@@ -740,6 +740,23 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
} }
EXPORT_SYMBOL_GPL(asoc_simple_init_priv); EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
int asoc_graph_card_probe(struct snd_soc_card *card)
{
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
int ret;
ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
if (ret < 0)
return ret;
ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
if (ret < 0)
return ret;
return 0;
}
EXPORT_SYMBOL_GPL(asoc_graph_card_probe);
/* Module information */ /* Module information */
MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"); MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
MODULE_DESCRIPTION("ALSA SoC Simple Card Utils"); MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");
......
...@@ -184,7 +184,7 @@ static int tegra_audio_graph_card_probe(struct snd_soc_card *card) ...@@ -184,7 +184,7 @@ static int tegra_audio_graph_card_probe(struct snd_soc_card *card)
return PTR_ERR(priv->clk_plla_out0); return PTR_ERR(priv->clk_plla_out0);
} }
return audio_graph_card_probe(card); return asoc_graph_card_probe(card);
} }
static int tegra_audio_graph_probe(struct platform_device *pdev) static int tegra_audio_graph_probe(struct platform_device *pdev)
......
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