ASoC: msm: fix RX3 MIX1 INP3 path setting

The path RX3 MIX1 INP3 is not functional as its setting a wrong
regiser.

CRs-Fixed: 631013
Change-Id: I1916a4c6e1b2399c146471ca7a20791c36e14962
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC: wcd9xxx: Distortion in HPH LO combo device

Follow Class H sequence for headset, lineout and ear concurrency as per
the class H HW design sequence to avoid signal clipping.

CRs-Fixed: 602408,618992
Change-Id: I517a5df98708f7292111e5cf71ffcf6ef8c4b870
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd9320: Avoid NULL pointer access

It is possible that taiko private data will
be accessed without creating memory when
sound card is not registered. Avoid kernel
crash by checking it for NULL and return without
access.

CRs-Fixed: 626673
Change-Id: I88523b352f251817697ac4c4fff82d750e5af618
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: wcd9xxx: Change in sequence of HPH Rx path

Change HPH Rx path sequence to enable Rx clock and reset Rx interpolator
path before HPH DACs enable to avoid pop during bringup of device path.

CRs-Fixed: 616383
Change-Id: If2beefc300e11908e87c90f0ab0fab0bfaf968b1
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd9xxx: HACK: Skip port timeout close check for MAD port

* Avoid spamming unnecessary warning.
* This code needs to be fixed such that the MAD port is tracked by the
  rest of the codec's port tracking code.

Change-Id: I09f89148e30d94e95340ba4c1a5c00f6e7842caa
ASoC: wcd9xxx: Set HPH PA register to volatile

Set HPH PA register to volatile to make sure the register will be
updated with proper bits during bringup.

CRs-Fixed: 625324
Change-Id: I8334a66644dca536f0bcfef562b7f64372a47d32
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd9xxx: Add INP2, INP3, INP4 for IIR paths

Add INP2, INP3, INP4 for IIR paths to provide client to use
any one of the four different paths for sidetone

CRs-Fixed: 612492
Change-Id: I6087487604edc249c1f2451cb0d9635399ec74ba
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd9xxx: Re-order codec DAIs definition

AIF3_PB and AIF3_CAP codec DAIs order and enum
definitions order are different. Reorder DAI
definitions to match with enum definitions

Change-Id: I0d16355b1b0997177e138c4fcf669365dc942baa
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
ASoC: wcd9320: Change compander parameter for 192Khz playback

Update the meter rate parameter for compander in order to achieve
better performance with Compander support for headphone, lineout
and speaker paths for 192 KHz sampling rate. Update the static gain
offset accordingly depending on the buck voltage requested.

CRs-fixed: 481501
Change-Id: I4bb3c41e1042ba9327a21bf9375541d36487484e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: wcd93xx: Remove deadlock for ANC use-cases

When calling snd_soc_dapm_sync(), it eventually tries to
lock the same mutex already locked for ANC widgets and a
deadlock occurs. By moving the mutex unlock to just before
snd_soc_dapm_sync(), this deadlock is prevented.
This problem was introduced in Linux 3.5.

Reference commit: 2894770ec17ff732f911c8495ae0504f06a5dad5
for sound/soc/codecs/tlv320aic3x.c

Change-Id: Ic52d94d0097e79c085fcca2770274d48042b53b6
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: Fix the sync problem after SSR

After SSR default registers needs to be restored. Then
we need to sync all the registers with cache values. This
fixes the problem where register values got changed
after SSR causing AAC clip playback failure.

CRs-Fixed: 579574
Change-Id: Ibb99d69425dcb16ba09cfb131b5059f666f75012
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: wcd9320: Change compander parameter for 192Khz playback

Update the meter rate parameter for compander in order to achieve
better performance with Compander support for headphone, lineout
and speaker paths for 192 KHz sampling rate. Update the static gain
offset accordingly depending on the buck voltage requested.

CRs-fixed: 481501
Change-Id: I4bb3c41e1042ba9327a21bf9375541d36487484e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: wcd9xxx: Cancel headset detect work while in IRQ handler

When the headset is inserted and removed with in no time, removal
interrupt handling is missed.

The reason behind missing the removal interrupt is for the insertion
interrupt a work queue is scheduled to detect the event type
there is latency in scheduling the work queue as a result the
removal IRQ followed is missed to process but the UI is not
notified about the IRQ miss and UI still thinks the headset is
connected.

Cancel the hs detect work queue as soon as entered the IRQ
and do not wait to cancel the work queue until the insertion or
removal event is detected

CRs-Fixed: 552760
Change-Id: I5c5fd8c55cca6a7137c389c19843c5178c8c9be8
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
ASoC: wcd9320: Fix for audio recording

If multiple mixer widgtes share the same kcontrol,ASoC framework
will create common controls. For audio capture usecase we need
each AIF cap mixer widget to have its own control.
Change creates control for each of the AIF capture mixer widgets.

Change-Id: Id178c7154cd50c21fa8b6715c16e6db950ba1d4c
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: wcd9320: release codec mutex before calling dapm function

DAPM calls will internally acquire soc_card class locks for its
operations. Therefore, release codec->mutex before calling into
snd_soc_dapm_mux_update_power and snd_soc_dapm_mixer_update_power.
This will help avoid deadlock inside those functions.

CRs-fixed: 612080
Change-Id: I6bb943389240b67e1847bc533ac56fdd20799bce
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoC: wcd9320: remove runtime PM voting

All the codec reads/writes go through slimbus satellite driver on APPS.
Slimbus satellite driver is already voting for slimbus clock before any
codec read or write so remove the vote from codec driver

Change-Id: If54f33739ff82b9388fa9417ef0f6152a4cddeea
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>