cpufreq/interactive: add early suspend/late resume drivers support

add early suspend/late resume drivers to hot plug/unplug 2nd cpu depending
screen on/off to further reduce power consumption during screen off.
(cherry picked from commit 0b5ad06986aabe59a697f4d849865f63d08ca5a4)
cpufreq: update early suspend level to EARLY_SUSPEND_LEVEL_STOP_DRAWING

conservative, ondemand and interactive governors, update their early suspend
level from EARLY_SUSPEND_LEVEL_BLANK_SCREEN to
EARLY_SUSPEND_LEVEL_STOP_DRAWING to avoid race conditions with rapid screen
on/off via gpio
(cherry picked from commit fe6ff53c4e08fa8c489e1d71e8693d4a135a443b)

Conflicts:

	drivers/cpufreq/cpufreq_conservative.c
	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: hotplugging via EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 25

revert previous hotplug based on EARLY_SUSPEND_LEVEL_STOP_DRAWING which
lead to another race condition causing instability
(cherry picked from commit 5c37531e3f980937e1486b6c687de7a036820fc2)
cpufreq: interactive: apply intermediate load to max speed not current

Evaluate spikes in load (below go_hispeed_load) against the maximum
speed supported by the device, not the current speed (which tends to
make it too difficult to raise speed to intermediate levels until
very busy).

Change-Id: Ib937006abf8bedb60891a739acd733e89b732ae0
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit e661e9ba37039c77f8e1faaa231d810f12ac0790)
(cherry picked from commit 5d94b831e4dfb33457f88bad2087347bd330d951)
cpufreq: interactive: set at least hispeed when above hispeed load

If load is above go_hispeed_load, always go to at least hispeed_freq,
even when reducing speed from a higher speed, not just when jumping
up from minimum speed.  Avoids running at a lower than intended
speed after a burst of even higher load.

Change-Id: I5b9d2a15ba25ce609b21bac7c724265cf6838dee
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 1c41e01a514bc6b5136fd9040bed5137cfd712a8)
(cherry picked from commit 86d952a0dc9f82f35cc84a65a5cd0984b9ef77a7)
cpufreq interactive governor: event tracing

Change-Id: Ic13614a3da2faa2d4bd215ca3eb7191614f0cf66
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 4d6f3d7209ffa828fad5d5495c1eb8c571d308ad)
(cherry picked from commit 5a4f7f6463a32e78c9fa6f98217fc17a30a1194a)
cpufreq: interactive: don't drop speed if recently at higher load

Apply min_sample_time to the last time the current target speed
was originally requested or re-validated as appropriate for the
current load, not to the time since the current speed was
originally set.  Avoids periodic dips in speed during bursty
loads.

Change-Id: I250bda657985de60373f9897cc41f480664d51a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit e04e953b657d6e8b4f00b9e341370e339b1a0c97)
(cherry picked from commit d7a82119634f85bd9922b30f5d3515706a6f1423)
cpufreq: interactive - move earlysuspend code from down_task to up_taska

based on comment from Jimmy Flip on my github
(cherry picked from commit eb16051af21d45e07488b269e0ac52f2aff3e3a8)
cpufreq: interactive - increase sampling time to during screen off

based on Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>'s patch

Interactive governor tuning in passive use cases

During passive use-cases, i.e. when display is OFF,
value of timer, which is used for frequency increasing,
may be increased. This will significantly reduce the amount
of OPP switching during passive use-cases, and optimize power
consumption on MPU. Total benefit is around 1 ~ 2 mA in passive
use-cases.
(cherry picked from commit ef957b390416065f437b43fd075bd40167bb44cd)
cpufreq: interactive: configurable delay before raising above hispeed

Change-Id: I4d6ac40b23a3790d48e30c37408284e9f955e8fa
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 70e4235f7d79ad58103fc2fd046c6e15dd6723ab)
cpufreq: interactive: adjust code and documentation to match

Change-Id: If59c668d514a29febe5c35404fd9d01df8548eb1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 9b76ef46c376c9eec72e370835e46ac1fcd200a8)
cpufreq: interactive: based hispeed bump on target freq, not actual

For systems that set a common speed for all CPUs, checking current
speed here could bypass the intermediate hispeed bump decision for
this CPU when another CPU was already at hispeed.  This could
result in an overly high setting (for all CPUs) in situations
where all CPUs were about to drop to load levels that map to
hispeed or below.

Change-Id: I186f23dcfc5e2b6336cab8b0327f0c8a9a4482bc
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 516032504336b5029c9c782eaf8e558c08e0366a)
cpufreq: Separate speed target revalidate time and initial set time

Allow speed drop after min_sample_time elapses from last time
the current speed was last re-validated as appropriate for
current load / input boost.

Allow speed bump after min_sample_time (or above_hispeed_delay)
elapses from the time the current speed was originally set.

Change-Id: Ic25687a7a53d25e6544c30c47d7ab6f27a47bee8
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit e5e5f9a8cfe8e1c308db43798320a64f54c66dd1)
cpufreq: interactive: Boost frequency on touchscreen input

Based on previous patches by Tero Kristo <tero.kristo@nokia.com>,
Brian Steuer <bsteuer@codeaurora.org>,
David Ng <dave@codeaurora.org>,
Antti P Miettinen <amiettinen@nvidia.com>, and
Thomas Renninger <trenn@suse.de>

Change-Id: Ic55fedcf6f9310f43a7022fb88e23b0392122769
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 8d6018e696d954952182dfca23f048a62d452365)
cpufreq: interactive: remove unused target_validate_time_in_idle

Change-Id: I37c5085b91318242612440dfd775ad762996612f
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit bb26e74600a2093c387a5320ae49baf9b24d79c4)
Merge branch 'interactive' into sg-gnex-master