ASoc: msm: Update platform drivers to correctly access audio_client

Update platform driver open function call to access
audio_client pointer only after allocation to avoid crash.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
ASoC: msm: Add support timestamp update VCAP playback usecase.

Compressed data in HDMI IN or VCAP usecase is propagated with
timestamp from DSP with each buffer. For playback, the same or
interpolated timestamp is updated with the corresponding buffer.
DSP will render the buffer a) without any delay if timestamp mode is
synchronous to absolute timestamp b) with a delay if timestamp is more
than the absolute timestamp c) drop the buffer if the timestamp is
less than the absolute timestamp. Add support for the same.

Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
(cherry picked from commit aa1f5e51dbc251dc758a1f762802d87d4f2128b7)
(cherry picked from commit cb209b8f0bddcedaf26a181f20de696e4ad729bc)

Change-Id: I5b7b2cb405f72ea9afa4751c6a92cde09f40d69c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: Updated the period size of Multichannel driver.

Upadate the multichannel driver period size to accomodate the
8 channels with 1536 bytes for each channel in HDMI IN use case.
Update the channels of wma according to the structure populated
by the HAL

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit 572d504a7a57d521bd5a823a3bb8a443ac34842a)
(cherry picked from commit a955dd94918bc4241d28053d8f6587b1c055238a)

Change-Id: Id043cbf07ff1b8a80ac0961ddeff0c1d3ff1283b
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: Default format for the compressed driver as LPCM.

Setting the LPCM as default format for the compressed driver.
It is needed for the HDMI IN compressed use case, where we are
not aware of the format beforehand

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(Cherry picked from commit 7e259d841857f06951c41c1159e95bb4b343602f)

Conflicts:

	sound/soc/msm/msm-compr-q6.c

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 390ef43a8103c52273614e09ed1e5e8ceab97f04)

Change-Id: I2d380e97e3225e1b6cb3250d10ca016f8fcc4b1e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: Remove the check to break when the app not ready with data.

When the Application pointer is same as hardware pointer, the dequeing
from DSP chain will be broken to start the session again there should
be trigger called explicitly from the user space, to avoid resending
the trigger command from the user space.

Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
(cherry picked from commit 5bb19ee2b22ca42e708da052517853496fc5b98d)
(cherry picked from commit d5d591f945b25b82a7177a6b466387fbc9b1bf93)

Change-Id: I42bb47de76e3f9368188161b5a1a71734fec3b6e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: Modify default buffer params of compressed driver

There can be a use case where HAL may request for
Smaller period size and corresponding buffer size for
A session, update compressed driver default period size
And buffer size based on the userspace configuration

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit d4e62aeb8839cf9accf2356568a14adb8d24152f)
(cherry picked from commit 462a09e10e32afb49ca50bdbfb8c4a4e13cc068a)

Change-Id: Id1aef6c71c5c71b269b6607816f7c3e5c4fd4314
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC : msm: HDMI 5.1 LPCM playback support.

Support 6 channels configuration in HDMI driver
and the ALSA framework to play 5.1 LPCM format

CRs-Fixed: 370096
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit fc3b780b571b62f302fe38c9faaa58508ad5464f)
(cherry picked from commit 7fd4b7af623ac3dfef0b23d4e68758b1a65941d6)

Change-Id: I091cd3187e9c68eb2589c9b3412b1d8a7bb59164
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: implement drain command in compress platform driver

Currently, at the end of compress audio playback, session is
terminated without ensuring compressed audio stream is completely
rendered. Use ioctl drain to drain out all the data before EOS is
signalled and session is closed. This is to make sure all the
data is played out by DSP.

CRs-Fixed: 390897
Change-Id: I3e39b210a8924180de9eb4453c6f6f6435ded0ee
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoc: msm: Add amr-wb/wb+ tunnel playback support

Update compress audio platform driver
to support amr-wb/wb+ tunnel mode playback.

Change-Id: I98d087db490441c57c8e2d4fe03a7e91b28e67fc
Signed-off-by: Ajit Khare <ajitk@codeaurora.org>
ASoC: msm: Register restart api for under run issue.

Update compressed platform driver to register an restart callback.
Implementation of the restart callback is to issue an pending buffer
Written by application to restart the session when  the de queue
Process is stopped due to underrun issue.

Restart callback is triggered from the ALSA core framework when
Framework detects that the render stopped pulling the data
And application is writtig the data.

This callback will be running in atomic context.

Change-Id: Iada382f39bd052beeb0b1d165959d510fa51ff7c
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
ASoC: msm: Fixes for underrun issue in LPA Playback

Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.
The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.

Fixes:
-A disturbance was heard when switching from one song
to the other, or when the song is paused for greater
than 3 seconds and then resumed
-This was due to the previous value of the track
volume being used in the lpa driver
-This was fixed by setting 0 as the initial volume

Change-Id: I035760937d032038fb3f3383dc87ecbdc5f4700d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>