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: 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: 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: 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>
ASoC: msm: Add support for WMA DSP decode

WMA V9 and WMA Pro tunnel-mode supports are added to
compressed driver. It allows user-space application to
decode WMA V9 and WMA Pro audio stream through QDSP6.

Change-Id: I99407d00b618a627e6d762be9abea4abd2410b8b
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
ASoC: msm: Fix wma pro block alignment parameter

The current code assigns and sends the wrong block
alignment information to the adsp because of which wma pro
playback fails. The fix assigns the correct block alignment
information for wma pro.

Change-Id: Ide475bbb8f98cd0201c2f8635a3ed831cd460194
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
ASoC: msm: qdsp6v2: Update pcm media format block to use correct stream id

Repeat mode is not working in pcm offload path. When two streams
are used in a single session pcm format block should be sent
specific to each stream. Data sent on stream 2 is ignored by DSP
because pcm format block is always sent on stream 1. Fix is to
update pcm media format block to use correct stream id before
data is sent to DSP.

CRs-Fixed: 673510
Change-Id: Id9369f9927fbd301ed6020ea9e35942b54305610
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: qdsp6: Add MP2 decoder format support

New ASM message format is added to support tunnel-mode MP2
decoder through QDSP6.

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