summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShreshtha Sahu <ssahu@nvidia.com>2014-04-21 17:35:50 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-05-23 12:46:34 -0700
commitb718b347c03acf8737ec21fcad62296b1423bc1c (patch)
tree4329b00b17cca7067a27145b1c2098df8fbd3123 /sound
parentddc990ebd1548cac8fb2a3fe0f89dac43077020a (diff)
soc: codecs: max98090: fix interrupt registration
This patch clears previous interrupt and installs interrupt handler at the end of device probe. Also it enables jack detection only after handler is installed. This prevents, false/stale interrupt generation and hence device access by interrupt handler even before device probe has completed. Bug 1464724 Change-Id: I5988b500bb5e197c095eb64e254829635115994c Signed-off-by: Shreshtha Sahu <ssahu@nvidia.com> Reviewed-on: http://git-master/r/398891 (cherry picked from commit 9368b1bb2d85286b8ef890d63e6f3d41c63b0bdc) Reviewed-on: http://git-master/r/411451 GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/max98090.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 6cb4102c41c0..3eda6a9c934e 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -3756,19 +3756,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
INIT_DELAYED_WORK(&max98090->jack_work, max98090_jack_work);
- /* Enable jack detection */
- snd_soc_write(codec, M98090_REG_3D_CFG_JACK,
- M98090_JDETEN_MASK | M98090_JDEB_25MS);
-
max98090_handle_pdata(codec);
- /* Register for interrupts */
- if ((request_threaded_irq(audio_int, NULL,
- max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- "max98090_interrupt", codec)) < 0) {
- dev_info(codec->dev, "request_irq failed\n");
- }
-
#ifdef MAX98090_HIGH_PERFORMANCE
/* High Performance */
snd_soc_update_bits(codec, M98090_REG_43_DAC_CFG,
@@ -3799,6 +3788,20 @@ static int max98090_probe(struct snd_soc_codec *codec)
max98090_add_widgets(codec);
+ /* Clear existing interrupts */
+ snd_soc_read(codec, M98090_REG_01_IRQ_STATUS);
+
+ /* Register for interrupts */
+ if ((request_threaded_irq(audio_int, NULL,
+ max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ "max98090_interrupt", codec)) < 0) {
+ dev_info(codec->dev, "request_irq failed\n");
+ }
+
+ /* Enable jack detection */
+ snd_soc_write(codec, M98090_REG_3D_CFG_JACK,
+ M98090_JDETEN_MASK | M98090_JDEB_25MS);
+
err_access:
return ret;
}