ASoC: wcd9xxx: Do not use current source if micbias is already enabled

Some targets share the same micbias for handset mic and headset mic.
When any recording is in progress from handset mic and if headset
is inserted, we shouldn't be using current source for the detection
as the micbias is already enabled. Check if micbias is already enabled
or not and if it is already enabled, detect the headset insertion using
micbias not with current source.

Change-Id: I269c2320ed735fa07f6b77ebffe4d2a1a8163da9
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm: ADSPRPC: Add checks for erroneous values

Check for invalid parameters passed in user invocation
and validate the return values using appropriate macros.

Change-Id: If529873d025ac0c13725efbedda5a58fae327722
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
ASoC: msm: remove event_abort and enabled flags from RESET_EVENTS callback

After ADSP SSR RESET_EVENTS is called if audio enabled flag is 0,
omx component cannot release resource properly. And when event_abort is 1,
OMX event handler is exited without releasing resources.

Change-Id: I03e883a7a7f6283d9778c0ec279622af59f4dd09
Signed-off-by: Fred Oh <fred@codeaurora.org>
camera_v2: Use JPEG_DBG instead of JPEG_ERR for some messages

Avoid printing by default a number of debug messages, to decrease
the ioctl latency in the dual JPEG use case.

Signed-off-by: Kamen Kirov <kkirov@codeaurora.org>
Change-Id: I1cfd16270282587cbf1821d34f658af80fe69fd1
defconfig: msm: Enable KSM for msm8610

Kernel Samepage Merging (KSM) saves memory by merging
pages with the same content.

Change-Id: I89468761e03b08c4700d2aa0f7c8ccad45dd0550
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
android/lowmemorykiller: Account for total_swapcache_pages

The lowmemorykiller relies on NR_FILE_PAGES when measureing
the amount of reclaimable memory in the system.
However when swap is enabled swap cache pages are counted
in NR_FILE_PAGES, and swap cache pages aren't as reclaimable
in low memory as file cache pages. Therefore a large swap
cache can result in the lowmemorykiller not running and
an OOM occuring.

In order to ensure the lowmemorykiller properly evaluates the
amount of reclaimable memory don't count the swap cache pages.

Change-Id: I38239283e572f814b277c718eaf6be7f92abacbb
Signed-off-by: Liam Mark <lmark@codeaurora.org>
camera_v2: Add IOCTL to set jpeg core clock rate

Adds a new IOCTL that provides ability to set the JPEG clock rate
dynamically.

Change-Id: Ifd8e4d57f6688e5f09c9ef049bcf928483bf1f79
Signed-off-by: Kamen Kirov <kkirov@codeaurora.org>
staging: zsmalloc: Ensure handle is never 0 on success

zsmalloc encodes a handle using the pfn and an object
index. On hardware platforms with physical memory starting
at 0x0 the pfn can be 0. This causes the encoded handle to be
0 and is incorrectly interpreted as an allocation failure.

This issue affects all current and future SoCs with physical
memory starting at 0x0. All MSM8974 SoCs which includes
Google Nexus 5 devices are affected.

To prevent this false error we ensure that the encoded handle
will not be 0 when allocation succeeds.

Change-Id: I5ad31712be4dd5105ebee81fa95927039c0f6935
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: hotplug: Block hotplug removal of CPU0

Hotplug removal of CPU0 is not currently supported. Attempts to
remove it may result in undefined behaviour. Explicitly block
any such attempts before other hotplug notifiers get the chance
to run by setting the notifier priority to INT_MAX.

Change-Id: I9e1f5b4a0db554295a097220417f2bdf4c690f5f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: Adding mechanism to Stop CAMIF Immediately

Currently we have the mechanism to stop CAMIF immeidately from
Kernel Space. This chnage provides access to this mechanism.

Improving the procedure for CAMIF Stop:
Implemented the recommended mechanism for CAMIF Stop.

Change-Id: If015241598ff9134d1ce49def35f6083eff2d9c3
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
Revert "Revert "kernel: rng: Add IOCTL support to disable bus bandwidth""

This reverts commit 911fb8222bf5f4df424368a27b1c9f513db0a9d2

Change-Id: If9d4d8be7690c2cd7d4fffba084edb7247042dd0
qseecom: Copy userspace buffer into kernel space before dereferencing

ION memory is used for user space to kernel space data passing.
This is directly accessible in kernel. But, if the IOCTL is called
from user space without using User space library, then data might
be pointing to some other memory location, in which case, it would
not be possible to dereference this location in kernel & hence it
would be accessing invalid memory.

Change-Id: Ic50c76ee8b2a696dbb786fce3a68cdc782e15268
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
msm: vidc: Fix cache invalidation issue

- Cache invalidation is being skipped out on all output
  buffers except first buffer due to NULL buffer handle
  in case of all output buffers are allocated as single
  chunk.
- This change fixes the issue by properly assigning the
  buffer handle for all output buffers.

CRs-Fixed: 581806
Change-Id: I415c3cc0ef9d82ea3c97ea618babbfbfc9f36f8b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Merge "qseecom: Copy userspace buffer into kernel space before dereferencing"
Merge "msm: ADSPRPC: Add checks for erroneous values"
mdss: display: Correlate frame and clock rate names

Update framerate and clockrate to be correlated
with the documentation and dtsi files.

Change-Id: I582ff2d564c4922821d494f4ea9d67f43e77ff28
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
ASoC: msm: qdsp6v2: add function names to tell same apr errors

There are same apr error messages without function names. Add function
name in error messages will increase readability.

Change-Id: Ic48f7a2a1a6ab225d0cb16516a594a96bf2f2145
Signed-off-by: Fred Oh <fred@codeaurora.org>
Merge "mdss: display: Correlate frame and clock rate names"
Merge "camera_v2: Use JPEG_DBG instead of JPEG_ERR for some messages"
Merge "Revert "Revert "kernel: rng: Add IOCTL support to disable bus bandwidth"""