[ARM] mfd: tegra-cpcap-audio: workaround for audio wakelock preventing LP0
authorGreg Meiste <w30289@motorola.com>
Wed, 6 Oct 2010 19:27:28 +0000 (14:27 -0500)
committerIliyan Malchev <malchev@google.com>
Wed, 13 Oct 2010 00:35:52 +0000 (17:35 -0700)
The audio output FIFO is not empty when the request to put audio in standby
occurs.  This stops the DMA callbacks, preventing the FIFO from ever emptying.
Therefore, audio will forever hold a wakelock, preventing the device from
entering LP0.

Change-Id: I8a642916707d07e2ff71f4e0ff7fc0f23dd41959
Signed-off-by: Greg Meiste <w30289@motorola.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
drivers/mfd/tegra-cpcap-audio.c

index ba150ad40131bb6f9c981c92b95e5fe8ab070079..4f47840f1dee3fb9994c7d340f43549a3de6e2cd 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/miscdevice.h>
 #include <linux/cpcap_audio.h>
 #include <linux/uaccess.h>
+#include <linux/delay.h>
 
 #include <mach/cpcap_audio.h>
 
@@ -259,6 +260,8 @@ static long cpcap_audio_ctl_ioctl(struct file *file, unsigned int cmd,
                        current_output.on = !out.on;
                        if (out.on) {
                                pr_info("%s: standby mode\n", __func__);
+                               /* HACK: Give output audio FIFO time to empty */
+                               msleep(100);
                                tegra_setup_audio_output_off();
                                break;
                        }