[PORT FROM R2]audio: mfld_machine: Increased the wake lock duration from 1 second...
authornamarta <namartax.kohli@intel.com>
Fri, 3 Feb 2012 10:41:54 +0000 (16:11 +0530)
committerbuildbot <buildbot@intel.com>
Mon, 13 Feb 2012 08:32:50 +0000 (00:32 -0800)
BZ: 22014

If frequent jack insertion/removal is done when phone is in S3 state, jack
events are reported by ALSA but they are not propagated to Andriod due to
hardcoded delay of 1 second in the HeadsetObserver before sending the intent.
But phone goes back to S3 state in 1 second, so intent is sent only when phone
wakes up.

Increased the wake lock duration to 2 seconds because duration of 1 second was
not sufficient.

Change-Id: I21cf5b9bb516051fbc0e0d9c2126335d03bde3fa
old-Change-Id: I64dd3d0a28107082177c88ab92c65d3b216b5f6d
Signed-off-by: namarta <namartax.kohli@intel.com>
Reviewed-on: http://android.intel.com:8080/34871
Reviewed-by: M, Arulselvan <arulselvan.m@intel.com>
Tested-by: M, Arulselvan <arulselvan.m@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
sound/soc/mid-x86/mfld_machine.c

index 52c00b0..7e433e1 100644 (file)
@@ -452,11 +452,11 @@ static irqreturn_t snd_mfld_jack_intr_handler(int irq, void *dev)
 #ifdef CONFIG_HAS_WAKELOCK
        /*
         * We don't have any call back from the jack detection completed.
-        * Take wakelock for one second to give time for the detection
+        * Take wakelock for two seconds to give time for the detection
         * to finish. Jack detection is happening rarely so this doesn't
         * have big impact to power consumption.
         */
-       wake_lock_timeout(&mc_private->wake_lock, 1*HZ);
+       wake_lock_timeout(&mc_private->wake_lock, 2*HZ);
 #endif
        return IRQ_WAKE_THREAD;
 }