ASoC: wcd9xxx: Don't change button threshold registers

If registers which effect button detection are changed
when mbhc is still in recovering state, sometimes release
interrupt is not getting triggered.So don't modify registers
which effect button detection.

CRs-Fixed: 576855
Change-Id: I307ea4a112d81fecfe23eb58733913b4453284cd
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
ASoC: msm: Fix HW Delay print

HW delay print allows a possible NULL pointer dereference.
Move print to location that does not allow NULL dereference.

Change-Id: If99531d4b59d1ff78be43ad85e7b5e870798a0ed
CRs-Fixed: 582529
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
ASoC: msm: Add support for RTAC version 1.1

Add support for RTAC v1.1 which includes POPP topology.
To support backwards compatibility an ADM RTAC v1.0
structure is created as well as a 1.1.

Change-Id: Ia87109263f4176534043d6eaceddd24f9f83cfec
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
ASoC: msm8x10-wcd: Fix bug in DMIC configuration

For TX MUX inputs, either ADCs or DMICs can be selected depending on the
selection from application. Fix the bug in current code where input to
TX MUX is always selected as ADC, due to which DMIC is not functional.

CRs-fixed: 585675
Change-Id: Ib1db353f90ee09764621009ed6e446d15c238f97
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: msm8x10: Add digital MIC widgets

Add the digital MIC widgets for msm8x10 to add the DMIC
support for the platform.

CRs-fixed: 585675
Change-Id: Ib01da8ee6a39aa68b02d1e996899aff938d21ab8
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: msm: Add support for ASM loopback

Add ASM loopback driver. When audio path wants to use filters in DSP,
it will do a loopback in ASM.  The new ASM loopback driver enables
the loopback.

Change-Id: I3ddfbf0a1be5b3b1d37b47b44d321ea7da93da83
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
ASoC: msm: Fix for incall music delivery on VoLTE

Add support for incall music delivery on VoLTE.
VoLTE session will use the same pseudo port ID
as the voice session, so for port 8005 we start
playback on both voice and VoLTE session.

CRs-fixed: 583740
Change-Id: I20e03ab27287807f0afcc432269673b7ef5dbda0
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
ASoC: msm: flush if prior and current backends rate not matching

It is found that during device switch from one backend
with one sample rate to another backend with another sample rate
the command to QDSP6 ADM which maps audio stream session to a
particular backend would not get carried out until pending
data of audio stream session from previous backend is either
read out or flushed. This scenario occurs when application
stops providing more buffers to retrieve captured data.
Remedy is to flush upon detection of rate mismatching.

Change-Id: Ia9d9a1819c6e21a44f2778185420ca43cca30258
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
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: Ie75dbb1fede4fc88cf827795a176891501202abe
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
ASoC: msm: Add MM6 routing

Add MM6 routing commands. This will enable to route
data through ASM loopback through MM6. MM6 will be
used to make the connections for the asm loopback.

Change-Id: Ia59a174d4250d9c0946c78e86dd868853f026657
Signed-off-by: Damir Didjusto <damird@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
ASoC: msm: Add routing for HFP using AFE and ASM Loopback

HFP hostless driver is used to loopback BT data into
SLIM_0_RX. And asm loopback MM6 is used for looping
data from mic to BT so that pre_proc effects can be
added.

Change-Id: Ic818b91c545a4d17043ecdf933d6d3398ad591d3
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
ASoC: msm8974: Add support for HFP

Add support for HFP for 8974 target.
Front end dai for HFP hostless for RX and MM6 for TX for HFP

Change-Id: I0406bd2b10c3daab4d583c690f27a9ba1d09af60
Signed-off-by: Vimal Puthanveed <vimalp@codeaurora.org>
ASoC: msm8226: Enable tunnel amr wb recording

Add dai-link for tunnel amr wb recording. Multimedia 8 is the
front used for tunnel recording.

Change-Id: I044e61c815c7c764a23a33c81649a9ddb37720b1
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: wcd9320: Prevent calling PA event unnecessarily during ANC

When Headphone ANC is enabled, do not call the headphone PA event
in pre-power down case, only in post-power down.
Headphone PA event will only process this call in post-power
down case.

Change-Id: I61ba96ae038c2e0aa4dc3d01048f33e6a5e97d86
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: wcd9xxx: Notify mbhc when TX1/IN1 path is enabled

Notification is sent to mbhc whenever TX1/IN1 path is used
for audio capture. MBHC then will switch to VDDIO if headset
is inserted. This is to avoid polling noise that gets captured
in the recorded audio due to noise coupling in hardware b/w
TX2 and TX1 paths.

Change-Id: Iac40f41572d1417d2afdc55438d86c047710824f
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: msm: Update the name for pcm platform driver.

Update the name of pcm platform driver to match with device tree
node.

Change-Id: I37063c7b6aa2a04b31f86754b24f9aa046d4c4a9
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
ASoC: msm8974: Add voice2 dai-link

Add voice2 dai-link to enable DSDS on msm8974 platform.

CRs-fixed: 587066
Change-Id: Ia057890525e51f4ef0344b04ccabbb1f265d1dc3
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
ASoC: wcd9xxx :Modify detection of Euro Headset

Detect the cable as EU Headset only if below conditions met.
1.Plug types for 1st, 2nd, 4th are consistent and equal to HEADSET.
2.Delta b/w 1st, 2nd, 4th is not more than WCD9XXX_CS_MEAS_DELTA_MAX_MV.
3.Plug type of the 3rd measurement is HEADPHONE.
4.Don't consider the status of HPHL.

Change-Id: Iee5f05a360599295e75496bec87b595709ba5a6c
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
msm:qdsp6v2: Check null pointer on userspace data argument in kernel

The null pointer check is required to ensure that userspace data
in kernalspace is not null.

Change-Id: I9e522c393ae643626a4bae03731a73f5d6db6458
CRs-Fixed: 563752
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC: msm: 8x10: Fix button detection voltage thresholds

Adjust button detection thresholds to improve button
detection as button ranges should  be scaled in sync
to the recent changes for using 2.7V for micbias.

CRs-Fixed: 587697
Change-Id: Ibfa5bb87e08f434410b23b74ed2fa0af018efc5e
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>