aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2017-09-04 11:41:48 -0400
committerMark Brown <broonie@kernel.org>2017-09-19 10:57:56 -0400
commit9e3f9f36a6f40bb6ba9b3844d709314121e4c106 (patch)
treec711b1d47efdbe03f169ef86e7ea51c3cbc59a5f
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
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: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/arizona.c7
-rw-r--r--sound/soc/codecs/arizona.h3
-rw-r--r--sound/soc/codecs/cs47l24.c3
-rw-r--r--sound/soc/codecs/wm5102.c3
-rw-r--r--sound/soc/codecs/wm5110.c3
-rw-r--r--sound/soc/codecs/wm8997.c4
-rw-r--r--sound/soc/codecs/wm8998.c3
7 files changed, 14 insertions, 12 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index a1149f6a8450..ba5f57a58219 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -293,16 +293,13 @@ int arizona_init_gpio(struct snd_soc_codec *codec)
293} 293}
294EXPORT_SYMBOL_GPL(arizona_init_gpio); 294EXPORT_SYMBOL_GPL(arizona_init_gpio);
295 295
296int arizona_init_notifiers(struct snd_soc_codec *codec) 296int arizona_init_common(struct arizona *arizona)
297{ 297{
298 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
299 struct arizona *arizona = priv->arizona;
300
301 BLOCKING_INIT_NOTIFIER_HEAD(&arizona->notifier); 298 BLOCKING_INIT_NOTIFIER_HEAD(&arizona->notifier);
302 299
303 return 0; 300 return 0;
304} 301}
305EXPORT_SYMBOL_GPL(arizona_init_notifiers); 302EXPORT_SYMBOL_GPL(arizona_init_common);
306 303
307const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { 304const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
308 "None", 305 "None",
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 1822e3b3de80..292073ca3bd9 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -313,7 +313,8 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
313int arizona_init_spk(struct snd_soc_codec *codec); 313int arizona_init_spk(struct snd_soc_codec *codec);
314int arizona_init_gpio(struct snd_soc_codec *codec); 314int arizona_init_gpio(struct snd_soc_codec *codec);
315int arizona_init_mono(struct snd_soc_codec *codec); 315int arizona_init_mono(struct snd_soc_codec *codec);
316int arizona_init_notifiers(struct snd_soc_codec *codec); 316
317int arizona_init_common(struct arizona *arizona);
317 318
318int arizona_init_spk_irqs(struct arizona *arizona); 319int arizona_init_spk_irqs(struct arizona *arizona);
319int arizona_free_spk_irqs(struct arizona *arizona); 320int arizona_free_spk_irqs(struct arizona *arizona);
diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c
index e09fc8f037f1..fdcc7318993b 100644
--- a/sound/soc/codecs/cs47l24.c
+++ b/sound/soc/codecs/cs47l24.c
@@ -1130,7 +1130,6 @@ static int cs47l24_codec_probe(struct snd_soc_codec *codec)
1130 1130
1131 arizona_init_gpio(codec); 1131 arizona_init_gpio(codec);
1132 arizona_init_mono(codec); 1132 arizona_init_mono(codec);
1133 arizona_init_notifiers(codec);
1134 1133
1135 ret = wm_adsp2_codec_probe(&priv->core.adsp[1], codec); 1134 ret = wm_adsp2_codec_probe(&priv->core.adsp[1], codec);
1136 if (ret) 1135 if (ret)
@@ -1288,6 +1287,8 @@ static int cs47l24_probe(struct platform_device *pdev)
1288 return ret; 1287 return ret;
1289 } 1288 }
1290 1289
1290 arizona_init_common(arizona);
1291
1291 ret = arizona_init_spk_irqs(arizona); 1292 ret = arizona_init_spk_irqs(arizona);
1292 if (ret < 0) 1293 if (ret < 0)
1293 goto err_dsp_irq; 1294 goto err_dsp_irq;
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 72486bf072f2..8354bdf7fc15 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -1951,7 +1951,6 @@ static int wm5102_codec_probe(struct snd_soc_codec *codec)
1951 return ret; 1951 return ret;
1952 1952
1953 arizona_init_gpio(codec); 1953 arizona_init_gpio(codec);
1954 arizona_init_notifiers(codec);
1955 1954
1956 snd_soc_component_disable_pin(component, "HAPTICS"); 1955 snd_soc_component_disable_pin(component, "HAPTICS");
1957 1956
@@ -2098,6 +2097,8 @@ static int wm5102_probe(struct platform_device *pdev)
2098 return ret; 2097 return ret;
2099 } 2098 }
2100 2099
2100 arizona_init_common(arizona);
2101
2101 ret = arizona_init_spk_irqs(arizona); 2102 ret = arizona_init_spk_irqs(arizona);
2102 if (ret < 0) 2103 if (ret < 0)
2103 goto err_dsp_irq; 2104 goto err_dsp_irq;
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 858a24fc28e8..0437df60be77 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -2290,7 +2290,6 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
2290 2290
2291 arizona_init_gpio(codec); 2291 arizona_init_gpio(codec);
2292 arizona_init_mono(codec); 2292 arizona_init_mono(codec);
2293 arizona_init_notifiers(codec);
2294 2293
2295 for (i = 0; i < WM5110_NUM_ADSP; ++i) { 2294 for (i = 0; i < WM5110_NUM_ADSP; ++i) {
2296 ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec); 2295 ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec);
@@ -2454,6 +2453,8 @@ static int wm5110_probe(struct platform_device *pdev)
2454 return ret; 2453 return ret;
2455 } 2454 }
2456 2455
2456 arizona_init_common(arizona);
2457
2457 ret = arizona_init_spk_irqs(arizona); 2458 ret = arizona_init_spk_irqs(arizona);
2458 if (ret < 0) 2459 if (ret < 0)
2459 goto err_dsp_irq; 2460 goto err_dsp_irq;
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 49401a8aae64..91c3c3e052d1 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1068,8 +1068,6 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
1068 if (ret < 0) 1068 if (ret < 0)
1069 return ret; 1069 return ret;
1070 1070
1071 arizona_init_notifiers(codec);
1072
1073 snd_soc_component_disable_pin(component, "HAPTICS"); 1071 snd_soc_component_disable_pin(component, "HAPTICS");
1074 1072
1075 priv->core.arizona->dapm = dapm; 1073 priv->core.arizona->dapm = dapm;
@@ -1168,6 +1166,8 @@ static int wm8997_probe(struct platform_device *pdev)
1168 pm_runtime_enable(&pdev->dev); 1166 pm_runtime_enable(&pdev->dev);
1169 pm_runtime_idle(&pdev->dev); 1167 pm_runtime_idle(&pdev->dev);
1170 1168
1169 arizona_init_common(arizona);
1170
1171 ret = arizona_init_spk_irqs(arizona); 1171 ret = arizona_init_spk_irqs(arizona);
1172 if (ret < 0) 1172 if (ret < 0)
1173 return ret; 1173 return ret;
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 44f447136e22..27a8e1e75f28 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1330,7 +1330,6 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
1330 return ret; 1330 return ret;
1331 1331
1332 arizona_init_gpio(codec); 1332 arizona_init_gpio(codec);
1333 arizona_init_notifiers(codec);
1334 1333
1335 snd_soc_component_disable_pin(component, "HAPTICS"); 1334 snd_soc_component_disable_pin(component, "HAPTICS");
1336 1335
@@ -1423,6 +1422,8 @@ static int wm8998_probe(struct platform_device *pdev)
1423 pm_runtime_enable(&pdev->dev); 1422 pm_runtime_enable(&pdev->dev);
1424 pm_runtime_idle(&pdev->dev); 1423 pm_runtime_idle(&pdev->dev);
1425 1424
1425 arizona_init_common(arizona);
1426
1426 ret = arizona_init_spk_irqs(arizona); 1427 ret = arizona_init_spk_irqs(arizona);
1427 if (ret < 0) 1428 if (ret < 0)
1428 return ret; 1429 return ret;