ASoC: msm: qdsp6v2: Update supported sample rates

Compress driver supports 96Khz and 192Khz sample rates. Change updates
the supported frequencies in the compress driver.

Change-Id: I4093f18ca36259dc8f159b38a452108d2d6d142a
CRs-fixed: 653510
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
stereo call recording support

Patch that allows for call recording in
stereo (left channel: TX; right channel:
RX). Tested on Nexus 5 (MSM8974). Likely
works on other recent MSM chipsets as
well.

Change-Id: I3dd14f99f17106e0e16a8cdb4a951dc8a4aaea63
ASoC: msm: qdsp6v2: add support for dynamic TTY mode change

DSP supports enabling/disabling and changing between TTY modes
while a call is already ongoing. Add support in voice drivers
to enable and switch between different TTY modes.

Change-Id: Idf3372fc3d0205f706584e8b3652dc5e39b4ceef
CRs-fixed: 608183
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: qdsp6v2: Fix voip call start dealy in APQ

Voip calls are started with delay in APQ. This delay is due to
modem apr register timeout as there is no internal modem in APQ.
Add check not to call apr register for voip calls

Change-Id: I689bbf2f670aac55f385415f6c03937290ed8ef3
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
ASoC: msm: qdsp6v2: Low latency mode for audio capture

For low latency audio capture sessions adm should be
opened in low latency mode.This change checks for low latency
mode and passes the info to adm.

CRs-fixed: 622080
Change-Id: I1fb6f82570f48b392ada631278ed097214d9cb5b
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: compr: Use irq{save/restore} version of spinlock

compress driver event handler uses spin_lock/unlock APIs.
It should be sufficient to use the irq{save/restore} versions.

Change-Id: I8f32c6896396a09faa1baf741bd182d8ceb4301a
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
ASoC: msm: qdsp6v2: extra low latency mode change for audio capture

For low latency audio capture sessions adm should be
opened in low latency mode.This change checks for low latency
mode and passes the info to adm.

Change-Id: I8cc5efc44f7500d7abf6db54f8ab74d60f1bbf97
CRs-fixed: 622080
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
ASoC: msm: Reset the stream open flag after CMD_CLOSE is sent to DSP

In case of gapless playback, driver does not wait for EOS. CMD_CLOSE
for stream one or two can be called from compress driver free before
EOS ACK for stream one is received. This can result in CMD_CLOSE to
be sent for already closed stream. Reset the stream open flag after
CMD_CLOSE is sent to DSP to prevent multiple CMD_CLOSE on same
stream.

Change-Id: Ic186ae37a760a2996ebd7b9b5dc5d5846621ab66
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: msm: qdsp6v2: Fix voice mute issue when EC ref is set

Function voc_set_ext_ec_ref returns 0 on success, handle the
return value of this function appropriately to avoid mute issue.

CRs-Fixed: 601078
Change-Id: I7226c088410bf4a2effe0d060f839dc7928359bf
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
ASoC: msm: qdsp6v2: Remove cmd_state from ASM header function

Cmd_state indicates whether the callback has been received
and whether the function should exit wait.
Remove setting of this variable in ASM header because
some functions such as get_session_time need ASM header
but do not need to modify this flag.

CRs-fixed: 613817
Change-Id: I6751cd89b3199c7350aaf1ebb70d7062ac65554f
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: qdsp6: Add support to configure ISO and ARIB coefficients

Add support for configuring ISO or ARIB stereo mixing
coefficients. This change introduces a function with which,
AAC multi-channel driver can configure ISO or ARIB coefficients
according to configuration done by the client.

Change-Id: I1ca3b0a74a7258f9adb6818595f070e249abca4d
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
ASoC: msm: EOS timeout now based on audio data

The timeout value, in relation to waiting for the
EOS command completion message from ADSP, is now
based on the time it will take the ADSP to stream
the remaining audio buffers.

Change-Id: I76fa7d97b91052afd8884aab40bc5df040951be5
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ARM: dts: msm: Update device tree node for audio

Rename properties and compatible strings to return to the old
naming convention.

Change-Id: Ia58df9c4084e4d570d487aff1138522d3b862a58
Signed-off-by: Kumar Gala <galak@codeaurora.org>
ASoC: msm: Add PCM support in compress driver

PCM playback support is added to compress driver so that application
can use the single audio hardware device to play both compressed
and PCM audio.

Change-Id: Ie7719be8d7435088a7e4cfb5b817d4557e25e4c5
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
ASoC: msm: Null dereference check added

In asm_read function we should check buffer pointer
before it is dererferenced.

CRs-Fixed: 612682
Change-Id: I1968c038e1d35381bf174000287d542441e41092
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: msm: Fix the Listen calibration copy issue

This change fixes issue with listen calibration data
copied to the shared memory of correct size. A bug was
introduced during support for multisession listen support
on this branch. This changes address that issue of copying
calibration data of correct length.

Change-Id: I772ea7fc076c42ddd3629f6eba6eeb38313cbf88
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
ASoC: msm: qdsp6v2: Userspace interaction cleanup

Listen ioctl function transfers data to/from userspace
and additionally implements logic to process ioctl command.
Ioctl function should delegate the processing to internal
functions for supporting compat mode.
This change moves the processing into internal function.

Change-Id: Iffb86d2aa85579340eecd48f396c5fa839f521d5
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: lsm: use wrapper for ION memory handling

ION memory allocation and mapping happens in different ways for
systems with and without SMMU. Use generic ION wrapper for
using the right set of commands for lsm memory buffers.

Change-Id: If6132a60d245a0b1804a826eceb4187a0c1a5c6e
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: msm: Do not set volume to zero during session open

Setting stream volume to 0 will cause problem when user
starts playback from aplay. The previous volume which is
set gets overwritten with 0 when the playback starts. To
avoid this user space can control the volume setting at
the start of the playback.

Change-Id: I3776bb7ffd390ff0cfb56462bebb60a9163a7796
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: msm: Add check for NULL pointer and buffer overflow

Changes to add check for NULL pointer before they
get dereferenced and check for buffer overflows
to ensure out of bound indexes of arrays are not
accessed.

CRs-fixed: 628847 628850
Change-Id: I3fcebe07a7f9e7ff480857480fa0df2ada017c69
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>