cpufreq: interactive: export cpu load.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: restructure CPUFREQ_GOV_LIMITS

The cpufreq_interactive_timer gets cancelled and rescheduled
whenever the cpufreq_policy is changed. When the cpufreq policy is
changed at a rate faster than the sampling_rate of the interactive
governor, then the governor misses to change the target frequency
for long duration. The patch removes the need of cancelling the
timers when policy->min is changed.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Change-Id: I7862f1c8022a3b98a890e7537f93d02010e86764
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: tone it down.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: tone up a little bit.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: balance it out so that the device doesn't stay too much on 1GHz step.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: Honor changed minimum frequency

This saves a few cycles in the timer routine.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: Use parts of native boost routine

Not all governors are created equal. Set boostpulse_endtime
and floor_freq to smoothen the timer routine.

[franciscofranco] removed boostpulse_endtime from the
original commit because I'm not using it.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: Use frequency dependent per cpu timings

This allows in-depth testing of the timer routine.

[franciscofranco] made some structural changes to compile on top
of my governor changes. Functionality was not changed.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: Move definition of cpufreq_gov_interactive downwards

This moves definition of cpufreq_gov_interactive towards the bottom of file, so
that we don't have to add prototype of cpufreq_governor_interactive() in the
beginning of file.

Change-Id: I04bd1004954eb36502c5cd7e35d3d7274cddaf95
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Git-commit: e50d640cacfe61e69f1b4fa92fa0174c688e919c
Git-Repo: https://android.googlesource.com/kernel/common.git
[junjiew@codeaurora.org: Resolve merge conflicts]
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix compiling warnings

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: merge https://github.com/android/kernel_common/commit/4c7894cb01c7544225d5fcfb0fcb1d11fd2d1777 and fix a small code shit.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix derp.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix another derp, I was probably drunk when I merged the patch before.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: interactive: this governor is fundamentally different from Ondemand and by norm its a bit more sensitive to load changes in terms of which freqs are chosen, but even though sometimes it can be a little stupid and non react to load changes that linearly as one could hope for (even though it's better than Ondemand) so for that reason let's try to use this new formula by @stratosk found in this commit: https://github.com/stratosk/kernel_msm/commit/9df03b662b9c213c75ac082138f5ab8afadb9d94 make sure you read his commit message for better understanding of this.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: we don't need input_boost_freq this high now.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: we're safe to use 250ms again.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: thermal: add wakelock for prevent repeat suspend

when device enters suspend after heating,
device will wake up by low threshold. and send notify
to userspace. however, sometimes It enters into suspend
before setting new threshold value by userspace.
It may cause to repeat suspend/resume cycle.
So, add wakelock for preventing it.

Change-Id: I4a90a74eb0ef8514ec4ee6b3c7bb1cb58372c53a
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: thermal: set the core_control_enabled after offline cores update

The variable for offline core is not yet updated in the initial state, but
msm_thermal try to control core at that time and may access the
offlined core(s). It would cause the watchdog bite due to this.

Change-Id: I6abd55b22f3e09ab44e8df0d6fbb8e82cd9e482c
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: MassStash <MassStash@gmail.com>
msm: thermal: add my msm thermal code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: MassStash <MassStash@gmail.com>

Conflicts:
	drivers/thermal/msm_thermal.c
msm: thermal: no need for this check.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>