aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9713.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-23 16:21:37 +0100
committerMark Brown <broonie@kernel.org>2015-01-26 19:15:06 +0000
commitf8d71be5553a3fbc20363243ecfc11dcdd1e18fe (patch)
tree4f7f5cb3973ea959c1f3d5ef6d0fda0d2e0a4904 /sound/soc/codecs/wm9713.c
parentASoC: Add support for allocating AC'97 device before registering it (diff)
downloadlinux-dev-f8d71be5553a3fbc20363243ecfc11dcdd1e18fe.tar.xz
linux-dev-f8d71be5553a3fbc20363243ecfc11dcdd1e18fe.zip
ASoC: wm97xx: Reset AC'97 device before registering it
The wm97xx touchscreen driver binds itself to the snd_ac97 device that gets registered by the CODEC driver and expects that the device has already been reset. Before commit 6794f709b712 ("ASoC: ac97: Drop delayed device registration") the device was only registered after the probe function of the CODEC driver had finished running, but starting with the mentioned commit the device is registered as soon as snd_soc_new_ac97_codec() is called. This causes the touchscreen driver to no longer work. Modify the CODEC drivers to use snd_soc_alloc_ac97_codec() instead of snd_soc_new_ac97_codec() and make sure that the AC'97 device is reset before the snd_ac97 device gets registered. Fixes: 6794f709b712 ("ASoC: ac97: Drop delayed device registration") Reported-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Manuel Lauss <manuel.lauss@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r--sound/soc/codecs/wm9713.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 71b9d5b0734d..6ab1122a3872 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
int ret = 0, reg;
- wm9713->ac97 = snd_soc_new_ac97_codec(codec);
+ wm9713->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9713->ac97))
return PTR_ERR(wm9713->ac97);
@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
wm9713_reset(codec, 0);
ret = wm9713_reset(codec, 1);
if (ret < 0)
- goto reset_err;
+ goto err_put_device;
+
+ ret = device_add(&wm9713->ac97->dev);
+ if (ret)
+ goto err_put_device;
/* unmute the adc - move to kcontrol */
reg = ac97_read(codec, AC97_CD) & 0x7fff;
@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
return 0;
-reset_err:
- snd_soc_free_ac97_codec(wm9713->ac97);
+err_put_device:
+ put_device(&wm9713->ac97->dev);
return ret;
}