cpufreq: add new routine cpufreq_verify_within_cpu_limits()

Most of the users of cpufreq_verify_within_limits() calls it for
limiting with min/max from policy->cpuinfo. We can make that code
simple by introducing another routine which will do this for them
automatically.

This patch adds another routine cpufreq_verify_within_cpu_limits()
and updates others to use it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jake Weinstein <xboxlover360@gmail.com>
cpufreq: interface for setting governor for a cpu

This implementation sets governor for a cpu using existing
cpufreq interfaces.

bug 871958

Change-Id: Ic4e7e2a2b0babaf1829b559b5db211666d449b86
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: http://git-master/r/97939
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: Rb3099a95700c83e412808b91da1c076f0873722c
Signed-off-by: Jake Weinstein <xboxlover360@gmail.com>
cpufreq: Introduce new relation for freq selection

Introduce CPUFREQ_RELATION_C for frequency selection.
It selects the frequency with the minimum euclidean distance
to target. In case of equal distance between 2 frequencies,
it will select the greater freq.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Jake Weinstein <xboxlover360@gmail.com>

Conflicts:
	include/linux/cpufreq.h
Squashed Faux powersuspend driver

powersuspend: new PM kernel driver for Android w/o early_suspend

Android early_suspend/late_resume PM kernel driver framework has been
deprecated by Google. This new powersuspend PM kernel driver is a replacement
for it and existing early_suspend drivers can be easily adapted to use this
new replacement driver

Signed-off-by: Paul Reioux <reioux@gmail.com>

powersuspend: fix logci derps :p

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	kernel/power/Kconfig

kernel/power/powersuspend: remove userspace dependency from powersuspend

make powersuspend not depend on a userspace initiator anymore, but use a hook
in autosleep instead.

Signed-off-by: Paul Reioux <reioux@gmail.com>

kernel/power/powersuspend: add back userpace control w/ default kernel control

make kernel / userspace mode switchable

Signed-off-by: Paul Reioux <reioux@gmail.com>

kernel/power/powersuspend: default to userspace for now

Signed-off-by: Paul Reioux <reioux@gmail.com>

kernel/power/powersuspend: LCD screen on/off hooks (Yank555.lu)

- add an alternative hook for screen on / off detection in the display
  pannel driver
- sleeps  ~0.1s sooner, wakes up ~1s later then autosleep
- clean up source formatting a bit (Paul Reioux)

Signed-off-by: Paul Reioux <reioux@gmail.com>

mdss_dsi_panel.c: add powersuspend hooks

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi_panel.c

Update defconfig

Conflicts:
	arch/arm/configs/cm_m8_defconfig
Add ElementalX governor

Credit @flar2

Change-Id: I9ac7c976b202ba166fa4b01b75c70fbd72ef67c9

Conflicts:
	arch/arm/configs/cm_m8_defconfig
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h
Squash 'enhance power efficiency' patches

Series of patches from NVIDIA on some critical blocking
code paths to allow the CPU to relax instead of busy spinning
thus lowering the load_average and lowering power consumption.

Change-Id: I66070ba81a8bdabb75b8b8b8573921eed7a2a644

Conflicts:
	arch/arm/include/asm/processor.h
	include/linux/hrtimer.h
	kernel/cpu.c
Add some cpu gov's

hyper, intellidemand, interactivex

Conflicts:
	arch/arm/configs/cm_m8_defconfig
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	drivers/cpufreq/cpufreq_adaptive.c
intellidemand: re-introduce intellidemand 5.5 cpu governor

Change-Id: I6b33e4e49dc5758206e0d89d48b79fdd35f649b8

Conflicts:
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h
intellidemand: tweak default settings for MSM8974 SOCs

Change-Id: Ia35e4d61faf4656859fa021d03890c18ea0a17e4