diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-10-26 11:59:57 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-10-26 12:07:11 +0200 |
commit | 31833ead95c2c0a374f35a8ae8148c00459a0d49 (patch) | |
tree | 93db65f3eacb7550850f5422190afc4656cc7079 /sound/soc/codecs/wm5110.c | |
parent | ASoC: arizona: Add gating for source clocks of the FLLs (diff) | |
download | linux-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/wm5110.c')
-rw-r--r-- | sound/soc/codecs/wm5110.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index 407dc4a43b07..667fc25dd094 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -2330,8 +2330,6 @@ static int wm5110_codec_remove(struct snd_soc_codec *codec) arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv); - arizona_free_spk(codec); - return 0; } @@ -2453,25 +2451,37 @@ static int wm5110_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); pm_runtime_idle(&pdev->dev); + ret = arizona_init_spk_irqs(arizona); + if (ret < 0) + return ret; + ret = snd_soc_register_platform(&pdev->dev, &wm5110_compr_platform); if (ret < 0) { dev_err(&pdev->dev, "Failed to register platform: %d\n", ret); - return ret; + goto err_spk_irqs; } ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110, wm5110_dai, ARRAY_SIZE(wm5110_dai)); if (ret < 0) { dev_err(&pdev->dev, "Failed to register codec: %d\n", ret); - snd_soc_unregister_platform(&pdev->dev); + goto err_platform; } return ret; + +err_platform: + snd_soc_unregister_platform(&pdev->dev); +err_spk_irqs: + arizona_free_spk_irqs(arizona); + + return ret; } static int wm5110_remove(struct platform_device *pdev) { struct wm5110_priv *wm5110 = platform_get_drvdata(pdev); + struct arizona *arizona = wm5110->core.arizona; int i; snd_soc_unregister_platform(&pdev->dev); @@ -2481,6 +2491,8 @@ static int wm5110_remove(struct platform_device *pdev) for (i = 0; i < WM5110_NUM_ADSP; i++) wm_adsp2_remove(&wm5110->core.adsp[i]); + arizona_free_spk_irqs(arizona); + return 0; } |