msm: audio: qdsp6v2:  Check return code from audio_aio_open()

When audio_aio_open() is triggered in blocking fashion, it  frees audio
resouces and returns error code. In the current implementation,  callers
did not check the error code which can lead to dereference to freed
resources and cause system crash.  Update the callers to check return
code and then return error back to application to avoid the issue. In
the meanwhile, update the audio_aio_open not to free memory for caller
and leave the caller to free the memory in error condition.

CRs-fixed: 436653
Change-Id: If4dda158cb988c5837517817b1afa0572c30696e
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp6v2/audio_aac.c
	arch/arm/mach-msm/qdsp6v2/audio_amrnb.c
	arch/arm/mach-msm/qdsp6v2/audio_amrwb.c
	arch/arm/mach-msm/qdsp6v2/audio_evrc.c
	arch/arm/mach-msm/qdsp6v2/audio_mp3.c
	arch/arm/mach-msm/qdsp6v2/audio_multi_aac.c
	arch/arm/mach-msm/qdsp6v2/audio_qcelp.c
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c
	arch/arm/mach-msm/qdsp6v2/audio_wma.c
	arch/arm/mach-msm/qdsp6v2/audio_wmapro.c
msm: audio: qdsp6v2: Add NULL checking for input parameters

Add checking for NULL. Two parameters shouldn't be NULL.

Change-Id: Ied9e9e6238f6498305844bf3a08370c7cf751fc7
Signed-off-by: Fred Oh <fred@codeaurora.org>
msm: audio: qdsp6v2: Fix for kernel crash during stability

- Userspace calling AYSN_READ during flush, READ_DONE ack for
  this is coming after FLUSH_DONE which is hitting BUG_ON as
  buffers are removed from in_queue/out_queue during flush.
- Fix is to avoid sending READ requests to DSP until flush
  is complete.

CRs-Fixed: 485288
Change-Id: Ia2a64471a3507b3f5565b695c40cc6dd9081930d
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
msm: audio: qdsp6v2: Fix voice RTAC.

There was data type mismatch which caused the corruption during
memory copy. It leads to the voice RTAC failure.

CRs-Fixed: 391392
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
(cherry picked from commit 823fd65d9eef2f728b343fe0e891122f226b887e)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 0ce787caa67c0c215edde3be28b578c183a6f337)

Change-Id: I19c000d2c5bc3e08a57be6e4e4036b37140badbf
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: audio: qdsp6v2: Add support to configure ISO and ARIB coefficients

Add support for configuring ISO or ARIB stereo mixing coefficients.
This change introduces an IOCTL through which the user space can
configure ISO or ARIB coefficients.

Change-Id: Id08c859ce8bc18d7d0e41ce1ecb6a08f0794e067
Signed-off-by: Amal Paul <amal@codeaurora.org>