ASoC: msm: qdsp6v2: Don't update state variables for no-wait commands

Some of the afe commands that are sent to dsp are asynchronous
and the thread will not go into sleep. Do not modify any state
variable that are used for the synchronous commands to avoid
possible race conditions.

CRs-fixed: 538366
Change-Id: I10cf75ceb6749ffbdb05461ac0b3bdf944d59299
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: qdsp6v2: Set ADM channel to max supported for ULL

ULL copp can only operate currently for 2 Channels.
ADM open for ULL fails for channel greater than 2 channels
Set the channel to max supported
when adm is opened for a ULL device session.

Change-Id: Ib47af5bca7461b935fae0f695b04767929bea925
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: qdsp6v2: Copy frame data based on frame length

Copying data based on count will result in copying
uninitialized data to userspace which can potentially
disclose sensitive data. Fix by copying data based on
frame instead.

Change-Id: I39e264b1ffc7a6b79b01c14cd0b5bb00c67307c6
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Fix for power collapse hostless usecase

For hostless pcm usecases apps processor is not needed
for data path. Once data path is established hostless
driver will remove the pm_qos_request to allow the host
CPU to power collapse. Change adds the support to remove
the pm_qos_request once data path is setup.

Change-Id: Ic6ac8d99628c770061ec785f8549c164f6a9bbd8
CRs-fixed: 561202
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Fix playback failure with tinyalsa test app

PCM playback through tinyplay test app fails as it tries
to write data in chunks of ring buffer size instead of
period size. msm_pcm_playback_copy function checks the
available bytes in the shared buffer and rejects if the
bytes received are more.
Instead of rejecting the buffer, copy bytes equal to available
size i.e. period size. The ALSA framework will take care of
updating the offsets and looping through the remaining data.

Change-Id: Ie5136f7188091e3e978d4b3c3251c0b066c5ac6c
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: qdsp6: Add support for gapless audio playback

Update ASM driver to support for gapless audio playback in
tunnel mode.

Change-Id: Id1f25afef25b3636fb50dc08b5feb803150d1b59
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Add support for gapless audio playback

Update compress driver to enable gapless mode in DSP to
achieve gapless audio playback in compress offload mode.

Change-Id: I212178025996f28ff5a3ddc361ceb7bd70b5d192
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: qdsp6v2: Handle SSR for audio playback over BT usecase

Proxy afe and pcm afe instances are not reset to 0 when
adsp ssr happens during audio playback over BT. Reset these
instances to 0 to avoid playback failures after subsystem restart.

Change-Id: I7afd9f1c3a953ed67248a96d0d8a4804e8a77061
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: qdsp6: Add support for custom topology

Update ASM driver to send commands to DSP to enable
custom topology for enabling audio post processing
effects in POPP.

Change-Id: Ic222b5045820ebabb79148c8e51f5fd90fcd1410
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: qdsp6: Add support for audio post processing effects

Add interface to support configuring equlaizer, bass boost,
virtualizer and reverb effects in DSP for tunnel mode of
playback.

Change-Id: Ie1512e340315302691327b6379a0935170dc57a7
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Add support to enable audio post processing in DSP

Add interface to support configuring equlaizer, bass boost,
virtualizer and reverb effects in DSP for tunnel mode of
playback.

Change-Id: I5ed578df1e1cb860734d2205c0895e82cfbdfbfc
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Enable initial/trailing silence removal

For gapless audio playback, the DSP HW decoder needs to
remove the initial and trailing samples from the decoder
output according to meta data present in the stream. This
change is to enable the silence removal by sending the
meta data down to DSP.

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: qdsp6v2: Fix APR de-register issues during session close

APR de-register should get called for all open streams. The
change handles a case where de-register is not called.

CRs-fixed: 584533
Change-Id: Ied50b68cdf675583e1451954f7ddf40e9c4f53df
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Add support for RTAC version 1.1

Add support for RTAC v1.1 which includes POPP topology.
To support backwards compatibility an ADM RTAC v1.0
structure is created as well as a 1.1.

Change-Id: Ia87109263f4176534043d6eaceddd24f9f83cfec
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Add support for ASM loopback

Add ASM loopback driver. When audio path wants to use filters in DSP,
it will do a loopback in ASM.  The new ASM loopback driver enables
the loopback.

Change-Id: I3ddfbf0a1be5b3b1d37b47b44d321ea7da93da83
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: flush if prior and current backends rate not matching

It is found that during device switch from one backend
with one sample rate to another backend with another sample rate
the command to QDSP6 ADM which maps audio stream session to a
particular backend would not get carried out until pending
data of audio stream session from previous backend is either
read out or flushed. This scenario occurs when application
stops providing more buffers to retrieve captured data.
Remedy is to flush upon detection of rate mismatching.

Change-Id: Ia9d9a1819c6e21a44f2778185420ca43cca30258
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Add routing for HFP using AFE and ASM Loopback

HFP hostless driver is used to loopback BT data into
SLIM_0_RX. And asm loopback MM6 is used for looping
data from mic to BT so that pre_proc effects can be
added.

Change-Id: Ic818b91c545a4d17043ecdf933d6d3398ad591d3
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm8974: Add support for HFP

Add support for HFP for 8974 target.
Front end dai for HFP hostless for RX and MM6 for TX for HFP

Change-Id: I0406bd2b10c3daab4d583c690f27a9ba1d09af60
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ARM: dts: msm: Update device tree node for msm-pcm-dsp

Update the name and properties for msm-pcm-dsp. Use qti instead
of qcom for device node and its properties.

Change-Id: I97d8f336be5e3b6792d99eece27c7d7773e33aa1
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
ASoC: msm: Update the name for pcm platform driver.

Update the name of pcm platform driver to match with device tree
node.

Change-Id: I37063c7b6aa2a04b31f86754b24f9aa046d4c4a9
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>