Revert "base: genlock: allow synchronization with a single gralloc handle"

This reverts commit a909ebba3ec6eba893999b87db01095d6c37f704.

Conflicts:
	include/linux/genlock.h
msm-pcm-lpa: 8960: Issue EOS to DSP after playback is complete

Issue an EOS command to ensure that dsp is completely flushed
before closing the stream. This command is only issued if the
the routing is still enabled.

Change-Id: Id36f2b1a2e5e3fef5dcde759277f3ca4417c17e7
CRs-Fixed: 331532
Signed-off-by: Tejas Shikhare <tshikhar@codeaurora.org>
(cherry picked from commit 6fd0e00adcfe46b5b6a82d215e39a70e7b9af612)

Conflicts:
	sound/soc/msm/msm-pcm-lpa.c
	sound/soc/msm/msm-pcm-routing.c
	sound/soc/msm/msm-pcm-routing.h
ASoC: msm: Send a write done in paused state

Send a write done event as timer interrupt in paused state to
resolve the concurrency between between pausing and completion of
buffer

CRs-Fixed: 340469
Signed-off-by: Tejas Shikhare <tshikhar@codeaurora.org>
(cherry picked from commit 394dc966e3031f30c26403b879169f8ccec0f2f7)

Change-Id: Iaac0b70bda1b490cf2e79a99471ab0c2c3840d29
Signed-off-by: Yen-Pin Hsiao <yphsiao@codeaurora.org>
ASoC: msm: avoid routing setup on established path

During voice call, it was found that ADM COPP is left opened.
Since there is no music playback nor recording, ADM COPP should
not be opened. The problem is due to user-space application issue
mixer command again to join front-end and back-end when front-end
and back-end are already joined and active. PCM routing driver
just blindly create ADM COPP again as the condition of active
front-end and back-end is met. Update logic to avoid routing
setup twice.

CRs-fixed: 339027
Signed-off-by: Patrick Lai <plai@codeaurora.org>
(cherry picked from commit 6231458cedbfae1bb96f04046cf470b8ece42c6a)

Change-Id: I91a5e5bd2f60b245c837cb185f88c4fc75e456a9
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
ASoC: msm: Fix a bug in the audio FE check

It is found that recording from MI2S audio HW path
is broken. The reason is that the check to validate
the front-end ID is compared to wrong ID.

Update the comparson so that the correct front-end
ID is used.

CRs-Fixed: 339027
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
(cherry picked from commit 1bd26c67fb7b7579d02ae248b169be0218f08778)

Change-Id: Id6ff22184edd80807e193969df404826b5633460
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: audio: qdsp6v2: Fix noise issue while SSR

- When SSR is done, we hear an extra noise sound.
- During SSR, Q6 is stopped and AUDIOIF will send the
left over samples in DMA buffers continuously to codec
resulting in noise.
- Disable the active SND devices when SSR is initiated.
This will avoid any noise happening while SSR in progress.

CRs-Fixed: 333915
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 692c6543452fce8c2104b81cb03fe136e9b1a047)

Change-Id: Id4f63a2ac0f9a8150af23b8c3aa0d5c5935fce2a
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
ASoC: msm: Reset pcm irq position in WRITE_DONE event

Pcm irq position is incremented by one extra period size if
WRITE_DONE event is received during paused state as elapsed
is not called and as a result playback gets muted sometimes
Fix this mute issue by resetting the pcm irq position in
WRITE_DONE event instead of pointer operation

CRs-Fixed: 344436
(cherry picked from commit b52f007fe0be885e61ee37ab262b43b51c37a36f)

Change-Id: I7a0d2bc9d90ecb695651195eb4fe3b728caff402
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoc: msm: Improve error checking in code

Improve code by adding more error checking,
fixing case statments and removing unnecessary
logic.

Change-Id: Ic4d07f5dd9a7079248d8320fab95ee6f4d150b88
CRs-fixed: 344634
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Asoc: msm: Remove the condition check before sending FENS command

If FENS is disabled before starting voice call, FENS disable
command is not sent to CVD.
Remove the condition check, fens disable and enable command will
send to CVD when starting voice call.

Change-Id: I0cfa21db428cd9cc635442c34321f5482d3b3018
CRs-fixed: 349234
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6/q6voice.c
ASoC: msm8960: Decrease period and buffer size for LPA driver

Deacreasing the buffer size for LPA buffer helps to improve the
overall audio quality and latency related issues

CRs-Fixed: 344793
Signed-off-by: Tejas Shikhare <tshikhar@codeaurora.org>
(cherry picked from commit b08560da3b365be1990b3c6a11db50e521c06bc4)

