PM / Sleep: Use wait queue to signal "no wakeup events in progress"

The current wakeup source deactivation code doesn't do anything when
the
counter of wakeup events in progress goes down to zero, which
requires
pm_get_wakeup_count() to poll that counter periodically.
Although this
reduces the average time it takes to deactivate a
wakeup source, it also
may lead to a substantial amount of unnecessary
polling if there are
extended periods of wakeup activity.  Thus it
seems reasonable to use a
wait queue for signaling the "no wakeup
events in progress" condition
and remove the polling.

Change-Id:
I19bfca1a13fa3d7437c7207575a4ebde60ad25cd
Signed-off-by: Rafael J.
Wysocki <rjw@sisk.pl>
Acked-by: mark gross
<markgross@thegnar.org>
Acked-by: Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Git-commit: 60af106
Git-repo:
git://codeaurora.org/kernel/msm.git
Signed-off-by: Anurag Singh
<anursing@codeaurora.org>

Conflicts:
 drivers/base/power/wakeup.c

idea
is taken here -
https://github.com/rmbq/android_kernel_htc_msm8960/commit/fb8234c2395064102f518f53ea4be66079d89255