msm: audio: qdsp6v2: Fix for FBD TS inversion during AAC decoding

 -EOF flag of input buffer is not set properly.
 -set the flag of input buffer properly when meta info is enabled

Change-Id: I354fc16ad5bc8a9bcccdf150d1f138ce9744eeb0
CRs-Fixed: 431781
Signed-off-by: Preetam Singh Ranawat <apranawat@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c
msm: audio: Don't add memory map failed handle to memory map list

During cases where memory map is failed, before "region"
data structure is freed, we need to delete the region list
entry which is added to the begining of the list. Otherwise
this memory will be accessed in ion_remove when iterating
through the list to delete the nodes, which will lead to
device crash.

Change-Id: I002aff8d7d14dfc714adc55c3f21c25dc9f75797
CRs-fixed: 443453
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
msm: audio: Fix for WMA seek issue

- Seeking during WMA playback results in no audio.
- Input and output port flush were not called during
  seek which resulted in no WRTE_DONE ack from DSP to
  AIO driver.
- Fix is to add input and output port flush during seek.

Change-Id: I61b7f72211e64bf437566bf48cc009631e918900
CRs-fixed: 453026
Signed-off-by: Amal Paul <amal@codeaurora.org>
ASoC: msm: qdsp6v2: Ignore unexpected events from dsp

If dsp responds with an unexpected event, audio driver
should ignore the response and continue. Change removes
the BUG_ON and handles error gracefully.

Change-Id: Ie7bbf1ea9b47630dae38e89887e53883f8f1dc12
CRs-fixed: 512784
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: audio: qdsp6v2: Fix for jumping to next track when seeked to end

- During tunnel playback, when seek to end of the clip, and then
  seek back to other position, music player jumps to next track.
- When progress bar is dragged to end of the clip or beginning,
  this will invoke fsync function. fsync function waits for WRITE_DONE
  event from DSP. AUDIO_STOP or AUDIO_FLUSH should wake up fsync,
  but this wake up is not happening, as result driver issuing EOS
  cmd to DSP. Causing music player to jump to next track.
- Fix is to wake up the fsync during AUDIO_STOP and AUDIO_FLUSH.

Change-Id: I1f6da57136b7a957861c4f731350c7fa4452f61b
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c
ASoC: qcom: qdsp6v2: fix crash due to asynchronous read/write

Whenever an async read command is issued to dsp when
the driver is not enabled, there is a crash in userspace.
The read command is disallowed in the driver and an error
is propagated to userspace which results in the crash.
The driver is re-enabled in a subsequent asynchronous write
command anyway, so the async read command can be allowed.
Ensure that read is allowed by removing a superfluous check.

CRs-Fixed: 675131
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Change-Id: I5d0598e37d08ac1090f98c24be49fd99c132e22f
msm: kgsl: Clean-up gpuaddr allocated from kgsl gen_pool

All GPU Mapping which are done using kgsl_mmu_map_global
API, allocates gpu address from kgsl gen_pool. Only calling
kgsl_mmu_unmap for such mappings doesn't free up the gpuaddr
assigned from KGSL gen_pool. This results in Kernel bug when
KGSL gen_pool is destroyed. This changes makes sure that
all KGSL gen_pool GPU address are freed before destroying
kgsl gen_pool.

Change-Id: Iba46f18e7fe4fba661f5fe142f3470f61a31baa0
Signed-off-by: Anshuman Dani <adani@codeaurora.org>