Revert "AGE OF INTELLI!!!"

This reverts commit eb4a22766e838543fec19c6717c0c15edaae2483.
mach-msm: SQUASH mpdecision from showp

Signed-off-by: showp1984 <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:

	arch/arm/mach-msm/Kconfig

(cherry picked from commit ee7983b76e9b79b1e909606273b7bd84248f61c0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: Add msm_mpdecision

This currently only does the following thing:
Screen on -> CPU1 online
Screen off -> CPU1 offline

More to come.

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.c

(cherry picked from commit da1cb3be9bdfcd92e6458367540b5f601919f471)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.c

mach-msm: mpdecision: small cleanup

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 36ddd194bf94e2c462faa7f2da907e28d6d5f193)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: add load based decision making

This now works like the mpdecision binary from QCOM.
CPU hotplugging/unplugging based on system load.

A sysfs interface will be built in with a later commit.

Signed-off-by: showp1984 <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_rq_stats.c

(cherry picked from commit 58f29dd427ef713d88e3ab8d509ab209dcd76a9a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: restructure locks, add delay

The new delay allows the CPU to come up before any other action is taken.
This prevents fast plugging and also ensures the CPU hotplug process
is really done, before trying to unplug it again (or plug it).

The new locks are more efficient, and only used if necessary.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit e80d5b1ee56efcc98060c37294e36add38db61e9)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: pause if CPU is unplugged outside of mpdecision

This fixes cpu wars if something else tries to control the cpus.
default delay: 10000ms

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 011c21370df32684e543d96c9f99168b4908db3a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: change early_suspend_level to blank_screen

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit da8baea92ae3c5319cf284485f6db3ce61af8af1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: don't start immediately

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 9f2f896fb382374d854c70e0b3d9ef6c434f3de6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: show cpumask after up/down

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 02eea3fad22837a3a37447b142e85ac42c7c7399)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: always set the suspend var

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit db95d7f6c0dc58ad53e2d94c912b84e3d2f20ac8)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: remove up/down delay, our default delay is large enough

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit b619eca3e542918c253622e59552458af6635034)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: add email to (c)

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 730b96c54fd3b75def71ba8a77a7d02bd0fde4e5)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: fix foreign hotplug/unplug detection

Signed-off-by: showp1984 <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:

	arch/arm/mach-msm/msm_mpdecision.c

(cherry picked from commit c23db411c7de84d7a7f18ef27ded519af8268194)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: show how long the cpu was online

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 4b97288850248aaf8fb963a37a3edc675ef43a39)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: rename msm_mpdec_suspend to msm_mpdec_cpudata

Since this is being used for more than suspend stuff the old name
just isn't accurate anymore.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 0de6c63e6e18182c6faf7d6edbc3c2cdf05c28a6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: add sysfs interface

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit a54013329f1ce160ce98481dc81e81955d5342c6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: remove debug output

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 586bb5699b60d62416c0e138abdc5015a2d2f94d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: increase startdelay for sense

Surprise! Sense needs a lot longer to boot up than aosp...

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 6212603307114f751c8294347ef3b53940bb7974)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: adjust thresholds for sense

Sense is just too hungry...

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 6bab3cc9a6aab282f909cd4c98a8956b66fe557f)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: fix foreign cpu control detection

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit a05959db3c8888d1cad603de965616e406a38052)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: allow mpdecision to be disabled (sysfs)

This allows disabling/enabling of mpdecision over sysfs.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 9208f6d8d1efdb173bf0a5e341eece755aef1753)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: increase start delay for Sense

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit b9829a3015a84c47242d8751221521da459474bb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: increase up threshold for Sense

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 25f40c27a201ca60501d0cc10cd6828d161802b5)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: sysfs: check if cpu is offline before hotplugging it

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit b4972b86f82b9fee988d34a49ecb2dee80a4f586)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: don't turn off cpu1 if freq > idle

This fixes cpu1 being turned off though it is still working
with a high frequency. The idle_freq can be modified through sysfs.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit d660ea46ca28feaa9db5f22bbf11f6d131942d5f)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: fixup: move idle block to mpdecision()

