cpufreq/cpufreq_intellidemand: intellidemand cpufreq governor (version 4.0)

Intellidemand is inspired by ondemand governor. Its main features are:

 - auto cpu hotplugging based on runnable thread average calculations
 - detection of browsing mode (long screen on activities with moderate run
   queue depth =< 45 )
 - limit max frequencies when in browsing mode to conserve battery for long
   duration tasks

Browsing State Determination:
 1- Browsing state is enabled as power-on default. Browsing state is disabled
    when run queue depth is > 45 (very high instantaneous spikes)

Browsing State Limit Max Freq Logic (sliding window algorithm):
 1- While Screen is ON > 3 min, and average load of the CPU is < 35%, then
    CPU Max frequencies will remain power-on default
 2- While Screen is On, if average CPU load > 35%, both CPUs max frequencies
    will be limited to a lower user configurable max value
 3- While Screen is On, After both CPUs' Max is limited to lowered max, when
    the average CPU load has dropped down to less than < 25%, then both CPUs
    Max freq will be restored to back to power-on default

Runnable Thread Auto-hotplug (fast hotplug / slow unplug algorithm):
 1- When average number of running thread is < threshold, 2nd cpu will be
    unplugged.
 2- When > threshold, 2nd cpu will be hotplugged.
 3- The logic applies a fast hotplug and slow unplug algorithm so 2nd core
    will stay enabled longer to help deal with performance spikes

changes from Ver 2.0 -> Ver 3.0:
  - remove GPU Busy dependency for browsing state detection (this will make
    the governor more portable to other platforms without specific GPU
    architecture knowledge)

dependencies:
  -- Qualcomm's run queue average logic (SOC independent logic)
  -- TI's runnable thread average logic (SOC independent logic)

forward ported to Linux 3.4 for use on S-800

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

Conflicts:
	arch/arm/mach-msm/cpufreq.c
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
missing parts of intellidemand

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand: Add boost pulse capability

Boost pulse increases UI performance by increasing CPU freq and
reduce sampling time.

forward ported for Linux 3.4 for use on Mako
Signed-off-by: faux123 <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand: add a run queue persistence to determine browsing state

persistence will allow for better browsing state detection rather than just
purely based on run queue depth alone

Signed-off-by: faux123 <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand: add minimum cpu performance lock

a minimum cpu frequency performance lock is add to ensure smooth
operations when only 1 core is active

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

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand: code derps clean up!

Signed-off-by: faux123 <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
Intellidemand: put cores 1~3 to sleep while screen is off

Signed-off-by: faux123 <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
cpufreq: enable sibling cpu policy sharing

disable Qualcomm's cpu policy restore (conflicts with sibling sharing)

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
arch/arm/mach-msm/cpufreq: remove deprecated logic

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand: allow clean compilation when LMF is disabled

bumped version to 4.2

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

Conflicts:
	arch/arm/mach-msm/cpufreq.c
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intellidemand 5.5

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
arch/arm/mach-msm/cpufreq.c: remove legacy intellidemand leftovers

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intelli_plug: move to its own directory. It's been cross platform for a while

intelli_plug driver has been working on OMAP44xx, TEGRA 3, Exynos and
MSM Krait/Cortex multi-core SOCs.  So it doesn't make sense to patch on a per
SOC basis, move it to its own ARM platform independent folder so patches can
apply to all supported ARM platforms

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Carlos Jesús <xxx.reptar.rawrr.xxx@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
Bump intelli_plug to 3.7 (PROPER Path)

intelli_plug: add profiles support and misc code optimization bump to version 3.0
intelli_plug: use per cpu nr_runnings stats for unplugging cores bump version to 3.1
Intelli_plug: allow cpu_nr_running_threshold to be user adjustable bump version to 3.2
Intelli_plug: tweak cpu_nr_running threshold and fix minor logic issues
intelli_plug: remove legacy msm_rq based code just use the original algorithm based on nr_running_stats
bump version to 3.3

intelli_plug: add nr_running_thresholds based on thread capacity of SOC type

instead of hard coded nr_running_thresholds, perform compile time calculation
of thresholds based on thread capacity of SOC types.

intelli_plug: misc minor code fixup post 3.4 update

intelli_plug: add automatic dual-core initializations

Intelli_plug: deprecate eco mode. replaced by built-in profile bump version to 3.5

intelli_plug: add eco-extreme profile for more dual core use options

intelli_plug: post 3.5 tweaks and code clean up bump to version 3.6

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Carlos Jesús <xxx.reptar.rawrr.xxx@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intelli_plug: 998mhz screen off Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
Disable MPDesicion Patch [1/2]

I don't have Good internet conection for make a proper fork and send patch so I try to help :)

TeamMEX
Signed-off-by: Carlos Jesús aka TeamMEX
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intelli_plug: enabled by default

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
updated intelli_plug to 3.8

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
fix swp{b} use is deprecated for ARMv6 and ARMv7

Signed-off-by: Carlos Jesús <xxx.reptar.rawrr.xxx@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
fixes for intelli_plug xD and other

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>