aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/wm8997.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-10-26 10:59:57 +0100
committerMark Brown <broonie@kernel.org>2016-10-26 11:07:11 +0100
commit31833ead95c2c0a374f35a8ae8148c00459a0d49 (patch)
tree93db65f3eacb7550850f5422190afc4656cc7079 /sound/soc/codecs/wm8997.c
parentASoC: arizona: Add gating for source clocks of the FLLs (diff)
downloadwireguard-linux-31833ead95c2c0a374f35a8ae8148c00459a0d49.tar.xz
wireguard-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/wm8997.c')
-rw-r--r--sound/soc/codecs/wm8997.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index f5f5d4352670..600595c54fe7 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1077,8 +1077,6 @@ static int wm8997_codec_remove(struct snd_soc_codec *codec)
priv->core.arizona->dapm = NULL;
- arizona_free_spk(codec);
-
return 0;
}
@@ -1124,7 +1122,7 @@ static int wm8997_probe(struct platform_device *pdev)
{
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
struct wm8997_priv *wm8997;
- int i;
+ int i, ret;
wm8997 = devm_kzalloc(&pdev->dev, sizeof(struct wm8997_priv),
GFP_KERNEL);
@@ -1164,15 +1162,33 @@ static int wm8997_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_wm8997,
- wm8997_dai, ARRAY_SIZE(wm8997_dai));
+ ret = arizona_init_spk_irqs(arizona);
+ if (ret < 0)
+ return ret;
+
+ ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8997,
+ wm8997_dai, ARRAY_SIZE(wm8997_dai));
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to register codec: %d\n", ret);
+ goto err_spk_irqs;
+ }
+
+err_spk_irqs:
+ arizona_free_spk_irqs(arizona);
+
+ return ret;
}
static int wm8997_remove(struct platform_device *pdev)
{
+ struct wm8997_priv *wm8997 = platform_get_drvdata(pdev);
+ struct arizona *arizona = wm8997->core.arizona;
+
snd_soc_unregister_codec(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ arizona_free_spk_irqs(arizona);
+
return 0;
}