[PATCH] hwmon: pm8xxx-adc: Remove wakelocks

The PM8xxx ADC interrupt is configured as a
wakeable interrupt. Therefore the system can suspend
and still have the end of conversion interrupt be
serviced.

Add a timeout in the wait_for_completion in case
the end of conversion event is not received. This
is to rule out any side affects if a missed interrupt
occurs.

Change-Id: Iad36ad4fb7e550e563f0bf7803d3e5e861b7aacd
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
power: pm8921-charger: disable battery temperature wakeup

The battery temperature interrupts are functional only when there is a
valid charger source present. There is no point making it a wakeup
interrupt, since if the charger is absent the interrupt wont be
triggered (if it is triggered it should be ignored).

Note that for 8921 charging, the software does not take any action if
the battery gets hot/cold. The 8921 hardware state machine stops
charging if the battery temperature goes out of the limits.

For external chargers which depend on the temperature monitoring of
8921, we rely on the fact that the external charger will hold a wakelock
and avoid sleep as long as charging is in progress.

In cases when external charging is finished and the system did go into
suspend, we don't want to wakeup the device only to realize that external
charging was not in progress.

Basically no case requires that we wakeup from battery temperature
interrupts.

(cherry picked from commit a845ec32e6cd85db01c9c5706c0677226e4854b9)

Change-Id: I2e0e0196fc6d0ef3be5a97e6e11a9f6995a4bfaf
CRs-Fixed: 395312
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
SCHED: Add ROW I/O scheduler
Revert "SCHED: Add ROW I/O scheduler"

This reverts commit 5d340e2a07ccf3798a2e234f32bb0f40fcb5c11d.
msm: thermal: Simplify kernel thermal safeguard mechanism + squashed other thermal commits

msm: thermal: Simplify kernel thermal safeguard mechanism
Using CPUFreq policy objects and setting the max frequency limit by
overriding the policy->max node, leads to race/overwrite conditions with
an user trying to use the scaling_max_frequency node.

The thermal limits are directly communicated to the 'msm' cpufreq driver
and use the cpufreq_update_policy() to ensure that the frequency is
limited as per the thermal safeguard requirements.

CRs-fixed: 370343
Change-Id: Iab5a15e0f0d25da4b9f6a9417dbfc01bf5d6f8f6
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>

msm: Add frequency backoff to thermal monitor
Make thermal monitor performance hit more gradual by stepping down
limit frequency instead of jumping directly to that frequency.
The monitor now steps down to the lowest available cpufreq
frequency, instead of fixing the limit frequency to 918MHz. Also
update the polling frequency to 250ms to improve responsiveness.

Change-Id: I6edb0cfc057284023978de04d7835e9783da5ebd
Signed-off-by: Eugene Seah <eseah@codeaurora.org>

thermal: msm_thermal: Define and implement device tree bindings
Define device tree bindings for MSM_THERMAL driver, and implement
matching code to make the driver abide to these bindings.

Change-Id: I6ed08a09f45f8748841cf44db601f28659e49d9c
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
thermal: msm_thermal: Define and implement device tree bindings

Define device tree bindings for MSM_THERMAL driver, and implement
matching code to make the driver abide to these bindings.

Change-Id: I6ed08a09f45f8748841cf44db601f28659e49d9c
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
thermal: tsens8960: Add suspend/resume for TSENS

TSENS does not operate reliably during VDD_CX minimization.

Incorrect temperature readings are reported on some instances
when Apps processor comes out of suspend. This leads the
TSENS reporting incorrect temperature during system resume.

Change-Id: I882b37fbe290477926c3a242d3092be8b950dfab
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
thermal: Sync with CAF ala FF Mako
MOTOR: Disable annoying kernel messages
thermal: tsens: Leave sensors enabled on TSENS init.

This change allows kernel thermal mitigation to read sensors
that are not the main sensor (TSENS0) even after the driver probe
occurs.

Signed-off-by: Eugene Seah <eseah@codeaurora.org>
(cherry picked from commit bf8b0777937ab5f06f81d7b26cb7226f69099f70)

Change-Id: I4ab19b6b7604344f91700340115dcf6c4ecfe820
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
thermal: tsens8960: Add platform detection

TSENS is not supported on the MSM8960 1.0 because of a
HW bug. The driver used a platform detection mechanism
through a flag. With the 8960PRO the CPU MAJOR
version resets back to major version 1. The driver
does not distinguish the PRO parts differently and
disables the driver. Change the method to detect
the CPU using the platform detection api instead
of relying on the platform data.

Change-Id: I446eb196cf81e6a29760530dfbce6910652e867c
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit 30447fec965309e30f1eb33c0d318ee4a5365026)
(cherry picked from commit 25bb62fbbc050147ae298179d7abe4ad08f78371)
cpufreq: interactive: fix deadlock on spinlock in timer

Need to use irqsave/restore spinlock calls to avoid a deadlock in calls
from the timer.

Change-Id: I15b6b590045ba1447e34ca7b5ff342723e53a605
Signed-off-by: Todd Poynor <toddpoynor@google.com>
RAMDISK: Disable some daemons that cause problems
WIFI: Update from latest Samsung code
CONFIG: Version 0.20

Some tweaks I saw on Imoysen's latest
auto_hotplug.c: increase the threshold for onlining all cores at the same time.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: these are variables that are only read from, so optimise it.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: this device boots up faster than any other so we can start the hotplug works sooner - sometimes the previous 20 seconds timer started exactly when I started to swipe the App Drawer after the device was booted and that would create a 1 time lag and that was annoying every time I rebooted. Should be ok now.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
SCHED: Add ROW I/O scheduler
SCHED: Updated ala FF-Tuna