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.

Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: Update supported sample rates

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

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: compress: fix the target not going to TCXO shutdown

The error code propagated from the flush cmd in the trigger stop
is causing the error in the state of the soc compress framework.
This hinders in closing the BE connected to the FE.
If the AFE is not closed it prevents the target to go into TCXO
shutdown.
Fixed by removing the error handling of the flush command in the
trigger stop, since failure in flush doesn't signify the
failure in the stop command.

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
async: introduce 'async_domain' type

This is in preparation for teaching async_synchronize_full() to sync all
pending async work, and not just on the async_running domain.  This
conversion is functionally equivalent, just embedding the existing list
in a new async_domain type.

The .registered attribute is used in a later patch to distinguish
between domains that want to be flushed by async_synchronize_full()
versus those that only expect async_synchronize_{full|cookie}_domain to
be used for flushing.

[jejb: add async.h to scsi_priv.h for struct async_domain]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: Cold start latency reduction

This patch parallelizes FE (front end) and BE (back end)
when playback/capture path is set up. FE's and BE's which can
be parallelized should be indicated in corresponding machine file.
All the operations can be started asynchronously provided the usecase
supports asynchronous operation.
Parallelizing reduces the startup latency as both FE and BE opeations
run in parallel.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm8974: Machine driver async ops change

Asoc framework supports parallelization of operations
which reduces the startup latency. Machine driver will
specify which usecases support parallelization. This
change updates the machine driver to enable the parallelization.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: move hw_params into prepare

Asoc framework supports parallelization of operations
which reduces the startup latency.
Moving hw_params into prepare further reduces this start
up latency.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>