Add Thalamus ARM Generic Hotplug interface because its time to get rid of mpdecision. All credits to Thalamus of course.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug: Increase sampling time to decrease the number of onlines/offlines; tweak the values for onlining and offlining a single core; instead of staying 2 seconds without offlining cores (after they are either all online or it called boostpulse), they now stay for 5 seconds to reduce onlining/offlining, and it also provides a bigger boost if the device needs that extra burst of performance power for at least those 5 seconds.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug: make some constants to be exported to userspace to let users customize them for their own usages.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: just hardcode the value for onlining all the cpus.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug: change the thresholds a little bit. Also changed how it behaves when it has 2 cores online. When the screen is touched the avg_running goes up and it onlines cpu1, but we don't want it to go up and down continuously while we are interacting with the device so now while the avg_running is >= 125 (disable_load/2) cpu1 stays online. Only when the avg_running goes below 125 which is mostly possible when we're not interacting with the device (e.g. reading a book or a website) cpu1 goes down, but also takes 3 seconds to go down just in case theres a new interaction in between. This should help a lot on battery life because hotplug is very costy and now it will be called much less than before.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug: remove the extra second for the scheduled delayed work or we could get into trouble.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c make it a little bit more aggressive.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: only call CPU offlining if avg_running < disable_load/2, online_cpus > 1 and if BOOSTPULSE is up. Decreased the BOOSTPULSE unpause timing to 2 seconds from 5. Add BOOSTPULSE function call to the touch driver so that the device keeps 2 cores up when the user is interacting with the device.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: after boostpulse is done instead of waiting 5 seconds to offline the core, now it offlines after 2 seconds. Average 15 sample times instead of 12. A little change on when to disable a core when the boostpulse flag is not on because since we now average more times now when the avg_running is less than the disable_load and online_cpus > 1 we offline a core.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: increase the threshold for onlining all cores at the same time.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: these are variables that are only read from, so optimise it.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: this device boots up faster than any other so we can start the hotplug works sooner - sometimes the previous 20 seconds timer started exactly when I started to swipe the App Drawer after the device was booted and that would create a 1 time lag and that was annoying every time I rebooted. Should be ok now.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: we're now scaling the cores based on the NVIDIA's avg_running code so now the driver will be less hard on the system because we got rid of the history cycle and multiplication before deciding when to online/offline cores.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: remove dynamic sampling time based on online cores and schedule the works in a 100ms sampling rate. Also cleanup how check for boostpulse flag to reduce reduntant function calls. Also reduced enable_all_threshold from 500 to 425 otherwise it would be really hard to have them all enabled at a certain point of time. Maybe it easier to stay on all cores if the load is above the threshold - there was a small bug here that almost prevented all the cores to stay up until the load gets down.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: ditch NVIDIA's load averaging usage on this driver - according to @thalamus its not cheaper than his original implementation.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: since we're sampling for longer periods and in 100ms rates this can be a little lower if one needs the performance.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "auto_hotplug.c: this device boots up faster than any other so we can start the hotplug works sooner - sometimes the previous 20 seconds timer started exactly when I started to swipe the App Drawer after the device was booted and that would create a 1 time lag and that was annoying every time I rebooted. Should be ok now."

This reverts commit 5dea4777e62df79833e33de2cd7a3507635b714e.
auto_hotplug.c: since the sampling rate was adjusted a few patches ago I never got to update the timers in the delayed works to be according the new rate and the more sampling periods. Should be more snappy now when the device needs the extra processing power, without sacrificing battery. Also added contact info in the top of the file and more info regarding OMAP4460.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: reduce sampling periods from 20 to 15.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: on device resume we feed some fake numbers to the circle buffer to make it more responsive to load changes instead of waiting several sampling rates for a proper response. Thanks @motley for the idea.

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