merge N900P kitkat source
ASoC: msm: revert back
ASoC: msm: Do not allow commands during gapless transition

During gapless playback if flush is sent to the driver before EOS
acknowledgement from DSP, the playback is switched to stream one.
On EOS ack the stream one is closed resulting in no audio. The fix
is to not allow pause/resume/flush commands during transition from
one clip to other during gapless playback. Playback should move to
the second stream if the playback enters transition period.

Change-Id: I1be30956cce677e153ef5b8a362de303fec7620a
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: msm: Disable gapless offload playback by default

Add a flag to platform private data to enable/disable gapless
playback. The platform data is updated by mixer control.
If gapless playback is disabled ignore next track and handle
partial drain as full drain. The stream is opened in gapless
mode based on the paltform data.

Change-Id: I36cea976bcb53f50069653aec4f0f8cc869f491a
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: msm: Condition change to feed buffer on resume

Feed data to the DSP on a CMD_RUN ack by looking at the number
of bytes sent to the DSP and not the number of bytes consumed

Change-Id: I45a670d244e20dd1f444a92b86737b7541a7ccf0
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
ASoC: msm: qdsp6v2: Wait for stream to be available in gapless playback

Compressed driver operates on two streams in gapless mode and switches
between the two streams. If compressed playback operates on larger
buffers and the clip being played is small enough to fit in one
buffer, the driver could run into a scenario where three streams
need to be handled. Three streams results in no audio because stream
switching logic is corrupted. Fix is to block the next track call if
stream one has not completed playback.

CRs-Fixed: 594977
Change-Id: I6c83e859fa38f177ec7f4fa4ea92937d34df933a
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>