thermal: tsens8960: Add api to read max supported sensors

Provide api to report the maximum number of TSENS sensors
supported. Backport this from the 8974 TSENS driver
to support thermal monitor driver compilation.

Change-Id: I712ccd8169eb3df0f1e83189aea1dd98180c3e7d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	drivers/thermal/msm8960_tsens.c
	include/linux/msm_tsens.h

Conflicts:
	drivers/thermal/msm8960_tsens.c
intelli/msm_thermal: initial coding for Qualcomm S4 Pro devices

an intelligent MSM thermal throttling kernel driver designed to replace the
closed sourced thermald(aemon) from Qualcomm.

The current driver can throttle the SOC via core frequency scaling or via
core hotplug with user configurable sysfs entries to adjust the throttling
temperature thresholds for each.

Derived from Qualcomm's Open source repo.

Backported to 3.0.y kernel by BytecodeMe

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

Conflicts:
	arch/arm/mach-msm/lge/mako/board-mako.c
	drivers/thermal/Kconfig
	drivers/thermal/Makefile
	include/linux/msm_thermal.h
ROW: Fix missing }
Revert "lib/string & lib/memcpy: use GNU implementation."

This reverts commit 1ade9c7061db1fcdfa22f913d68d1f287312e159.
KGSL: Simple Governor: some styling changes, early returns instead of assigning a val and returning in the end of the function call and change the copyright/author from the middle of the file to the header.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: Simple Governor: so I kinda butchered in a good way of course the original code from faux, but the simplicity is still here. Added an history so that we can track the average do that the frequency scaling is much more proporcional to the actual GPU load rather than having is ramp up every now and then due to spurious load spike. Also remove two useless ifs.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Revert "scheduler: compute time-average nr_running per run-queue"

This reverts commit fd2f13249df1585369f48085f24c82b5d678ae16.
Revert "proc: enhance time-average nr_running stats"

This reverts commit 1bdc2db43a40d1719e45dcc65ed61c23d41afbdb.
scheduler: compute time-average nr_running per run-queue

Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

Change-Id: I076e24ff4ed65bed3b8dd8d2b279a503318071ff
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
(cherry picked from commit 3a12d7499cee352e8a46eaf700259ba3c733f0e3)
Reviewed-on: http://git-master/r/111635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
msm: cpufreq: Add API to allow limiting of min and max cpu frequencies

CPUFreq provides scaling sysfs nodes to set min and max frequencies, but
there are times when the operating range has to be controlled
irrespective of the scaling limits, to ensure the thermal stability of
the device.

The API allows kernel thermal safeguards to pitch in and limit the
frequencies.

Change-Id: I3dc7496747792e6223695131f1644dd87054b025
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/cpufreq.c
	arch/arm/mach-msm/include/mach/cpufreq.h
Makefile: hardcode arm
defconfig: Simple GPU governor