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>
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: 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>
msm: camera: Change WRITE CMD type for CCI READ

In case of repeated START condition, MASTER shall bypass STOP condition
and pull low SDA pin to trigger repeated START transaction. For this to
work, SDA pin shall toggle to HIGH state only when SCL is LOW. If SCL is
HIGH when SDA pin toggles, SLAVE shall consider it as STOP condition.
Future repeated START condition triggered by MASTER will not be detected
by slave. To avoid this, use WRITE_DISABLE_P_CMD. This will ensure that
MASTER toggle SDA state to HIGH only when SCL is low.

Change-Id: I4b4c849251f9a0548fe259b27447fba194bcc005
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
mmc: core: remove the polling for BKOPS completion

The original intention of polling for BKOPS completion was to give
the card enough time to perform the BKOPS before it is runtime suspended.
But as the BKOPS completion polling was happening in a different
context, it may race with card runtime/platform suspend which is quite
difficult to fix. So instead of BKOPS polling, let the runtime suspend
get deferred if the BKOPS is running on the card. Also if BKOPS is running
when platform suspend is triggered, stop the BKOPS before suspending the
card.

CRs-Fixed: 489523
Change-Id: I21e524dc2da37c4985c210abfaca00a28049c651
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
arm/dt: apq8074: drop chg prefix for qcom,chg devices

Drop the unnecessary chg prefix for SMBB and SMBBP charger peripherals.
Note that the qcom,chg-misc peripheral will not drop this
prefix to avoid confusion with the MISC device which
already uses qcom,misc as a device name.

Change-Id: Id4f0427364b95c46925e07c73ef8a9bdb13efd2c
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
ASoC: msm: qdsp6v2: Handle call end properly

The commands for detaching CVS session and unmapping
data exchange memory are sent to LPASS when a voip call ends.
When tearing down a call, the command for unmapping calibration
memory will be sent to LPASS if there is one call existed.

Change-Id: I49abe68aee71931884ee620593297d6b98ba59ed
CRs-fixed: 487075
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>