msm: mdss: Adding lcd notifier

Supports notifier for start&end of LCD power on&off

Change-Id: Idaa685a2c554286da5f764519305d830c4d1a1bd
Signed-off-by: Se Hun Kim <sean2.kim@lge.com>
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: mdss: allow threads to be interruptible

wait_event puts the process into an uninterruptible sleep.

use wait_event_interruptible to allow our thread to be interrupted
by signals and reduce cpu load

Change-Id: I68d4d15c42d98ee80f7d1c839096a6e7ce82ae20
cpufreq: create a helper function to get CPU utilization.

Picked from @stratosk

Change-Id: I73987b78d98c338dbed8aee0ce4967b7bd010f21
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Add my Hotplug driver.

Change-Id: I31966aa78d141774090e3e5044c02bccf8580c9e
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can live with 80% threshold.

Change-Id: I7f7c8bc6f5af7e02f74c91b5235d8c3f9d324d62
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can now cap max freq to 1GHz on screen off.

Change-Id: I832c035aeaf7896ee3dd76253a63cbd0056a0374
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: without updating the policy nothing actually happened.

Change-Id: I3ba8c1f8d4288adcc21af9b73b95696ba09bcce3
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: make sure the notifier does not go through for every damn CPUFREQ_ADJUST otherwise it's a mess.

Change-Id: I1abbc5cd36838aeea3d74db4e24c7e72a541c00b
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: lets try this fix for the crippling sound when changing networks.

Change-Id: I56e9695aa1dd3ccc6a94b2432263bf6fe399571d
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: minor code optimisations.

Change-Id: I9cb4138141d8096d33610df3bbee9175f91d55d3
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: small fix to make sure we don't try to cpu_up(x) if x is alread online.

Change-Id: I9f2f65b04140ea74363639fbd61545d6e3e30b18
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: clean-up

* clean up the store functions using proper and modern kstrtoul

Change-Id: I258f539b37945c817a71ddd6a1371832d9d812eb
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: bugfixing

* fix a bug where cpu_smash()->cpus_cpufreq_work()->cpus_offline_work()
was being called every 100ms

Change-Id: I07fa9b95b77994bd36ba9cd3e8c93298ea42bfff
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix checkpatch warnings

Change-Id: I79f4bad71947c0074815e1eb6dc8482b5a219ddd
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can shift left here instead.

Change-Id: I29b2a1b5601248f4fa29f882e72e973694520c7a
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix a bug where all cores could stay indefinitely online

if userspace (either root command or an app) onlined all cores when the counter was < 10.
Fix it by querying the num_online_cpus() every sample (100ms).

Change-Id: Ia3e01e647b1d451a31e237c735445d711ac35e30
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix a rare case where the restored frequency wouldn't be the same as when the device wen't to sleep.

Change-Id: I960307cfdcc8af494d0739309a116a7ae5b0f564
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: improve the suspend/resume routines on the cpu frequency management.

Change-Id: I10e0b7daebe334e52e0027eb3d91decc92948a3c
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: thermal: fix init with msm_thermal

 * not using ioctl interface for this in-kernel solution
so prevent msm_thermal-dev to be built
 * use higher frequency points than my N5 driver because
Bacon rarely gets really hot so we don't need to throttle
as heavy
 * re-structure init->register<->exit flow compared to the
N5 code. We don't rely on board init call anymore. Besides
externs are fugly. The rest is on the msm_thermal merge side

Change-Id: If650e64d6c5b7fe21704680f68d9111f955f2241
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: thermal: add my cleaned up in-kernel driver

 * mostly copy-pasta from the N5
 * thermal-engine daemon is disabled in userspace
 * users can now ajudst the thermal throttle point in sysfs
 * well... it's clean :)
 * stability test responds very well and the device doesn't
heat up too much. On stock thermal solution the device rapidly
reached un-bearable temperature on the back (running stability test)
due to it's weird throttling mechanics (at least from what we can
observe since the code is proprietary) and doesn't cool down easily.
With this solution that doesn't happen.

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