This belongs in mp_decision() because this influences the decision
mpdecision is about to make.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 9dafa14e7e5f7a68f0fe8c6762b7eecc53eddad5)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mach-msm: mpdecision: don't turn on cpu1 if cpu0 freq is below idle_freq
If the clock of cpu0 is below the set idle_freq don't enable cpu1 and
disregard the runqueue value.

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 699fbb8ce9446973023211db18987ca51dddaf73)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix check for khz/mhz value (idle_freq sysfs)

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 6c43fc3767448d461e2a7acb6f17c8ef8f0034f7)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add debug output

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit ad6c5c2ad0815dbbcd62f392829b9595dd9cfe23)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: make mpdecision() core independent

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 662757ca2d1ced89bbaa61afca0a31342e608786)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: make msm_mpdec_work_thread() core independent

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit ea2fd0457a5d837f6699e825a2133159ee9048e7)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix get_slowest_cpu()

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 5990ed99a6eceeba7cb40ad9a7654770bf633a6b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: make debug output more compact & informative

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit f94081193af51fb7def56d1fb7effcc97fef9d56)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: decrease startup delay

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 09ff6aa808e919eb88ea04ea7680f46f15e58c04)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: decrease decision delay

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 0e62bbb45eb32be9ecd480408b5a85798d401b7e)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: update core data on first call

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 36100e5e62a19236f5220d4fe534a169aad942ad)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: don't let msm_mpdec_work_thread() run if we are still booting

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 79893661817fdc2960f40e409e26598e3715daee)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: make earlysuspend/lateresume core independent

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 630141506d01315ba73eaa33a887e8dea5226da6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: update header to include full feature list

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 2da3fdac1163ac23f35e9e9ce3c0126713d4cad1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: export the new, larger nwns/twts arrays to sysfs

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 9fdca150f17b230be32ee1f937e4dc266343a432)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix disabling mpdecision over sysfs for multicore

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 1401f1ac6700e5a25b6cd028f43def15079744ac)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: remove useless locking

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 027723738b9722cafbf1d6cefa1d0bd405bac42e)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: use own workqueues

This will alter mpdecision to alloc it's own wq rather than using
the predefined queue which is a shared resource.

The WQ is not bound to the issuer CPU (=high-priority), has a
rescue worker task and is freezable.
Also destroy the workqueue on exit, and rename msm_mpdec to
msm_mpdec_init.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit bafd5f19acaa282cda8f476b6366618d2e19f880)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: cancel/resume main work thread on ES/LR

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 5c177acf3817c2beaf10f520eaaa925291cc55f5)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: use unique lock names

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 7dc0cbdeb0412d4839aca7249a2a98151960a330)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add max/min cpu limits to sysfs

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 744dc47257cd9128e49909fa6a78eeb964fadb33)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: use CONFIG_NR_CPUS for max_cpu sysfs

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 47a659ebcda6bf995648d45688d1d6b405639365)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: decrease delay between checks to 70ms

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit ef4d3651b610c77e4be5fddb36fcaa2579e7554d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add get_rate()

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit c7177484ed504e46ff1635506fd89320b6d97e13)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix merge errors

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 1dcec8eaea060a9089bf6ad670ecd5ac7fda6928)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: various fixes and tweaks

- fix get_slowest_cpu_rate(): don't cut off rate to int
- fix get_slowest_cpu_rate(): don't use values from an offline cpu
- fix get_slowest_cpu(): don't return cpu0.
- tweak hotplug thresholds

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit aaeabdff63cbcf0036fd3b88548c51f5bd03c087)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: disable debug

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 8575d4a93f2699f3fc3dcb16f9d465c3097895bb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: when returning from sleep, start immediately

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 45f723cbbcd5709841dcf80a53b71b868981c32b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: we can't turn off cpu0

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 200fa3f03c2437316cd4e292637cb88e029c06cb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: turn on cpu1 early

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit f136f08dbdd8af63b25ab2e0febd027e97b8e93b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: on resume pull up cpu1

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 92697e221eb6c7d90e13f08f81e76b3efeb96add)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: tweak hotplug values

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 41f90ac95b81e322bf815b9f9175f42076baf1fb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mpdecision: don't use sleep, cancel/resume wq instead

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 4b6f8555481d2c5049eb7cb496283749ed7cd7ca)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mpdecision: checking every 100ms is enough

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 5b2ebff586b9dc1180ad4d972820e2bd03c67979)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mpdecision: update copyright

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit b2f1c3105d91dce4d465ae255c716a43c615a7d4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Revert "mpdecision: don't use sleep, cancel/resume wq instead"

This reverts commit 4b6f8555481d2c5049eb7cb496283749ed7cd7ca.

(cherry picked from commit b0892ee984f92165761aa50498f67119374520b3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add stats & expose to sysfs

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 5832aad71526842445e731e36cb4e5a6c58e8703)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix sleep, don't use pause

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit d93d84e62613c6620093eba51cd56027741c760d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix spacing across the whole file
In the past year this evolved to a battlefield of tabs, spaces and different sizes of them. Fix that.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 6469e3f8bec802556aa6859dee90bef9fe0e352f)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: stats: if cpu is online, add current ontime to stats

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 350854e97bb741a5e226109327fb2b5e52b14e30)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add input event boost [read more]

This adds an input event boost to mpdecision.
It will basically boost the min freq of all cpus to predefined values if an
input event is detected.
Devices that qualify as boosters must fullfill one of these conditions:
- contain touch in their name
- contain keyboard in their name
This also boosts cpus independently from each other. Meaning:
If a cpu is hotplugged after the boost of another cpu was initiated the next
boost pulse will boost that cpu too.

