Backported lowmemorykiller from 3.4 kernel
did a litle DERPgit rm -f mm/lowmemorykiller.cgit rm -f mm/lowmemorykiller.c
Backport adsp_video_verify from .38 kernel

Conflicts:

	arch/arm/mach-msm/qdsp5/adsp_video_verify_cmd.c
qdsp5: audio: Set audio stopped flag before calling wakeup

During audio flush and stop command processing, wakeup on read
and write wait queue is done first and then audio stopped flag
is set to true. If a process waiting on read and write queue gets
scheduled first before stopped flag is set then this may result in
read or write command being sent to DSP after adsp disable operation,
which is unexpected.

Fix this by setting stopped flag before calling wakeup.

Change-Id: I20ef197e572d0ffc015d6004296ea7b9f5db2806
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/audio_aac_in.c
	arch/arm/mach-msm/qdsp5/audio_evrc_in.c
	arch/arm/mach-msm/qdsp5/audio_pcm_in.c
	arch/arm/mach-msm/qdsp5/audio_qcelp_in.c
qdsp5: audio: Protect common data between ADSP ISR and flush operation

During NEEDS_DATA or BUFFER_UPDATE event processing in ISR
context, if flush command is issued by application then
there is chance of concurrent access of some of the variables
shared between ISR and Process context. This may result in race
condition causing values of these shared variables to be
inconsistent.

Fix this by protecting these variables using spin lock. Also corrected
locking sequence order in encode drivers.

Change-Id: I06b4d08053ad13d1b118ab6f29e69e95b49d133f
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/audio_aac.c
	arch/arm/mach-msm/qdsp5/audio_aac_in.c
	arch/arm/mach-msm/qdsp5/audio_amrnb.c
	arch/arm/mach-msm/qdsp5/audio_amrwb.c
	arch/arm/mach-msm/qdsp5/audio_evrc.c
	arch/arm/mach-msm/qdsp5/audio_evrc_in.c
	arch/arm/mach-msm/qdsp5/audio_mp3.c
	arch/arm/mach-msm/qdsp5/audio_pcm.c
	arch/arm/mach-msm/qdsp5/audio_qcelp.c
	arch/arm/mach-msm/qdsp5/audio_qcelp_in.c
	arch/arm/mach-msm/qdsp5/audio_wma.c
	arch/arm/mach-msm/qdsp5/audio_wmapro.c
msm: qdsp5: Avoid race condition of init info cmd being sent multiple times

GET_INIT_INFO command is sent to modem adsp service to get the information
such as task/queues supported by adsp. This command is sent whenever
msm_adsp_get() is called first time by any decoder/encoder drivers. This
command needs to be sent only once, to achieve this a global flag
init_info_cmd_sent is set in msm_get_adsp() after sending GET_INIT_INFO
command to adsp services. Currently flag init_info_cmd_sent is not
protected by any lock. Hence there is chance of GET_INIT_INFO command
being sent multiple times if there are concurrent calls to msm_adsp_get()
where each caller observes flag init_info_cmd_sent not to be set.

Fix this by protecting adsp info initialization sequence with mutex.

Change-Id: Ib0bd865d44e4687f9a85b56854e1fd3277a5707d
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
qdsp5: adsp: Add NULL check in adsp driver functions

ADSP driver functions are directly accessing module without checking
for NULL. This can result in crash if module supplied points to NULL.

Added NULL check to solve this.

Change-Id: I47eef0ea03086935ebfe33a2585ba214780e73f7
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
msm: qdsp5: Initialize event length during adsp fake event generation

During adsp fake event generation, event length is not getting
initialized. This sometimes results in incorrect event data being read
during fake event processing by adsp driver clients.

Fix this by initializing event length properly before generating the
fake event.

Change-Id: Ifcab5adf542b04eef3dc03913b8e10c68f686e8c
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
msm: adsp: qdsp5: Add debugfs to dump read/write commands from/to DSP.

Debugfs tool to get commands to/from DSP printed in logs.

Change-Id: I48748854b69b55cbf2e8fbf9fbdd50e8fe4ce8b5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: adsp: qdsp5: protect the debugfs code by check of CONFIG_DEBUG_FS.

With CONFIG_DEBUG_FS off,fix compile error.

Change-Id: I4ef4357ca72d24a81d2f8634e32841606c59a995
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: snd: Add updated RPC version number for unicorn

SND RPC has been updated to major version to support new
SND device nodes for FM playback on unicorn. Hence add
support for new SND RPC version

Change-Id: Ibfdbeb033a2be20c76a662a0b847c7e041521a75
Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>
msm: adsp: qdsp5: update debugfs to print complete buffer for 16/32-bit q's

type of pointers to read cmd,msg buffers is changed
from uint32* to unint16* to print all the buffer data.

Change-Id: I4e52040a202e0ea7b174f63d509de331289173a4
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
update
Revert "update"

This reverts commit 76d37485e3939deb8233a7952d422767a73fe4f7.
msm: audio: voicepcm: Added snd pcm client driver

Added support for snd pcm client driver. Which
provides interface to write pcm samples to voice path.

Change-Id: I2bb9a5631c195fc047dde0dc209a6fff24014d0b
Signed-off-by: Rajesha Kini <rkini@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/Makefile
msm: audio: qdsp5: Update snd stop callback id to match modem

-Snd pcm session is not getting terminated properly as apps snd pcm
 stop callback id doesn't match with modem side stop call back id.

-Updated apps snd pcm stop callback id to match with  modem.

Signed-off-by: Manish Dewangan <manish@codeaurora.org>
msm: adsp: qdsp5: Add support to crash dump.

Debugfs method to collect DSP Dumps is added.
Use the DSP addresses and copy the MEMA/B/C
to userspace buffer which dumps to sdcard.

Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm: adsp: Changes for Co-located buffers patching.

Generalize the address patching of the H264 co-locate
motion vector buffers.

Change-Id: I5dfa71f0cac857fdab6c63bf0a59e4c0e24df76f
Signed-off-by: Saikumar Kondaparthi <saikumar@codeaurora.org>
Port Vocpcm Module (R7): support voice in-call recording

source : http://code.google.com/p/2-way-call-recording/source/browse/#svn%2Fpatches

Change-Id: I089d6139ac62b5047afbfb26ce503f864ee9c88b

Conflicts:

	arch/arm/mach-msm/qdsp5/Makefile
msm: adsp: qdsp5: fix conflicts

Change-Id: Ib3f10441a52b7496ad88dc98f57dd5020089ec55
Signed-off-by: RonGokhale <cips173@gmail.com>