Change-Id: I20a2d895e821520cdb9dfc365d7531ba1a359c9a
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
ASoC: msm: Provide linear DSP volume

To give the higher resolution, provide the linear DSP volume gain
instead of percentage through ALSA mixer control

Change-Id: I08e3e8194fab00e36398fc1fd8c2d2e7e0693975
CRs-Fixed: 351468
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
ASoc: msm: Fix error checking

Fix error checks to look at returned value
instead of passed variable. Updates copyrights
for files altered by previous patch.

Change-Id: Ice69e58bf33a1c451c1324ff0286f743d436d32f
CRs-fixed: 344634
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
ASoc: msm: Fix the kernel panic issue in dapm

- Widget list in dapm is getting corrupted during concurrent
use cases where dapm_power_widget is accessed from core,
machine driver, codec driver and soc-dsp. This corruption
is resulting in kernel crash in dapm.
- Fix the issue by adding protection in dapm_power_widgets
API.

CRs-fixed: 351250
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
(cherry picked from commit 247d36e2d8df019f77007c8eed30190b8dfaae6a)

Change-Id: Id486d1cea7f5f6edc94f71711035c0dba17512c2
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
ASoc: msm: Avoid memory allocation failure in proxy driver.

- Allocating memory using dma_alloc_coherent is resulting
failures due to fragmentation
- Fix the issue by replacing the API with
allocate_contiguous_ebi_nomap.

CRs-fixed: 358301
Change-Id: I726623d23c0080b7207911181590fa417c3e9886
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
(cherry picked from commit de48faf59a41bd47a360983407a27fd0fd3dbcc1)
ASoC: msm: Add VSS_IVOCPROC_CMD_SET_MUTE case in cvp callback

Add VSS_IVOCPROC_CMD_SET_MUTE case in cvp callback to
wake up the waiting for the response after sending rx
device mute to Q6.

Change-Id: Ib5041e68a70dd35218081ebae2da7ba8582238cb
CRs-Fixed: 352476
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
ASoC: msm: Fix mute issue in LPA

In event of an under-run, driver is not able to start again.
Memset the buffer to play silence while userspace recieves the
next set of data and copies it into the mmap buffer.

CRs-Fixed: 356297
CRs-Fixed: 359764
Signed-off-by: Tejas Shikhare <tshikhar@codeaurora.org>
(cherry picked from commit 0c2a7704c764371e63e27d1cbbcfe4646d7ea84f)

Change-Id: I3b01599753f3cbe5fa3f0711f08b90de63e00166
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
ASoC: qdsp6: Fix device crash issue in LPA seek

Accessing buffer pointer before initialization results in device crash.
To memset the buffer using physical address also results in a device crash.
Fixed this by initializing the buffer pointer before it is accessed and
memset the buffer using the virtual address.

CRs-fixed: 359764
Signed-off-by: Amal Paul <amal@codeaurora.org>
(cherry picked from commit 3e0c932acabfeafcef6d06abc801ba8507ccaa46)

Change-Id: I47296fc224d260fa7549afe4d2531af6123b07e6
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: Asoc: LPA: Fix pause and next clip play issue

- When paused and press next button to play next song,
sometimes CMD_EOS fails to get Ack from LPASS and
is wait timeout for 5sec causing delay for next
playback start.
- In the failure case, even before trigger start
of driver is done,LPA driver receives pcm_close.
In this case, though EOS is issued, it is not
getting honored from LPASS.
- If trigger start not happen in LPA driver,
avoid CMD_EOS to LPASS as it will not be handled.

CRs-Fixed: 368519 366926
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 9865826edb7125b2f5ca16b41894d90928a87885)

Change-Id: I206a9eeacef84c63ac8a47514d8e6ca31023767d
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

Conflicts:
	sound/soc/msm/msm-pcm-lpa.c
msm: rotator: Add pseudo-planar output for interleaved format.

Rotator gives pseudo-planar H2V1 output for interleaved
H2V1 input format.

Change-Id: I2a7af3243dfb1175ea14d6649b4cec87029fec38
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
(cherry picked from commit 732dcd668ffa9c2160fca0c34d21107be7a37cda)
msm_fb: display: decrease file->f_count when play

Frame buffer's (fb0) f_count needed to be decreased after both
overlay play and rotation so that fb0 can be closed and display
will be blanked out after system suspended.

CRs-fixed: 336254
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit beaa9356713db6949eefa32ed329bf87a3461842)

Change-Id: Ibaeb537bffedc473b6ce49531385aed3b791710d
Signed-off-by: Yen-Pin Hsiao <yphsiao@codeaurora.org>