ASoC: msm: Handle data loss at device switch for FM

- When device switch happens there are underflow errors
in LPASS. And there is some break in audio observed for
around 2 sec.
- To handle this, ASM run command needs to be sent again
to DSP at device switch.

Change-Id: I26135ad9267ec5c018708b780b86b7cb4998aa0a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: msm: Support independent left-right channel volume control

The current volume sent to DSP is averaged between left and
right channels. As a result with volume level as zero on one
channel and non zero on the other channel results to playback on
both channels. Add support to send left and right volumes to DSP

Change-Id: Icc5f182d138c841607ea356ec37a7f78b4ba770d
CRs-Fixed: 449284
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
ASoC: msm8930: properly protect external mclk control function

Both audio path and MBHC accessory detection logic need master clock
enabled along with bandgap and clock block of CODEC. Clock control
is managed by the machine driver. Calls to clock control function from
audio and MBHC detection paths can be nested. As a result, reference
counter of master clock is incremen/decrement out of order and cause
master clock not enabled when audio path is enabled. Without master clock
CODEC will not consume data and this leads to SLIMBUS overflow error.

CRs-Fixed: 469683
Change-Id: Ib3a55f5d0b36ebe9ba345e7f18162a9314500df2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
ASoC: WCD9304: Add the compander support to wcd9304

The compander system is intended to increase the dynamic
range of an input signal. But for the wcd9304 codec,
this feature is to use companding in a novel way in the DAC
converter path to increase the signal noise ratio.
The change is to add the compander support to wcd9304
codec. The dynamic compander enable/disable during stream
playback is not supported.

Change-Id: If912302ee9d48dde1318e894a982cba591908d8f
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: msm: qdsp6: Add error check for memory commands

- Write failures observed during audio playback.
- Error checks are missing for memory map and memory unmap cmds,
  we are proceeding to write data even if memory map is failed. Due
  to this pcm_out_write failures are observed.
- Add proper error handling for memory map and unmap cmds.

CRs-Fixed: 485051
Change-Id: Iedd369fcd655b02a213277e973059612c040fe34
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6/q6asm.c
ASoC: msm: qdsp6: Fix for EVRC-B/WB vocoder rate

Rate set in userspace for EVRC-B/WB vocoders are not
propagated to DSP. Fix the issue by sending rate command to DSP

Change-Id: I478f4afafac25dcb4b23964db24598205f9bcc05
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
CRs-Fixed: 488084
ASoc: msm: Fix for pcm_read getting struck in alsa core.

Advance hardware pointer by period size even if the packet
coming from qdsp6 is of less size. QDSP6 sometimes
(for rapid device switches) gives packets worth less
than period size and this results in hw_ptr appl_ptr mismatch.

CRs-Fixed: 486276
CRs-Fixed: 488449
Change-Id: I893f9a52e4cd507fd72e4a7aba3c5fa76527d1bf
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
ASoC: wcd9310: Fix to reduce the delay while recording

The current delay of 250ms is too long and can impact
several usecases which involve TX path. Reduce the delay
to 20ms as it is safe to do so. This delay was added to
ensure low voltage for a while before turning on micbias
for recording. Reason being, few headsets need voltage to
be ramped up from 0V to micbias to enable microphone.

CRs-Fixed: 486830
Change-Id: I6becfde379403115a77492754bae26c2fd1ba9cb
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
ASoC: msm: Fix wrong wait_event_timeout timeout checks

wait_event_timeout returns zero when there is a timeout.
Change fixes the condition check to handle timeouts.

Change-Id: I01184cce0c98a82bb205023b07dd4dd2d91b42ad
CRs-Fixed: 487821
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC:msm: Enabling TTY for VoLTE call

Enabled TTY for VoLTE call. Earlier TTY feature is not
supported for VoLTE call.

Change-Id: If5e3436504f40c3e782bf79a16547be068f6b27e
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>