drivers/touchscreen: add sweep2wake

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
sweep2wake: fix last touch not being released

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
drivers/touchscreen: add pmops and allow i2c to wake the device (even w/o ES/LR)

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
drivers/touchscreen: add lge_touch android_touch kobject to fix s2w in one position across devices

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Update kernel config & enable Sweep2wake (showp1984)
msm: dcvs: add sysfs parameter for active and leakage offsets

The active and leakage energy offsets for each frequency are
best left configurable from userspace to make tuning easier.

Change-Id: I435a30d46cc02861dd7e8371b21d0433c0aa6a28
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: dcvs: set gpu actual freq when setting gpu floor

If actual_freq of gpu is not updated when a gpu floor
is set, TZ is unaware of the gpu frequency change and
computations are based on an incorrect value. By setting
actual_freq, TZ is notified of the new gpu frequency at
the next idle exit.

Change-Id: Ifc69996ef309ed4f8a5d46a2048757e57dd1a8ec
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: dcvs: add ss_no_corr_below_freq parameter

The busy/idle behavior of different cores can be correlated by
DCVS when determining what frequency to run cores at. However,
this is not desirable below a certain frequency. Add a parameter
to establish what this frequency is. The parameter is configurable
in userspace via sysfs.

The ss_iobusy_conv parameter is currently unused, so it is
being replaced with ss_no_corr_below_freq.

Change-Id: Icd9540d9b2a4881c7a24d33e120b3bc817f7f12f
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: dcvs: check power collapse state after updating params

The dcvs params are updated when the number of online cores change.
When this happens, the low power modes of each CPU need to be
enabled or disabled depending on how fast they are running and what
the new power collapse frequency thresholds are.

Change-Id: I2341682918822549059e4a8ba6a6d35323f227d2
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: dcvs: enable/disable power collapse on CPU 0 only

Idle power collapse is not currently used on secondary cores
with DCVS, so it should not be manipulated after boot by DCVS.

Change-Id: I570bd4810d0d8e1673c52538fb81324bdc82ec8a
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
mako: msm: dcvs: add ss_no_corr_below_freq parameter

The busy/idle behavior of different cores can be correlated by
DCVS when determining what frequency to run cores at. However,
this is not desirable below a certain frequency. Add a parameter
to establish what this frequency is. The parameter is configurable in userspace via sysfs.

The ss_iobusy_conv parameter is currently unused, so it is
being replaced with ss_no_corr_below_freq.

Change-Id: Icd9540d9b2a4881c7a24d33e120b3bc817f7f12f
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: cpufreq: fix a race between hotplug and cpufreq

When msm_cpufreq_target() is called without holding the policy
semaphore, there is a rare chance that the cpu gets hotplugged in
the acpuclk_set_rate. The probability of this issue increases
when cross-calling is used or using interactive governor which
tries to set all cpu frequencies from a single thread.

Add a hotplug notifier and set the device_suspended flag holding
the suspend mutex, when cpu is going down. This mutex is always
held when frequency changes are done.

Change-Id: Ide3aa6927ad60d2512d63761c51bb15117461250
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
msm: cpufreq: Remove cross-calling limitation

Remove cross-calling limitations imposed by cpufreq. Clock drivers
and SPM driver now allow changing of frequencies from any core. Using
cpus_allowed mask to check for core affinity works well with workqueues
but do not port so well when the core requesting frequency change is a
kthread with the flag PF_TASK_BOUND not set.

Change-Id: Iab664ce8657780814440a11dff77cc925df597f8
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
msm: cpufreq: increase priority of thread that increases frequencies

When the cpufreq governors request for increase in frequency from kworker
threads, there is chance that the kworker thread is cpu starved due to
other high priority threads, leading to undesirable increase in frequency
ramp-up latency. Add the calling thread to SCHED_FIFO policy when
requesting for increase in frequency and restore back to original policy
after ramp-up is completed.

Change-Id: Ie4fa199b7f9087717cb94dfcc2eddea27cc0012b
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
msm: cpuidle: Don't disable irqs again

cpu_idle() disables irqs before calling down into the cpuidle
driver via cpuidle_idle_call(). Disabling irqs again in
msm_cpuidle_enter() is wasteful and unnecessary. It also inhibits
our ability to determine the largest irq latency when the cpu
idles for extended periods of time because the irqsoff trace is
reenabled when the irqs are disabled in msm_cpuidle_enter().

Note that we still reenable irqs before returning, as is required
by the ARM idle loop.

Change-Id: I925478d8fef88ab490959622bc68303f59cc6e79
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: cpuidle: Update C state time stats in the cpu idle device.

msm_pm_idle_enter function returns time spent by cpu in particular
C state. Update the cpu idle device last residency with the return
value which is required for cpuidle stats.

CRs-fixed: 391456
Change-Id: If9f1b59e05c233e53ba37ae0fe9399f12275f3d8
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: hotplug: Change the pen variable in one place

Other WFI based hotplug implementations set the pen variable to
-1 in C code and do the appropriate flushing operations in one
location. They also don't try to invalidate the cache on a
spurious wakeup and report how many spurious wakeups there were.
Let's do the same in our code so that we can remove our
dependence on the dmac_{inv,flush}_range() functions (which are
no longer upstream) and easily report spurious wakeups to the
kernel logs.

This does delay the time we set the pen back to its default
value, but that doesn't actually matter because generic ARM
hotplug code already waits for a completion before continuing.

Change-Id: Ic36fbf744fe8abeda20ad9859a207b5e37c5e63c
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: krait-regulator: initialize registers in global space

For the retention mode to work we have to initialize a register in
the global space. This register enables the bimodal switch that controls
whether a cpu is powered by the head switch or an LDO.

Change-Id: I8f7de5f63bbb8af63b118a29d1dec77cd09fc359
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: krait-regulator: Switch to PFM mode under light load

The pmic gang can operate in low power mode when configured
in PFM mode.  In PFM mode the number of phases drop to one
where the gang leader provides all the current.

Use this facility when the combined load decreases below
500mA.

Change-Id: I7e975f811cf1f7cf38300d6c92fd3234d9d0b13f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: krait-regulator: Use default parameters from the device tree

Parameters like the LDO headroom, default LDO voltage, retention voltage
and the LDO threshold need to be configurable. Accept these values from
device tree instead of defining them locally. Note that since these
are required properties the dts is also updated along with the driver
code.

While at it, update the code to program defualt LDO voltage and
retention voltage for the kraits at probe time.

Change-Id: I41a503e1861f8b895be79b9f01fca1f8e217f55d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>