msm: audio: qdsp6v2: Add NULL check for mmap APR handle

In addtion to mmap ref_cnt check, add condition to check for
mmap APR handle NULL before calling APR register.

As part adsp subsystem restart handling, mmap APR handle is set to
NULL in reset event handling. Checking for mmap APR handle will
allow APR registration to succeed post adsp subsystem restart.

Change-Id: Id1945467616c1c0331b0627d14dabdbc24a0acdd
Signed-off-by: Ravishankar Sarawadi <crsaraw@codeaurora.org>
msm: msm_bus: Account for multiple channels in clock frequency

Currently, for multiple channels on a bus or memory, the aggregated
ab value is divided by the number of channels while calculating
bandwidth values for NoCs. However, the channels are not accounted
for while calculating the clock frequency. This factors
into the calculations only when sum of all ab values exceeds the
max of ib values. In that case, we risk running the clocks higher
than required. This patch fixes the issue.

Change-Id: Ia2ddb5f3bfa6049bcffc909c3b79e6382525129c
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
arm/dt: 8610: Add coreisght support for bus devices

This patch enables bus profiling for NoCs and BIMC by enabling
registration with coresight.

Change-Id: I251635af2648a634e48ccbae8191ee89d3c9d73b
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: pm: add failed stats

for idle and supsend failed cases the stats
are not updated correctly, they are just added to
success bucket.

This patch is to log the failed stats separately.

Change-Id: If570b1026bce97750bed037585ce4b34fcb6700f
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
arm/dt: apq8074: use soc as a root node

Fix root node to refer to the soc node.

Change-Id: I27d5007f9ae6dcdacbcd5f7521e577736bcc5848
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
ARM: msm: Add temperature alarm device for targets using PMIC PM8226

Add a temperature alarm device node for PM8226 so that the PMIC
die temperature may be monitored and so that an interrupt is
triggered if thermal overload occurs.

Change-Id: I40cd9b2ae8a201f487be4fd3de181f83050f15f1
Signed-off-by: David Collins <collinsd@codeaurora.org>
defconfig: msm8226: Enable CONFIG_THERMAL_QPNP

Enable support for the QPNP PMIC temperature alarm.

Change-Id: Idfeb458a15e4780586c193053a536d969d243004
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: Makefile: Clean up rules for nand_partitions.o

Invert the conditional statement used to build
nand_partitions.o to increase code maintainability.

Change-Id: I324cc03dfe31f7e96cd66d1afd95d5c807bbbbb4
Signed-off-by: Stepan Moskovchenko <stepanm@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>
ASoC: wcd9320: Add routes from slimbus ports to IIR

Taiko codec has two IIR blocks. Add audio routes from Slimbus
ports to IIR blocks.

CRs-Fixed: 482295
Change-Id: I833ac4860507f6f0ef93d77d6e894baa2c69e629
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
msm: Add bindings for memblock_reserve memory

Under some circumstances, drivers may wish to have a region of
memory set aside with memblock_reserved instead of memblock_remove.
Add bindings for this reservation.

Change-Id: I41f4eeebf2f1a38374a7c8a0b65f6907d6e38faa
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: memory: Add memblock_reserve bindings to dt reserve code

Drivers may wish to just reserve a block of memory in addition to
removing it or adding a size to a general pool. Update the DT
scanning code to scan for these bindings and reserve the memory.

Change-Id: Ic55c4271670a655f26a11d47a0d64cc525f9bfb2
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
crypto: msm: ota: multiple ota devices support.

This patch provides multiple hw devices support for ota crypto driver.
The driver dynamically allocates hardware resources for each ota crypto
operations. Further more, the stat structure in the driver
is changed to support device tree.

Change-Id: I701fe08ecc51f53ddbe6e2b76b2fb65ab79190d2
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
ASoC: msm: qdsp6v2: Fix for handling timeouts

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

Change-Id: I8c67669242df7a08e94c7887d3e28eea84ed6da2
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: kgsl: Switch to using the dmabuf APIs

The dmabuf APIs are now fully supported upstream. Since Ion
is now a dmabuf exporter, there is no need to call those APIs
directly. Switch to calling the dmabuf APIs to generate
scattergather lists for mapping to be more compatible.

Change-Id: Ie393e74bba080cba8a10e60908af7932729e6da6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
wcnss: Add API to read WLAN RX buffer count

WLAN driver's RX buffer count is a configurable value; WCNSS platform
driver will expose an API to read this configurable value from device
tree. Using a smaller coount of this buffer will reduce the memory
usage of WLAN driver.

Change-Id: Ida3da258ec1efdc16d37e50f69de8248fd6a26f9
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
arm/dt: msm8610: Specify WLAN RX buffer count

WLAN RX buffer count is a configurable value, using a smaller count of
this buffer will reduce the memory usage.

Change-Id: Ifd7bcbced3a6845d5b9dd6b67f2834f254a00ac7
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
arm/dt: 8974: Rename WCNSS properties

Rename WCNSS properties to use "-" instead of "_".

Change-Id: I604d9e4b91feded98c4d1e888a5190bbe44948dd
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>