cpufreq: add intellidemand governor
cpufreq/kgsl: activate and adjust intellidemand for new kernel
cpufreq: Intellidemand - enable smart core management while screen on

(Fixed)Conflicts:
	arch/arm/mach-msm/cpufreq.c
intellidemand: adjust browsing state detection to be smarter

lower active state time from 5 mins to 3 mins
bump max frequency limit from 1.08GHz to 1.13GHz
cpufreq: intellidemand - make active/inactive max freqs tunable via sysfs
cpufreq: intellidemand - make debug message to reflect actual frequencies
intellidemand: dynamic change of sampling rate based on screen on/off

using early_suspend/late_resume drivers to 2x min_sampling rate while screen
is off to reduce frequency transitions in hope to reduce power consumption
further
CPUfreq: update sampling rate without waiting for next sampling

When a new sampling rate is shorter than the current one, (e.g., 1 sec
--> 10 ms) regardless how short the new one is, the current ondemand
mechanism wait for the previously set timer to be expired.

For example, if the user has just expressed that the sampling rate
should be 10 ms from now and the previous was 1000 ms, the new rate may
become effective 999 ms later, which could be not acceptable for the
user if the user has intended to speed up sampling because the system is
expected to react to CPU load fluctuation quickly from __now__.

In order to address this issue, we need to cancel the previously set
timer (schedule_delayed_work) and reset the timer if resetting timer is
expected to trigger the delayed_work ealier.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
modified for intellidemand by faux123
intellidemand: add mutex protection around sampling rate change
board/msm-cpufreq: add compile time CPU min / max adjustments
board/cpufreq: set cpu1 online/offline based off power management suspend
msm: cpufreq: Check cpufreq_frequency_table NULL

This is required during single kernel binary support where one target
supports cpufreq and other target is at the initial stages of bringup.
Since we cannot remove CONFIG_CPU_FREQ_MSM from the config file, but
still support the boot on both of them adding a check for targets where
table is not initialized by the acpu clock driver.

Change-Id: I5f52c246586f0c0378a1b2873a064ef69601e3c6
Signed-off-by: Taniya Das <tdas@codeaurora.org>
board/cpufreq: add early suspend/late resume drivers

-- cap max screen off freq
-- hotplug 2nd core when screen is off
inspired by Colin Cross's code for Galaxy Nexus kernel and Ricardo Cerqueira
for being first to port to MSM platform

(Fixed)Conflicts:
	arch/arm/mach-msm/acpuclock-8x60.c
	arch/arm/mach-msm/cpufreq.c
cpufreq: fix compiling with intellidemand [lomarb]

Conflicts:
	arch/arm/configs/doubleshot_defconfig
I failed cleaning.
board/cpufreq: add early suspend/late resume drivers

-- cap max screen off freq
-- hotplug 2nd core when screen is off
inspired by Colin Cross's code for Galaxy Nexus kernel and Ricardo Cerqueira
for being first to port to MSM platform

(meh)Conflicts:
	arch/arm/mach-msm/acpuclock-8x60.c
	arch/arm/mach-msm/cpufreq.c