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>
ASoC: msm: qdsp6v2: adding volume per dev-id

Add volume mixer control per device id for pcm use case.

Change-Id: Ieab721541a5cdf494b7fad78abc06d4f667b4baf
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
  ASoC: msm: qdsp6v2: Add SEC_I2S_RX port as EC reference

  SECONDARY_I2S_RX as EC reference port is needed for msm8x10.
  Add support to enable SEC_I2S_RX as EC reference port.

  CRs-Fixed: 646310

Change-Id: Ie114dd29afc16ff324388743377fb5c755f4ad7b
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
ASoC: Add external EC reference

Add support to set external EC reference. The external
reference are set to start along with multimedia
capture session.

Change-Id: I209b0dbb9c8f126f4c88cd53a77da719ad89f357
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: Correct the mixer control name

Change the mixer to match userspace mixer control.
Fix the null pointer dereference caused in soc core.
This null pointer exception was found in monkey run.

Change-Id: I0b3ca551fd2c057edd54a9771a13354ce6f0b7d2
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: msm: qdsp6v2: Do not free memory that has not been unmapped from DSP

The memory that is not unmapped from DSP should not be used until
DSP clears it. Do not free iom memory if the DSP unmap has
failed.

CRs-fixed: 599780
Change-Id: I4ceae34e0f8d6381efc34ce642babbc30ca5e57e
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: qdsp6v2: add check for NULL dereference

The asm loopback driver during close does not check
for NULL before closing the playback and capture
instances.

The change ensures only the valid playback/capture
instances are closed.

CRs-Fixed: 643724
Change-Id: I3373f62a2413e1497b6f8a401158444cd2870b2a
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
ASoC: msm: fix the target crash due to the NULL pointer dereference

During the close of the FE, the mclk is disabled which accesses the
codec drv data.
In case if the tapan codec was not initialized, then close sequence
will result in the null pointer dereference.
Fix by adding a null check before accessing the codec data structure.

CRs-Fixed: 635065
Change-Id: I0678826d073a69b99a05a5b628920be89d210519
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
ASoC: msm: qdspv2: Add hw_free for mi2s backend

In the current driver we did not implement hw_free callback.
During stability test, hw_params is called twice without shutdown
and startup due to this there is mismatch in hw_params.
In this case hw_free is trigerred, so implement hw_free and if
hw_free is called take appropriate action in hw_params.

CRs-Fixed: 611216
Change-Id: I4afa59adc81aa361147937b2211fe021b6e47b40
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
ASoC: msm: qdsp6v2: add support for device mute

Add support for muting the RX and TX devices without affecting
the voice stream. This feature is added to aid in voice call
quality testing.

CRs-Fixed: 634690
Change-Id: I6e4eeda853bb5aa31166d1b66f486142397a6b43
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
ASoC: msm: Add G711 media type support for Voip call

G711 is currently not supported in the Voip driver.
Add G711 media type to existing Voip driver.

Change-Id: If464afa68400ddc63a0b2700d8357511d4435787
Signed-off-by: Prashanth Reddy <pgreddy@codeaurora.org>
ASoC: msm: qdsp6v2: SLIM_RX and I2S_RX is internal echo reference

We should not trigger SLIM TX backend for SLIM_RX and I2S_RX
widgets as those are internal echo references.

Change-Id: I9a55ad72a999f1c1e08a046ed2956f648e3610de
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: msm: Fix for USB device switch

Add mutex locks to prevent sending multiple mem map
commands unless the previous one returns, because otherwise
the mem_handle is overwritten.

CRs-fixed: 646752
Change-Id: I2a472430d4505c9f74ed033260e1e99cb787e03a
Signed-off-by: Vicky Sehrawat <vickys@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: Do not deregister APR mmap handle for ASM Custom Topology

Remove APR deregister call from ASM Custom Topology to
ensure that the RESET event is called during SSR to
signal that ASM custom topology needs to be sent.

Various error handling is also added so that reference
count for apr deregister and register also happens properly.

Change-Id: Ib127f20442dd457bc265d93c01ab0fb94beff2f3
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm: qdsp6v2: update rtac driver with asm handle

rtac driver uses the asm session handle to communicate with DSP
this handle is supplied to rtac driver in q6asm_audio_client_alloc
function. But the rtac driver is not updated when the asm session
is de-allocated. This change is about updating rtac driver with
asm session handle during q6asm_audio_client_free.

Change-Id: I10bab5830d8e29d17907511c757c4d2bcf09c0cc
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
ASoC: msm: qdsp6v2: clear old memhandle list when SSR happens

When SSR triggers, ASM gets RESET_EVENT callback.
Clear custom topology related old memhandle list here.
Otherwise for next ASM session opened after SSR,
old memhandle is sent to DSP and result in no audio.
Also, for ASM session while unmap during SSR, APR
command fail is expected, even then go ahead and
clear old mem handles relating to session.
Add changes to clear it from list.

CRs-Fixed: 592823, 589762, 592580, 590719, 589450, 593497
Change-Id: I10fc8190e929c7a4a344b1d393233e6cbcfcee97
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
ASoC: msm: qdsp6v2: Check for null data pointer

Add check for null data pointer in
aprv2_core_fn_q() and log error message if
true.

CRs-Fixed: 575228
Change-Id: I0d02913ced422ff3f396375c70ad6929908ee58d
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ASoC: dapm: Unlock mutex in error cases

Dapm functions are not unlocking the mutex when an error
is encountered.This change fixes the mutex unlock issue.

Change-Id: Ia7ffaea9a30ae09a501f8f861c62c64d6c110d44
CRs-fixed: 613644
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
(cherry picked from commit e5d642a37a643bf9ee4606e0a43b6714019fbc4a)
ASoC: msm: Add MP2 decode support in compress driver

Add MP2 decoder support to ALSA compressed driver. It
allows user-space application to play MP2 audio data through
QDSP6.

Change-Id: I44c35ebe40a361c70bfde3caf88f4f4c6bb457e4
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>