msm: kgsl: Don't wake up gpu on kgsl_ioctl calls if not necessary

This is Iee3db5401bdad1808a09d104e0daecfc3716cbb4 change ported
manually from the msm-3.4/msm-3.7 branch to the jb_2.5 branch.

The current code wakes up gpu on all kgsl_ioctl() calls that need
to hold device->mutex. However there are some kgsl_ioctl() calls that
don't need that. That fix introduces a bit of info to mark such
functions, and don't wake up gpu calling them to save some power.

Change-Id: I86224d2405c42e3803c7e361c02fe1d02d4cdff1
CRs-Fixed: 438932
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
backported for Mako kernel from CAF reference

Signed-off-by: faux123 <reioux@gmail.com>
Add Sound Control. Features headphone volume boost for starters.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Sound Control: add tuning to the headphones gain registers. Fix a few typos.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Sound Control: changed gain from unsigned int to int so that it recieves negative values.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Sound Control: fix negative gain, add thresholds. Bump to v2.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
soundcontrol: writing to the registers all the time is a bit hacky and it breaks compatibility with Ezekeels eXperience Pro app. Rather change the values with the mixer directly which is not so hacky.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Sound Control: enable negative values.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: msm_thermal: make thermal throttle temperature threshold user configurable.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: thermal: properly limit CPU frequency when the temperature is too hot: if we throttle too much games will lag so we'll only scale down to 1026MHz until the device cools down, then back to 1512MHz again. Added other smaller routine changes to make it work properly.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm8960_tsens: enable all thermal devices

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: thermal: fix its behaviour and increase polling time.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm_thermal: scale polling according to temperature, less polling when the device is cool, more polling with its hot. Borrowed idea @motley.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm_thermal: according to @showp1984 the S4-Pro inside of Mako can heat up 20-25ºC in a matter of 250ms if really stressed + ambient heat, so by @showp1984 suggestion lets poll every 250ms if the device is hot so that it maintains the reduced frequency until its cool enough.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm_thermal: fix the clusterfuck of code with simple routines to check for temperature differences and act accordingly.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: thermal: export CPU temp to the userspace every polling rate. Also add another step for throttling if the CPU gets really hot.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: thermal: temp already exported here: /sys/devices/virtual/thermal/thermal_zone7/temp

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