Commit 9e3f9f36 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: arizona: Add new common Arizona init function

Currently the driver has quite a few small initialisation functions, in
preparation for some refactoring add a new function arizona_init_common.
This will be used bus probe level initialisation that is common across
Arizona devices. For now just move the notifier chain initialisation in
there.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2bd6bf03
...@@ -293,16 +293,13 @@ int arizona_init_gpio(struct snd_soc_codec *codec) ...@@ -293,16 +293,13 @@ int arizona_init_gpio(struct snd_soc_codec *codec)
} }
EXPORT_SYMBOL_GPL(arizona_init_gpio); EXPORT_SYMBOL_GPL(arizona_init_gpio);
int arizona_init_notifiers(struct snd_soc_codec *codec) int arizona_init_common(struct arizona *arizona)
{ {
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
BLOCKING_INIT_NOTIFIER_HEAD(&arizona->notifier); BLOCKING_INIT_NOTIFIER_HEAD(&arizona->notifier);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(arizona_init_notifiers); EXPORT_SYMBOL_GPL(arizona_init_common);
const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
"None", "None",
......
...@@ -313,7 +313,8 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -313,7 +313,8 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
int arizona_init_spk(struct snd_soc_codec *codec); int arizona_init_spk(struct snd_soc_codec *codec);
int arizona_init_gpio(struct snd_soc_codec *codec); int arizona_init_gpio(struct snd_soc_codec *codec);
int arizona_init_mono(struct snd_soc_codec *codec); int arizona_init_mono(struct snd_soc_codec *codec);
int arizona_init_notifiers(struct snd_soc_codec *codec);
int arizona_init_common(struct arizona *arizona);
int arizona_init_spk_irqs(struct arizona *arizona); int arizona_init_spk_irqs(struct arizona *arizona);
int arizona_free_spk_irqs(struct arizona *arizona); int arizona_free_spk_irqs(struct arizona *arizona);
......
...@@ -1130,7 +1130,6 @@ static int cs47l24_codec_probe(struct snd_soc_codec *codec) ...@@ -1130,7 +1130,6 @@ static int cs47l24_codec_probe(struct snd_soc_codec *codec)
arizona_init_gpio(codec); arizona_init_gpio(codec);
arizona_init_mono(codec); arizona_init_mono(codec);
arizona_init_notifiers(codec);
ret = wm_adsp2_codec_probe(&priv->core.adsp[1], codec); ret = wm_adsp2_codec_probe(&priv->core.adsp[1], codec);
if (ret) if (ret)
...@@ -1288,6 +1287,8 @@ static int cs47l24_probe(struct platform_device *pdev) ...@@ -1288,6 +1287,8 @@ static int cs47l24_probe(struct platform_device *pdev)
return ret; return ret;
} }
arizona_init_common(arizona);
ret = arizona_init_spk_irqs(arizona); ret = arizona_init_spk_irqs(arizona);
if (ret < 0) if (ret < 0)
goto err_dsp_irq; goto err_dsp_irq;
......
...@@ -1951,7 +1951,6 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec) ...@@ -1951,7 +1951,6 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
return ret; return ret;
arizona_init_gpio(codec); arizona_init_gpio(codec);
arizona_init_notifiers(codec);
snd_soc_component_disable_pin(component, "HAPTICS"); snd_soc_component_disable_pin(component, "HAPTICS");
...@@ -2098,6 +2097,8 @@ static int wm5102_probe(struct platform_device *pdev) ...@@ -2098,6 +2097,8 @@ static int wm5102_probe(struct platform_device *pdev)
return ret; return ret;
} }
arizona_init_common(arizona);
ret = arizona_init_spk_irqs(arizona); ret = arizona_init_spk_irqs(arizona);
if (ret < 0) if (ret < 0)
goto err_dsp_irq; goto err_dsp_irq;
......
...@@ -2290,7 +2290,6 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec) ...@@ -2290,7 +2290,6 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
arizona_init_gpio(codec); arizona_init_gpio(codec);
arizona_init_mono(codec); arizona_init_mono(codec);
arizona_init_notifiers(codec);
for (i = 0; i < WM5110_NUM_ADSP; ++i) { for (i = 0; i < WM5110_NUM_ADSP; ++i) {
ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec); ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec);
...@@ -2454,6 +2453,8 @@ static int wm5110_probe(struct platform_device *pdev) ...@@ -2454,6 +2453,8 @@ static int wm5110_probe(struct platform_device *pdev)
return ret; return ret;
} }
arizona_init_common(arizona);
ret = arizona_init_spk_irqs(arizona); ret = arizona_init_spk_irqs(arizona);
if (ret < 0) if (ret < 0)
goto err_dsp_irq; goto err_dsp_irq;
......
...@@ -1068,8 +1068,6 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec) ...@@ -1068,8 +1068,6 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
if (ret < 0) if (ret < 0)
return ret; return ret;
arizona_init_notifiers(codec);
snd_soc_component_disable_pin(component, "HAPTICS"); snd_soc_component_disable_pin(component, "HAPTICS");
priv->core.arizona->dapm = dapm; priv->core.arizona->dapm = dapm;
...@@ -1168,6 +1166,8 @@ static int wm8997_probe(struct platform_device *pdev) ...@@ -1168,6 +1166,8 @@ static int wm8997_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev); pm_runtime_idle(&pdev->dev);
arizona_init_common(arizona);
ret = arizona_init_spk_irqs(arizona); ret = arizona_init_spk_irqs(arizona);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -1330,7 +1330,6 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec) ...@@ -1330,7 +1330,6 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
return ret; return ret;
arizona_init_gpio(codec); arizona_init_gpio(codec);
arizona_init_notifiers(codec);
snd_soc_component_disable_pin(component, "HAPTICS"); snd_soc_component_disable_pin(component, "HAPTICS");
...@@ -1423,6 +1422,8 @@ static int wm8998_probe(struct platform_device *pdev) ...@@ -1423,6 +1422,8 @@ static int wm8998_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev); pm_runtime_idle(&pdev->dev);
arizona_init_common(arizona);
ret = arizona_init_spk_irqs(arizona); ret = arizona_init_spk_irqs(arizona);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
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