Revert "WIFI: do not use powersuspend for WIFI, it's has it's own PM triggers."

This reverts commit 2cbc2c8bfbcd43a9e0e894e289918498d2346ce6.

People reporting that WIFI drain mre power when suspended, right after this change.
and WIFI wakelock is a lot higher than before.

So revert this change.
Revert "Turn OFF HTC ASYNC_FSYNC code for all models."

This reverts commit 5b71591529853eccb150cd7a1ba4210e22c41a0e.

RESTORE HTC ASYNC, seems that it's was saving some power, and was
not the problem maker, it's was all in MMC code.
RESTORE MMC WAKE/SUSPEND Functions: MMC bug was in other commit.

This restores:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/001fdb4ca1cd06ba4176567d3eec67f28f900dd1
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/1a6c77ca40177f4ff8f6af60ab8197cd16a858c6
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/545d315391b0613932adfd373b934767184f5e21
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/f436acc570d16bf330b875fcd94b077e55051a58
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/e439062ac344a9bd88b5560f58b6ef654e35c60a

Need to deep test this changes.

Any way power usage was higher than with all this added. so restore it.
ASoC: wcd9xxx: Handle fake mechanical interrupt

Handle fake mechanical interrupt during slow insertion of
headset usecase when the plug type is detected as lineout.

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Disable current source in error scenarios

Sometimes during removal, fake electrical removal interrupt
can also get generated. In that case, current source needs
to be disabled after a round of DCE measurements. Otherwise,
next time when the plug is re-inserted, measurements can go
wrong and hence plug type can be wrongly detected.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Revert "ASoC: wcd9xxx: Check headset insertion for consistency"

* Superseded by the next patch, which also eliminates the long delay
  when certain types of headsets are inserted.

This reverts commit 214c08b71f93d48abcf273e3f211f17c876605d5.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Continue polling for Unsupported plug types

Sometimes slow insertion of headphone could lead to
detection of unsupported plug types. In these cases,
continue polling so that headphone can be detected
once it is fully inserted.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Fix inaccurate accounting for real-time task

It is possible that rq->clock_task was not updated in put_prev_task()
in which case we can potentially overcharge a real-time task for time
it did not run. This is because clock_task could be stale and not
represent the exact time real-time task started running.

Fix this by forcing update of rq->clock_task when real-time task
starts running.

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>