ASoC: msm: qdsp6v2: add support to enable TTY during VoLTE call

Enable of TTY during VoLTE call is not supported. Add support to
enable TTY during VoLTE call.

CRs-Fixed: 697463
Change-Id: Ie104eddd7b404f278a0d4def770a3f6fffef901c
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
msm: kgsl: Increase the timeout value for fault detection

Increment the timeout value for detecting faults from 50ms to
200ms. The fault detection mechanism is a backup to hardware
fault detection. 50ms is small since it has been observed that
this mechanism triggers false positives with 50ms.

CRs-Fixed: 672164
Change-Id: I8f382051e06bdc47f152309a2868092e1980604e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
msm: kgsl: Force the ME off before reading the microcode

On A3XX reading the microcode while the CP is running is dangerous
beyond words.  By setting the offset address for the read, we are
essentially changing the instruction pointer for the ME while it
is running causing opcode errors, gpu faults and/or system errors.

We do not want to stop the CP at the beginning of the snapshot
process beacuse doing so changes the RBBM status and the state of
the CP registers which may damage the debug effort.  But by the
time we get to the microcode read we no longer care about the state
of the registers so we can freely halt the ME just before starting
the read.

Conflicts:
	drivers/gpu/msm/adreno_a3xx_snapshot.c

Change-Id: Ic0dedbad85d7ec26915f054dd597e226e8101a29
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
Merge "msm: kgsl: Increase the timeout value for fault detection"
Merge "msm: kgsl: Force the ME off before reading the microcode"
Merge "ASoC: msm: qdsp6v2: add support to enable TTY during VoLTE call"
Revert "(CR) [ARM] msm: Offset sched_clock with suspend time"

This reverts commit b9433def698aa71df3e809d6e521cc3680a0ad92.

The only purpose of the original change was to increase kernel
log timestamp after system suspend to reveal the time spent in
suspend mode. But the implementation causes problems.
read_sched_clock() is used by CFS to compute task running time
but not used to compute total CPU time thus the total CPU times
in /proc/[pid]/stat and /proc/stat mismatch.

This affects end uses' experience as well. Because suspend time
is added into the running time of kernel thread that triggers
system suspend, end users see abnormally high Android OS battery
utilization in Settings->Battery.

Change-Id: Ibb3d60ac0e7ed61178b434b01ffb06826dae9c0c
Signed-off-by: Peng Liu <a22543@motorola.com>
Reviewed-on: http://gerrit.mot.com/645066
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Christopher Fries <cfries@motorola.com>
Prima: Reset to kitkat-mr1-rel-razrm and  merge kitkat-mr3-rel-ghost

This fixes the odd disconnects on Razr HD

Change-Id: I62ef2ec3cb8f86d2f499ce545ad32a24136dbe1d
Merge remote-tracking branch 'caf/LNX.LA.2.7.4' into kk4.4
cpufreq: intelliactive: initial coding and introduction!
& add to defconfig & enable

intelliactive is based on Latest Google Interactive cpufreq governor from
Google.  The original Interactive provides smooth UI operations but suffers
slight battery drain due to its aggressive policies.  Intelliactive is an
improvement built on top of it.

It has the following enhancements added:
1. self-boost capability from input drivers (no need for PowerHAL assist)
2. two phase scheduling (idle/busy phases to prevent from jumping directly to
   max freq
3. Checks for offline cpus and short circuits some unnecessary checks to
   improve code execution paths
4. removed trace calls

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

Conflicts:

	drivers/cpufreq/Kconfig

Conflicts:
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h

Change-Id: I36969ed15816f2e5fd24935cd393e3d4fbab0eb1
cpufreq: enable sibling cpu policy sharing

disable Qualcomm's cpu policy restore (conflicts with sibling sharing)

Signed-off-by: Paul Reioux <reioux@gmail.com>
loop: use aio to perform io on the underlying file

This uses the new kernel aio interface to process loopback IO by
submitting concurrent direct aio.  Previously loop's IO was serialized
by synchronous processing in a thread.

The aio operations specify the memory for the IO with the bio_vec arrays
directly instead of mappings of the pages.

The use of aio operations is enabled when the backing file supports the
read_iter, write_iter and direct_IO methods.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Zach Brown <zab@zabbo.net>
modified for Mako from LKML reference

Signed-off-by: faux123 <reioux@gmail.com>
fs: create file_readable() and file_writable() functions

Create functions to simplify if file_ops contain either a read
or aio_read op, or likewise write or aio_write. We will be adding
read_iter and write_iter and don't need to be complicating the code
in multiple places.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
modified for Mako from LKML reference

Signed-off-by: faux123 <reioux@gmail.com>
drivers/cpufreq/cpufreq.c: re-enable cpu policy restore

original bug FINALLY fixed by:
  cpufreq: Save user policy min/max instead of policy min/max during hotplug

Signed-off-by: Paul Reioux <reioux@gmail.com>
Cpufreq: create/remove percpu sysfs nodes once

On cpu hotplug on/off, percpu "cpufreq" sysfs node and it's
sub nodes are freshly created and removed. This increases
cpu up/down latency.

Create percpu "cpufreq" sysfs node and it's sub nodes in driver
registration and remove it in unregistration. This decreases
cpu up/down latency significantly.

Change-Id: I5c2b02e74de0ae4fe08dedc959bd7402cd9b7aa5
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: http://git-master/r/146812
(cherry picked from commit 298382285677fa791098d117ccc0a0a3d9ab0f9a)
Reviewed-on: http://git-master/r/219379
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

modified for use on Mako by faux123

Signed-off-by: Paul Reioux <reioux@gmail.com>
Asynchronous Fsync: initial extraction of Async Fsync from HTC

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

Conflicts:
	fs/Kconfig

Change-Id: I8c947cd111480e43d4402f6bd06af9e6c2885158
Input: Send events one packet at a time

On heavy event loads, such as a multitouch driver, the irqsoff latency
can be as high as 250 us.  By accumulating a frame worth of data
before passing it on, the latency can be dramatically reduced.  As a
side effect, the special EV_SYN handling can be removed, since the
frame is now atomic.

This patch adds the events() handler callback and uses it if it
exists. The latency is improved by 50 us even without the callback.

Change-Id: Iebd9b1868ae6300a922a45b6d104e7c2b38e4cf5
Cc: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

Input: Improve the events-per-packet estimate

The events-per-packet estimate has so far been used by MT devices
only. This patch adjusts the packet buffer size to also accomodate the
KEY and MSC events.  Keyboards normally send one or two keys at a
time. MT devices normally send a number of button keys along with the
MT information.  The buffer size chosen here covers those cases, and
matches the default buffer size in evdev. Since the input estimate is
now preferred, remove the special input-mt estimate.

Reviewed-and-tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>