summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8998.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-10-26 11:59:57 +0200
committerMark Brown <broonie@kernel.org>2016-10-26 12:07:11 +0200
commit31833ead95c2c0a374f35a8ae8148c00459a0d49 (patch)
tree93db65f3eacb7550850f5422190afc4656cc7079 /sound/soc/codecs/wm8998.c
parentASoC: arizona: Add gating for source clocks of the FLLs (diff)
downloadlinux-31833ead95c2c0a374f35a8ae8148c00459a0d49.tar.xz
linux-31833ead95c2c0a374f35a8ae8148c00459a0d49.zip
ASoC: arizona: Move request of speaker IRQs into bus probe
It is more idiomatic to request all resources in the bus level probe, this patch moves the request of the speaker thermal event IRQs from the ASoC level probe into the bus level probe. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm8998.c')
-rw-r--r--sound/soc/codecs/wm8998.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 3eaa3615b82e..4cccaae6dcfa 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1337,8 +1337,6 @@ static int wm8998_codec_remove(struct snd_soc_codec *codec)
priv->core.arizona->dapm = NULL;
- arizona_free_spk(codec);
-
return 0;
}
@@ -1387,7 +1385,7 @@ static int wm8998_probe(struct platform_device *pdev)
{
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
struct wm8998_priv *wm8998;
- int i;
+ int i, ret;
wm8998 = devm_kzalloc(&pdev->dev, sizeof(struct wm8998_priv),
GFP_KERNEL);
@@ -1419,15 +1417,35 @@ static int wm8998_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
- return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8998,
- wm8998_dai, ARRAY_SIZE(wm8998_dai));
+ ret = arizona_init_spk_irqs(arizona);
+ if (ret < 0)
+ return ret;
+
+ ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8998,
+ wm8998_dai, ARRAY_SIZE(wm8998_dai));
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to register codec: %d\n", ret);
+ goto err_spk_irqs;
+ }
+
+ return ret;
+
+err_spk_irqs:
+ arizona_free_spk_irqs(arizona);
+
+ return ret;
}
static int wm8998_remove(struct platform_device *pdev)
{
+ struct wm8998_priv *wm8998 = platform_get_drvdata(pdev);
+ struct arizona *arizona = wm8998->core.arizona;
+
snd_soc_unregister_codec(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ arizona_free_spk_irqs(arizona);
+
return 0;
}