FK Interactive Gov Tweaks

Also rm mpd compeletely

Add an extern bool to know if we're using interactive governor or not because my specific touch boost implementation is only for interactive and we don't want some routines to be called if we're not running the correct governor. Ondemand provides its own touch boost code.

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

cpufreq: interactive: simplify some calls and remove a call that calculated load_since_change.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
load_stats: add changes from @reborn90 to overcome the erraneous calculations if the device hits thermal throttle.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: add tunable to control the touch boost duration.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: don't check for cpu_online on GOV_START, cpufreq is doing that by itself now. Also rework the new_freq calculations to make sure it scales properly.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: time for some performance boosts. Touch boost freq is bumped to 1512MHz. This makes an hell of a difference for smoothness and I've yet seen a battery life hit. Also adding two more performance boosts, one adds a new if condition that checks if the CPU load is >= 50% and if it is the frequency goes bumped to hispeed_freq. And if the load is < 50% instead of calculating the new_freq by dividing with 100, we now divide with up_threshold (85% by default) to get a bit more homogeneous frequency scaling amongst all the available frequencies. This is give a little bit of a performance boost if the load of the CPU barely justifies bigger freqs.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: new_freq will be hispeed_freq if the cpu load is >= 50%.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Increase hispeed_freq and correct touch_boost freq because the older freq is not present in this cpufreq table.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Initial merging of my custom work from pre 4.3. A bit dirty commit but I all the commits are on the nightlies branch.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
FK: mako_Hotplug & Thermal

====

FK: Thermal (squashed)

drivers: thermal: temporarily remove a piece of code - needs more work that I thought.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: protect against race conditions. Won't get the policy if the cpu is offline and it won't decrease the current freq if the max is <= throttled freq. Also block any hotplug work during thermal throttling phase.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: add a panic thermal throttle level. Also properly throttle the CPU policies if the CPU is pegged to 100% load for a long time because just by adjusting the limits would throttle the CPUs just by itself unless the frequency dropped by <= throttled frequency.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: thermal: increase the threshold to 70ºC and decrease the threshold delta to 5ºC after the device is throttled.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
FK: mako_hotplug (squashed)

mako_hotplug: remove WQ_UNBOUND. If the queued work stays on the CPU that was queued by we will benefit from local caching and get better performance.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: clean up some old code which is a little bit easier to read now. Also force a core to stay at least 1 second online before unplugging it.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: no need to check for is_touching and calling num_online_cpus() every .10 so only call the num_online_cpus() function if we're actually touching the display.
mako_hotplug: add sysfs file for this driver. Also uncomment interactive dynamic scaling function calls because we're definitely staying with interactive, ondemand just doesn't cut it for me.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: since using 4.7 toolchain we have to add __cpuinit to some function headers.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: using ondemand for now so lets comment the interactive automatic scaling. Also reduce the threshold to online/offline cpu cores.

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