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: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
(cherry picked from commit d04445f5d1fa86d94e98918c2290fc79fdd9c6ad)

Change-Id: I155056aa63b1937163dda2b71ddc209fa3a1abed
Signed-off-by: Sivasri Kumar Vanka <sivasri@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
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
(cherry picked from commit 6171416a3068a6fa7032c2b7cc9637ac10d2a564)

Change-Id: Iab0132adf6b8bbe888fb344fe4d3ebb9a0bc5490
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
msm_serial_hs : handle uart_flush_buffer

Serial core allocates circular buffer for uart tx transfer.
Circular buffer head and tail is updated in serial core and
circular buffer tail is updated in uart driver.While uart
transfer is happening, uart client bluetooth hci_ldisc,calls
uart_flush_buffer in serial core and sets circular buffer
head and tail to zero.As uart driver does not know when
uart_flush_buffer is called in serial core by uart client,it
updates circular buffer tail for the previous ADM Tx completion.
This leads to queueing Tx command to ADM although no data is
there in circular buffer.Because of this,uart client is not
functional.

Hence adding msm_hs_flush_buffer api which notifies to uart driver
that uart_flush_buffer is called in serial core by uart client and
set tty_flush_receive flag to true.In uart interrupt handler ,do
not update circular buffer tail if uart_flush_buffer is already
called in serial core by uart client else update circular buffer
tail on ADM Tx completion.

CRs-Fixed: 419054
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
(cherry picked from commit ce39410ad3db5b9fb446bf5da126585d58fa872a)

Change-Id: I91feb551ee74b8d12993de045176e30d24859f8c
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
msm_serial_hs: Don't configure gpios into UART Mode always

UARTDM device is used as interface to connect external devices through
GPIOs. Currently those GPIOs are configured in active mode once driver's
probe() is called and configured in suspend mode once its remove() is
called. Probe() is called once only and remove is not called until UARTDM
platform device is removed. With this current implementation, although
external device (ex. Bluetooth SoC) is not operational mode, used UARTDM
GPIOs are configured in active mode which is causing more leakage current
and more power consumption.

Hence configure those UARTDM GPIOs in active mode only when used UARTDM
device is opened and under used. Configure UARTDM GPIOs back to suspend
mode when UARTDM device is closed and under not used.

CRs-Fixed: 422217
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
(cherry picked from commit 40836784d344c6e9def081f47a693488ed2d2857)

Change-Id: Iace76a2cc7ed4d23523ee744b2fb81598eaefada
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>

Conflicts:

	drivers/tty/serial/msm_serial_hs.c