msm: sdio: Add support for sdio download restarts

The existing downloader setup doesn't handle modem restart use cases.
Add support to be able to handle this.

Change-Id: I10e3755ef1d4857e228e931e60c80f1df3c692e2
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
msm: sdio: Fix memory leak

Release the tty_driver struct on all exit paths to avoid memory leaks.

Change-Id: Ib4529f120e70b343e55e72122f19a877a8bc0503
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
ASoC: msm: Use spin lock to protect the shared data

Two different locks (spin lock and mutex lock) are used
to protect the shared data, this may cause kernel panic.
Use spin lock to protect the shared data between interrupt
function and non-interrupt functions.

Change-Id: Iba07a4f1fc33c492bc34b38a47ec839eb8e6d3fd
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
msm: kgsl: Add support for bulk cache operations

Add a new ioctl, IOCTL_KGSL_GPUMEM_SYNC_CACHE_BULK, which can be used
to sync a number of memory ids at once. This gives the driver an
opportunity to optimize the cache operations based on the total
working set of memory that needs to be managed.

Change-Id: I9693c54cb6f12468b7d9abb0afaef348e631a114
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: flush the entire cache when the bulk batch is large

On 8064 and 8974, flushing more than 16mb of virtual address
space is slower than flushing the entire cache. So flush
the entire cache when the working set is larger than this.
The threshold for full cache flush can be tuned at runtime via
the full_cache_threshold sysfs file.

Change-Id: If525e4c44eb043d0afc3fe42d7ef2c7de0ba2106
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
ASoC: msm: Fix wrong wait_event_timeout timeout checks

wait_event_timeout returns zero when there is a timeout.
Change fixes the condition check to handle timeouts.

Change-Id: I01184cce0c98a82bb205023b07dd4dd2d91b42ad
CRs-Fixed: 487821
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC: msm: Fix ADM RTAC

When low latency playback feature was added
RTAC devices were added but not removed.
Removed low latency devices completely from
being added and removed from RTAC

Change-Id: If64ccb685dd1bccf734a40ff694c6e95e037b22e
CRs-fixed: 487539
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
ASoC: wcd9xxx: Fix issue for headset when detected as lineout

Fix issue when headset is detected as lineout with slow insertion.
Headset is detected as lineout when initial DCE measurements show
voltages near microphone bias detecting as HIGH_HPH and even MIC
schmitt trigger does not trigger the headset insertion interrupt
when fully inserted. To avoid false detection, measure DCE voltages
continuously by enabling polling and then report the plug type.
At the end of polling, if it still reports lineout, enable MIC
schmitt trigger for further detection.

Change-Id: I0a5cb5f3a82a69a6e3ad4a31d5b4f31c5889b6fa
CRs-fixed: 470446
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: msm: qdsp6v2: Free afe command buffers

Afe command buffers should be freed once we send the
command to dsp and a timeout/response is recieved.

Change-Id: I04053fe398831c6f9bcdf6ca3c18d32889813b98
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: ipa: various IPA data path optimizations

These optimizations are needed to improve RNDIS E2E TCP
DL throughput.

Change-Id: I157a274e9d5e59f4d5a5d4fce4d95eb623ca7b96
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
arm/dt: mpq8092: add/fix the regulator nodes

1. add all missing regulator nodes
2. fix the voltages, source, default-ON based on
the latest mpq8092 power grid.

Change-Id: Ied53f8fee763b0958c94073707b590615f8b57cc
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
defconfig: apq8084: Enable QMI libraries

Enable QMI libraries to enable QMI communication by the kernel drivers.

Change-Id: I07914ef1900d77bef873280e486047608155c22d
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
msm: Kconfig: Enable QMI libraries on APQ8084

Enable QMI libraries to enable QMI communication by the kernel drivers.

Change-Id: Ia09b7a5bdd28943c3b63424b7654ed12011b40a8
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
crypto: Kconfig: 8610: Add Hardware crypto module.

Add hardware crypto module for 8610 target.

Change-Id: I15733e6569c78c20ec629a5031f9744286349811
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
ASoC: wcd9xxx: Switch to proper micbias source

After recording with headset is completed if headset PAs are on, micbias
source needs to be changed to vddio instead of cfilter to avoid mbhc
polling noise.  Change source of micbias avoid noise.

CRs-fixed: 484214
Change-Id: If312ecfcf87e688939b5b85dba44bc72aa06bb7e
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9xxx: Wait enough time during mbhc calibration

If mbhc micbias has a capacitor which is large enough to delay micbias
voltage ramp up/down, initial calibration also needs to delay enough time
after changing mux to be able to calibrate ground and micbias voltage
accurately.  Increase delay to 50ms during calibration and improve
calibration accuracy.

Change-Id: Ibdc124495a4455464d5874f33ed1547aec664242
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9xxx: recalibrate microphone ground voltage

Different clock sources can affect mbhc voltage inconsistent measurement
accumulation which consecutively results in inaccurate button detection.
Recalibrate ground voltage on dce handler to enhance mbhc button detection
accuracy.

CRs-fixed: 486037
Change-Id: Idfac856b7ba435a4ba1267f7f1c841084eaaab3b
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
8092: spmi: Remove extraneous aux-data entry

The aux-data entry for the SPMI PMIC Arbiter is not required and
should therefore be removed.

Change-Id: Id60370696b17e1a710f662f1f03d5ccf0c3dd49f
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
msm: clock-local2: Fix rcg_clk_set_rate race condition

Setting the parent corresponding to the new source
for an RCG clock while not holding the per-clock
spinlock for that RCG may cause race conditions.
Fix this. Also, use the new __clk_pre_reparent and
__clk_post_reparent APIs to switch the RCG source.

Change-Id: Idac6c006630cc617a48e7126e281cd78aac87fef
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: smd: remove incorrect use of smd_private.h

smd_private.h is an internal header file used to share private internal
details of the SMD driver to related components for the purposes of
debugging, segregating functionality, etc.  Nothing in smd_private.h
is intended to be exposed for client use, and including it in a file
should be a special exception, not a normal usecase.

Remove client structures from smd_private.h that do not conform to the
purpose of smd_private.h.

Change-Id: Ic7db986d83622cf4300fbc95ff31f129d0ed5f44
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>