diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-10-26 10:59:57 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-10-26 11:07:11 +0100 |
commit | 31833ead95c2c0a374f35a8ae8148c00459a0d49 (patch) | |
tree | 93db65f3eacb7550850f5422190afc4656cc7079 /sound/soc/codecs/wm5102.c | |
parent | ae1ea48c5c5998c5730cebaa2374ab02ad4d7d4f (diff) |
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/wm5102.c')
-rw-r--r-- | sound/soc/codecs/wm5102.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index bb3de5b3d816..6f40ee6f0bbc 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -1978,8 +1978,6 @@ static int wm5102_codec_remove(struct snd_soc_codec *codec) arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv); - arizona_free_spk(codec); - return 0; } @@ -2097,25 +2095,37 @@ static int wm5102_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, &wm5102_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_wm5102, wm5102_dai, ARRAY_SIZE(wm5102_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 wm5102_remove(struct platform_device *pdev) { struct wm5102_priv *wm5102 = platform_get_drvdata(pdev); + struct arizona *arizona = wm5102->core.arizona; snd_soc_unregister_platform(&pdev->dev); snd_soc_unregister_codec(&pdev->dev); @@ -2123,6 +2133,8 @@ static int wm5102_remove(struct platform_device *pdev) wm_adsp2_remove(&wm5102->core.adsp[0]); + arizona_free_spk_irqs(arizona); + return 0; } |