msm: qdsp6v2: squashed updatest from caf 3.5

msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: Ia8e6148eef2cafe6931c6fdc35d7aafeb0c0bd97
CRs-Fixed: 556792
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>

ASoC: qcom: qdsp6v2: Initialize locks before use

Spinlock crash issue is fixed with this patch. This patch
is to initialize the locks before it is used.

Change-Id: Ib8200b5f2d89bd3e06db4a47e3682fe290fa6b3c
Signed-off-by: Anish Kumar <kanish@codeaurora.org>

msm: audio: qdsp6v2: Enable soft volume/soft pause command

Add support for soft volume command and enable it to avoid
noise during volume change sequence.
Add support for soft pause command and enable it to avoid
noise during pause/resume change sequence.

CRs-Fixed: 425431
Change-Id: Ie10c73a0f35a191168f4306b1122102ed0f75ad0
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_mp3.c
	arch/arm/mach-msm/qdsp6v2/audio_utils_aio.c

msm: audio: qdsp6v2: Update correct stream parameters for tunnel mode

Add a new member for sample rate in the aac_config structure,
driver to use this value to update sample rate not the sample rate
set in pcm_config structure for tunnelmode.

Change-Id: I2cd38478673c90bb94d12124f89ab03382ca70e9
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_aac.c
	arch/arm/mach-msm/qdsp6v2/audio_multi_aac.c

ASoC: msm: Process reset events for NT mode encoder drivers

Propagate RESET EVENTS notification to the NT mode encoder drivers
to clean up the handles and exit the session safely.

Change-Id: I9c9ef05a70aeb242eaef83a2aee9dc86ca9de097
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils.c
	arch/arm/mach-msm/qdsp6v2/audio_utils.h
	arch/arm/mach-msm/qdsp6v2/evrc_in.c
	arch/arm/mach-msm/qdsp6v2/q6audio_v2.c
	arch/arm/mach-msm/qdsp6v2/qcelp_in.c

ASOC: qdsp6: Add pause/resume support for AAC encoder

-  If session is stopped, AUDIO_START should
   trigger session to be started again. This way
   pause/resume becomes stop/start for AAC encoder.

Change-Id: Id44a5342bb90b049d9c617ede60bf41a5289c581
Signed-off-by: Sharad Sangle <assangle@codeaurora.org>

msm: soundrecorder: Add support for pause/resume in HW AAC mode

- Use "stopped" notification to indicate pause/resume. This avoids
  null pointer exception while playing a recently recorded file

Change-Id: Ie5782381e816f76c34677e5863c9849609089eba
Signed-off-by: quic_mqiu <quic_mqiu@codeaurora.org>

ASoC: msm: Add Buffer overflow check

The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.

Change-Id: I7d94a209c0b8818bfb9c65f8c13a5f5e36c49e2d
CRs-Fixed: 563086
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/audio_utils.c

ASoC: msm8974: Fix seek bar issue for WMA playback

Seek bar was not updated while wma playback is active.
Issue was that lsw and msw timestamp fields were wrongly
parsed before being sent to the user space.
Provide a fix for this by parsing the lsw and msw timestamp
correctly before being sent to userspace.

Change-Id: I118c7a8fe446d79981a7948ad78ad0fbe0b096af
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>

ASoC: Process reset events callback in cases of Q6 failure

At times when Q6 crashes, apss receive reset events notification.
Propagate reset events callback to the drivers to clean up the handles
and exit the session safely.

Change-Id: I1f9050c1ceff1ab4f971ad08059c666503917c4c
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/qdsp6v2/q6audio_v2_aio.c

ASoC: msm: Ignore unexpected events from dsp

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

CRs-fixed: 495205
Change-Id: I3051a90574b36061726c691672ec28fcc8976193
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>

ASoC: msm: remove event_abort and enabled flags from RESET_EVENTS callback

After ADSP SSR RESET_EVENTS is called if audio enabled flag is 0,
omx component cannot release resource properly. And when event_abort is 1,
OMX event handler is exited without releasing resources.

Change-Id: I03e883a7a7f6283d9778c0ec279622af59f4dd09
Signed-off-by: Fred Oh <fred@codeaurora.org>

msm: apr: Use correct LPASS name for SSR notification registration

Update APR SSR notification registration call to use correct LPASS
subsystem name for 8960 and 8974.

LPASS Subsystem uses "lpass" string for 8960 and "adsp" string for
8974 chipsets for SSR framework registration.

Fix adsp state checking in APR LPASS callback for after powerup
case.

Change-Id: I61112d3e60386254d47ff3051bf250a6b8d609f9
Signed-off-by: Ravishankar Sarawadi <crsaraw@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/include/mach/qdsp6v2/apr.h

msm: apr: Downgrade noisy informational prints from pr_info to pr_debug

Kernel logs frequently contain repetitive messages like the following,
which are not indications that anything has gone wrong. Quiet these
to decrease log noise and leave more room for error messages.

    <6>[  121.102540] apr_register: adsp Up
    <6>[  121.105663] apr_tal: SMD_EVENT_OPEN
    <6>[  121.108377] apr_register: adsp Up
    <6>[  121.122688] apr_register: adsp Up
    <6>[  121.131492] apr_register: adsp Up
    <6>[  126.775303] apr_register: adsp Up
    <6>[  126.778134] apr_tal: SMD_EVENT_OPEN
    <6>[  126.781267] apr_register: adsp Up
    <6>[  126.784916] apr_register: adsp Up

Change-Id: I9c3be65a1da547ead49b5f2b32820a047813c706
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Linux 3.4.95