Headset: Ability to hang-up a call from a wired audio headset

Address OPO_52.
The KEY_MEDIA and KEY_VOLUMEUP are mapped to multiple buttons.
That will confuse the input class driver when one button is
pressed while others are released. Fuse all buttons with same
function to one will fix the problem.

Change-Id: Ife63602e68d0fad2813821f0c7e0b6d78cc5d878
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ASoC: wcd9xxx: Set chopper settings for UHQA mode

UHQA (Ultra High Quality Audio) requires chopper to set the
frequency to the actual frequency. Change enables chopper
to set the frequency to half for all audio streams
with different sampling rates and 24-bits per sample
other than UHQA mode.

CRs-Fixed: 722714
Change-Id: I7dbf2629c37f0139af67c8491a49197bb85cd315
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ASoC: msm: qdsp6v2: Fix for cmd status overwrite

There is a race condition between offload callback thread
and HAL thread which can cause an eos ack notification to
be overwritten by a stop command request. Fix this by
using separate status vars for commands originating from
different thread contexts

Change-Id: I87dc0e34f4c50d48a25f4d7eaccd876b2ae827f0
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm8974: Stop breaking the whole system

 * Deep breath............

   .....

 * Carveout allocations must be inside a memory { } stanza.

Change-Id: Ica240acec74acfd2180182d7a2725889452af5f6
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Squash 'enhance power efficiency' patches

Series of patches from NVIDIA on some critical blocking
code paths to allow the CPU to relax instead of busy spinning
thus lowering the load_average and lowering power consumption.

Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: cpu-boost: we can hit a small performance loss by not queuing input works less than 150ms apart when our default input work duration is only 40ms, so use that 40ms as a magic value instead of the 150ms minimum interval.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
def: Add xbox controller support as module
namespace: Restrict slave mountspace so Dalvik apps can mount system-wide volumes (Variant 2)

--> version without remounting on /mnt/shell/emulated !!!

Android 4.2 implements multi-user storage using per-process mount
namespaces.  Everything under "/" (the entire filesystem hierarchy) is
marked as a recursive-slave mountspace for all zygote instances.  This is
done so that user-storage sandbox mounts under /storage/emulated are hidden
from other apps and users.

Unfortunately this means that any Dalvik app (actually, any program whose
clone/fork ancestry includes a Dalvik zygote, which is everything except
services spawned directly from init) cannot mount system-wide volumes.
Thus, apps like CifsManager are effectively broken in Android 4.2, since
its cifs mounts are only visible to the CifsManager app itself.  All other
apps see empty mountpoints instead of the mounted volume.  Furthermore,
Linux provides no provision for a process to "escape" a recursive-slave
mountspace in versions prior to Linux 3.8 (setns syscall).

Here, we restrict rootfs-slave calls to /storage (and, due to a possible
kernel bug, /mnt/shell/emulated) so that Dalvik apps can mount system-wide
volumes elsewhere (with appropriate permission, as in earlier versions of
Android), while retaining full multi-user storage compatibility.  It is
made available as a kernel-based workaround for instances where libdvm can
not be modified.

This change requires that a tmpfs volume is mounted as /storage in init.rc.
If this volume is unavailable, then we falls back to the previous behavior
of marking the entire filesystem hierarchy as slave.

*** Do not commit to CyanogenMod Project kernels, as a similar workaround
    for this problem is patched in Zygote/Dalvik/libdvm instead.  ***
def: fs update
fs: Add exFat support version 1.2.7 (Samsung OSRC)
fs: Add exFat support version 1.2.9 (kitkat source drop)
random: increase entropy levels (both read and write)
def: add exfat support
USB: gadget: mtp: Fix hang in ioctl(MTP_RECEIVE_FILE) for WritePartialObject

In receive_file_work, we now queue reads with length rounded up to
max packet size rather than mtp_rx_req_len.
Otherwise the read request will never complete.

Signed-off-by: Mike Lockwood <lockwood@google.com>
build: update script
async_fsync: add and fix
def: add async_fsync
sched,rt: disable rt_runtime borrowing by default

Make the default RT_RUNTIME_SHARE setting reflect the most common
throttle role, that of safety mechanism to protect the box.

Bug 1269903

Change-Id: Id4ccf0095ea254f2e15fddc7ab02069f7f60a7c0
Signed-off-by: Mike Galbraith <bitbucket@online.de>
Reviewed-on: http://git-master/r/234274
(cherry picked from commit be74a12c8d8b987f569cdd0eec2aead3dcbdfa31)
Reviewed-on: http://git-master/r/237266
Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Paul Walmsley <pwalmsley@nvidia.com>
GVS: Gerrit_Virtual_Submit
sched: remove redundant update_runtime notifier

migration_call() will do all the things that update_runtime() does.
So it seems update_runtime() is a redundant notifier, remove it.

Furthermore, there is potential risk that the current code will catch
BUG_ON at line 687 of rt.c when do cpu hotplug while there are realtime
threads running because of enable runtime twice.

Change-Id: I0fdad8d5a1cebb845d3f308b205dbd6517c3e4de
Cc: bitbucket@online.de
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Reviewed-on: http://git-master/r/215596
(cherry picked from commit 8f646de983f24361814d9a6ca679845fb2265807)
Reviewed-on: http://git-master/r/223067
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Paul Walmsley <pwalmsley@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
sched: reinitialize rq->next_balance when a CPU is hot-added

Reinitialize rq->next_balance when a CPU is hot-added.  Otherwise,
scheduler domain rebalancing may be skipped if rq->next_balance was
set to a future time when the CPU was last active, and the
newly-re-added CPU is in idle_balance().  As a result, the
newly-re-added CPU will remain idle with no tasks scheduled until the
softlockup watchdog runs - potentially 4 seconds later.  This can
waste energy and reduce performance.

This behavior can be observed in some SoC kernels, which use CPU
hotplug to dynamically remove and add CPUs in response to load.  In
one case that triggered this behavior,

0. the system started with all cores enabled, running multi-threaded
   CPU-bound code;

1. the system entered some single-threaded code;

2. a CPU went idle and was hot-removed;

3. the system started executing a multi-threaded CPU-bound task;

4. the CPU from event 2 was re-added, to respond to the load.

The time interval between events 2 and 4 was approximately 300
milliseconds.

Of course, ideally CPU hotplug would not be used in this manner,
but this patch does appear to fix a real bug.

Nvidia folks: this patch is submitted as at least a partial fix for
bug 1243368 ("[sched] Load-balancing not happening correctly after
cores brought online")

Change-Id: Iabac21e110402bb581b7db40c42babc951d378d0
Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/208927
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Zu <pzu@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Peter Zu <pzu@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>