msm: Replace idle wakelocks with pm_qos

Idle wakelocks are being removed so replace them with pm_qos.
Since we don't know every driver's latency requirements we
maintain one-to-one compatabilty with the idle wakelock API by
replacing the wakelock with a pm_qos request of the correct
latency.

Once we determine the actual latency requirements of each driver
we can replace the latency used with the correct latency for the
device.

Change-Id: Icc40f1642218e0de8fc2f56eaf9e8f92914d142f
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/drivers/mfd/wcd9xxx-irq.c b/drivers/mfd/wcd9xxx-irq.c
index ba3c1e8..68c4557 100644
--- a/drivers/mfd/wcd9xxx-irq.c
+++ b/drivers/mfd/wcd9xxx-irq.c
@@ -20,6 +20,8 @@
 #include <linux/mfd/wcd9xxx/wcd9310_registers.h>
 #include <linux/interrupt.h>
 
+#include <mach/cpuidle.h>
+
 #define BYTE_BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_BYTE))
 #define BIT_BYTE(nr)			((nr) / BITS_PER_BYTE)
 
@@ -113,7 +115,8 @@
 	mutex_lock(&wcd9xxx->pm_lock);
 	if (wcd9xxx->wlock_holders++ == 0) {
 		pr_debug("%s: holding wake lock\n", __func__);
-		wake_lock(&wcd9xxx->wlock);
+		pm_qos_update_request(&wcd9xxx->pm_qos_req,
+				      msm_cpuidle_get_deep_idle_latency());
 	}
 	mutex_unlock(&wcd9xxx->pm_lock);
 	if (!wait_event_timeout(wcd9xxx->pm_wq,
@@ -140,7 +143,8 @@
 	if (--wcd9xxx->wlock_holders == 0) {
 		wcd9xxx->pm_state = WCD9XXX_PM_SLEEPABLE;
 		pr_debug("%s: releasing wake lock\n", __func__);
-		wake_unlock(&wcd9xxx->wlock);
+		pm_qos_update_request(&wcd9xxx->pm_qos_req,
+				PM_QOS_DEFAULT_VALUE);
 	}
 	mutex_unlock(&wcd9xxx->pm_lock);
 	wake_up_all(&wcd9xxx->pm_wq);