MMC: Reverting all WAKE/SUSPEND changes to fix MMC hangs during suspend.

This reverts:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/e439062ac344a9bd88b5560f58b6ef654e35c60a
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/f436acc570d16bf330b875fcd94b077e55051a58
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/545d315391b0613932adfd373b934767184f5e21
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/1a6c77ca40177f4ff8f6af60ab8197cd16a858c6
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/001fdb4ca1cd06ba4176567d3eec67f28f900dd1
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0049ab570ada4b84909e43f5f89db47c01951e94
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/6241623da43deeaaef849ac451ed6b2b6d499898
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/ae8695e2fd8021f64c4748f1b0ebc872ebc1778b
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/38f752bed0ea0be8573a765e7ea84ba4c6424e3a
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0ec4df36a63aee16f2d37cdc8ef0400d7433ba36
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/8b00c3d522e4332f789830b8181bb8f60bb810f4

I need stability, i dont see any change with all that added. but i see dead MMC...
now ok after many tests.
CONFIG UPDATE: found BUG with MMC config. now all OK again. READ MORE.

I was not able to set discard on any mounted partitions! and to use trim
when mmc in suspend. that cause SOD, kernel hang in mmc suspend/resume.

by default LG dont use deffered suspend, so i have disabled.
we need the HPI! and it's was disabled, that caused the major SOD bugs.
once ENABLED, all OK now.

About the SHA1_ARM_NEON && SHA512_ARM_NEON seems to brake L2TP VPN.
Need to test if OK now. was working in kernel 8.5 then stop in 8.6
when i added this code. other things have no connection to vpn/encrypt
so it's must be this.
cpufreq_intellimm: intelliminmax cpu governor initial baseline commit

intelliminmax (intellimm) governor is designed to work with the newer SOCs with fixed voltage rails (ie MSM8974+ SOCs).  It is designed to work within those
fixed voltage ranges in order to maximize battery performance while creating a
smooth UI operations.

Copyright 2014 Paul Reioux <aka faux123>

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: Intellimm: remove unused code and change tblmap algorithm

tblmap: add power-save frequencies for the first 5 entries

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: more tweaks and table clean up

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: more tweaks

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: clean up derpy logic

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: final clean up and algorithm tweaks

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: finalizing part 2

Signed-off-by: Paul Reioux <reioux@gmail.com>

WIP: intellimm: finalizing part 3

add back burst for smoother UI

Signed-off-by: Paul Reioux <reioux@gmail.com>

intellimm: fix div by zero derp

Signed-off-by: Paul Reioux <reioux@gmail.com>
CONFIG: Enable CPU_FREQ_GOV_INTELLIMM thanks @faux123
CPUFREQ Intellimm: adapt to my tree and needs :) nice toy.

*Set more freqs for my kernel.
*Adapt the common used functions.
*Cleaned 80 char lines.
*Renamed optimal_freq as default ROM MP mod that value to some crap.
no matter what gov.
*Cleaned useless defines.
*Split upthreshoulds
Kernel 9.2
net: ipv6: allow choosing optimistic addresses with use_optimistic

The use_optimistic sysctl makes optimistic IPv6 addresses
equivalent to preferred addresses for source address selection
(e.g., when calling connect()), but it does not allow an
application to bind to optimistic addresses. This behaviour is
inconsistent - for example, it doesn't make sense for bind() to
an optimistic address fail with EADDRNOTAVAIL, but connect() to
choose that address outgoing address on the same socket.

Bug: 17769720
Bug: 18609055
Change-Id: I9de0d6c92ac45e29d28e318ac626c71806666f13
Signed-off-by: Erik Kline <ek@google.com>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
MMC: Restore MMC_BLOCK_DEFERRED_RESUME changes. for future use.

This restore:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0ec4df36a63aee16f2d37cdc8ef0400d7433ba36
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/38f752bed0ea0be8573a765e7ea84ba4c6424e3a
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/ae8695e2fd8021f64c4748f1b0ebc872ebc1778b
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/6241623da43deeaaef849ac451ed6b2b6d499898
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0049ab570ada4b84909e43f5f89db47c01951e94

+ change not delete:
ifndef CONFIG_MMC_BLOCK_DEFERRED_RESUME
        if (host->bus_ops->detect && !host->bus_dead)
                host->bus_ops->detect(host);
endif
alucard_hotplug: use cpu_is_offline instead of !cpu_online function.
alucard, darkness, nightmare governors: check if policy->cpu is assigned on the right cpu. Code style.
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>
GIT ADD auto generated policy for F01F build.
KERNEL BUILD SCRIPT: add support for L01F model + build all function.