Sysfs interface underway.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 765c1cd2ec079737578b5b325d9a4842a37fe324)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add sysfs interface for input event boost

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 98e32278c55918586ba5766af8eccda4ed78c72c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: input event boost: fix not resetting boost if cpu was unplugged before

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 694b5fa8186d9307a92a35338d653fabf53e2ee4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: tune hotplug values

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 295c591b3f8cdb2f4491bca6930f8639f4cbe7a3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: boost: detect changed min frequency and update accordingly

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 867d6c82e8c965af5377553915e1aa29ad724455)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: boost: don't schedule more check than needed

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit d8bfe5603a22fd8de3581419d8b1d364b5ec0382)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: increasing the check delay to 130ms
This change brings us down from 10 to 8 checks each second. The input boost reacts without
delay which is why we don't need to check for hotplugs so often anymore.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 77c031af148fcb9b165b7dc2e4ba66f9e440d234)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: change frequencies for input boost
This should provide us with a more battery friendly setup in light
usage situations while it still provides the obvious advantages
the input boost gives us (faster reaction).

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 0ccc71f9c2a83446c09a88b0ac2c61eb5970a834)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: min_cpus & max_cpus should on/offline affected cpus

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 6d8d3e0de32b115eaa4db63011381cbf7f84276d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: several changes [read more]
reworked cpu_up/down handling which removed redundant code
reworked max/min_cpus settings
reworked suspend/resume handling to obide by these new changes
also reworked locking for per cpu settings

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit cb8938c9c9f5a28ac8daf31d67cc0a3bf1a89096)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix changing boost freq sets min = boost freq

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 76fc80a3d7d4093f6b1aa42978e79198bbb002d0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: boost: if we are not boosted, revib_wq does not need to run at all

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 9cbb323271a2432f594c08c50dacec16d1caf6c2)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add fb callback, keep earlysuspend

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit f52b61fe7745f202d00efb28b0e99c1de9cb21ec)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

thermal/mpdec: export throttle indicator and don't input boost if we are throttled

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/thermal/bricked_thermal.c

(cherry picked from commit acbc051cd6c2eceba8ef3a97fc30a0f04d7768c5)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: switch to lcd callback and improve sus/res code

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 47b1e5b08c0b12b8b40d7ca823f06e1f7ddc04f4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: remove per_cpu suspend value
This is unneccessary and produces overhead when checking/setting over loops

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit c3b856044aa4dfae10575a92a6bdaf755de8fa2e)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: offload definitions to header

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.c

(cherry picked from commit 0696a7bfa4007d40f7cc1f37e9f506ad6ae659a1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

thermal: when we restore the original limits use the norm_min freq from mpdecision inputboost

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 3770b42058f2eda793c6e818aa01325d18755e27)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix definitions for earlysuspend/lcd callback switch

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit ec354dbc6c31d1749d6c9a9f91f9b167ae8dfa85)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix whitespaces throughout the file to comply with linux coding styles

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.h

(cherry picked from commit 4edf85bdee82e0df4bdb383c772fc134bcba610c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: early continue get_slowest_cpu() and _rate() to save some cycles

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit e4124dd5750cee070f75a2bcec9ab0a49307b94a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: move startdelay to init to save cycles on each work call

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit becac2df963c2d88b3f71076f633458d9ba210f8)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: also verify that boost frequencies are > minfreq

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit bcc1bd419628796e9a64691e2ac3fd021549ea9d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix boost_time not respecting sysfs changes
This fixes issue #17

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit a9dc895c63bcb4526d0296fea9fea096f7b0e00b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add missing #ifdefs around thermal related code
This fixes issue #19 (compilation without thermal)

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 4969c555a67840a43642868d0c669176c1c47fcc)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add input boost triggers
This fixes issue #27 - No boost event triggered
&
issue #28 - Power button should trigger boost_freq

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 5ce8125b831cbdd13b438c32e585d2917fdd5ddb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: set idle_freq arch specific
This fixes issue #31 - idle frequency needs changing when switching archs

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit bea2cae43ff11ea7256d742205a8bf7b642c8882)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: fix early_suspend compilation

This was not changed because we do not compile with early suspend
and hence didn't encounter any errors. Fix it.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 6f3c7402ba9fccb1e881a17700e7bb5351e10b80)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: add locking to early_suspend related code, even if we do not use it

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 2527df2e26dd6253a2810ee69953365cf7357b2d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: opt out early if we are thermal throttled

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit f883bd75ad1a18a811ef5ca99c6e4444a3dc421d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

mdpec: fix missing ifdefs when compiling with earlysuspend

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 40ffd3a1949ca86dd58fb9b1076ff9873bd08ed1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

msm_mpdecision: boost freqs are arch dependent too

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 3134e8f56301d689eec59c37c6673eb5ecf0687a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

re enable msm rq stats

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

tune the hotplugging for our dual core cpu

Signed-off-by: thirdzcee <thirdzcee@gmail.com>