kernel/msm: 8974: Audio ocmem driver changes to use bus dt APIs

Populate bus vectors for the audio ocmem driver with use of new
bus device tree APIs.

Change-Id: If965c269706763a3a67b22243f265429f23427d6
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
ASoC: apq8064: Fix button detection voltage thresholds

Recent measurements indicate that the button threshold voltages
have changed. Adjust the button voltages accordingly

CRs-fixed: 432596
Change-Id: Ibee4db3b9c76df1d464dcad443f0f90d24751ee3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
ASoC: WCD9304: Fix deadlock in mutex while HS insert

-While music playback is done and PCM close sequence
is in progress, if headset is inserted this will report
headset insert to snd_soc_jack_report. But it will get
stuck here waiting for lock that is already acquired by
DAPM at PCM stream close snd_soc_dapm_stream_event.
-Change the function call used to report insert/removal
from snd_soc_jack_report to snd_soc_jack_report_no_dapm
that fixes this deadlock.

CRs-Fixed: 429766
Change-Id: I167e45bdce9790ff7e878528629c4d652029bf26
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
ASoC: wcd9304: avoid decrementing active channel count if already zero

During error cases, there might be situation, when slimbus channels
are being closed even when the number of active channels for
that DAI is 0. Avoid decrementing ch_act field if it is already 0.

Change-Id: Ie988eb049a20fc7cf5725ddc183ee1ae5fcb758d
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
ASoC: wcd9xxx: Fix the ANC CnP

Add virtual ANC widgets which are used to enable ANC
before PA is turned on, and to disable ANC before TX is
turned off.

CRs-fixed: 387904
Change-Id: I8c2fa670062f1486499c79653a2c223f7daba84f
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
msm: Add support for amr-wb+ non-tunnel driver

-Non tunnel playback is use case where compressed
 data is sent to driver(for decoding) and
 caller expects PCM data back from the driver.
-Add non-tunnel driver for amr-wb+.
-Add support for amr-wb+ in asm driver

Change-Id: I266e70dff0466a20b0435da840a31a8a1774cf35
Signed-off-by: Ajit Khare <ajitk@codeaurora.org>
ASoC: wcd9310: Correct the mixer controls for Compander switches

- Compander1 never gets enabled though the user space sets the
  corresponding mixer control.
- Compander switch kcontrols are configured wrongly as integer
  type with max value as 0.
- Correct kcontrol creation to fix the issue.

CRs-Fixed: 441091

Change-Id: Iad99b44c9226da3bcc1132e61ea989a0543ae56e
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: msm: Fix delay in switching from WFD session

- When a running WFD session is paused/disconnected, there is
  a delay of about 10-15 seconds in switching audio from WFD
  sink to target.
- pcm_write is blocked because pausing/disconnecting the WFD
  session closes the backend DAI before a new link is established.
- Avoid closing afe if front end PCM session is still active.

CRs-Fixed: 444163
CRs-Fixed: 425512
Change-Id: I1ad6de1e201aa6130c397007219c0d370c7be2a1
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
ASoC: wcd9310: Update wcd9310 compander configuration

Update the Compander register settings to remain the default
settings after the system bootup and optimize compander
configuration sequence.

Change-Id: Ib475f3bb84414546b4ead1d3f013dc173317e1b3
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: msm: Fix for proxy port open failure in WFD session

When playback is paused and proxy device disabled, afe is
not closed. This results in failure of proxy port open in the second
iteration. Fix the same by closing and opening the proxy.

Change-Id: Idfa94e5756d87e59dc0101fd688d6accfe6287e7
CRs-Fixed: 447001
CRs-Fixed: 446504
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
ASoC: wcd9xxx: Support earpiece ANC

Added virtual widgets for enabling and disabling earpiece ANC.

Change-Id: Ia235928c34022de89ec0e66dbe533143f4d56684
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: WCD9304: Fix threshold value for class G headphone

When playing a full scale tone with highest gain in the codec, OCP
(Over Current Protection) event is generated. This is caused due to
lower switching frequency for the class G amplifier on headphone
path. Fix the false OCP event trigger by appropriately setting the
class G switching frequency

CRs-fixed: 415990
Change-Id: I9563ab2d06c970b47693293175fe7ae4a711348c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
ASoC: wcd9304: Turn off mclk during clock transition

The clock is not usable when either the clock source changes between
external MCLK and internal RCO or the bandgap mode changes to fast mode.
In such cases, turn off master clock and turn on again later to avoid
codec from going into bad state

CRs-fixed: 442464
Change-Id: Id8d07bbbd4bf6c7be16016800d19ab332b960d1a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: WCD9310: Enable codec loopback support through IIR2 path

WCD9310 codec supports loopback through IIR filters. Either IIR1
or IIR2 can be used to setup loopback path. Add support and routing
to enable loopback through IIR2 filter path

CRs-fixed: 364236
Change-Id: I52cb455ad31aa129f81bac3852ac50d4a5a99bc2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
(cherry picked from commit 8ba4446a571ed5f7033dc6cb651e19f5d9485abb)
ASoC: audio: fix unlock Null pointer issue

-In afe_open, trying to unlock mutex on variable
that is already freed.
-correct the sequence by unlock mutex first then
free the variable.

CRs-Fixed: 423196
Change-Id: If7df0e0f46c7d16843c6d52ae821974cc74539ff
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 4c120ae85c6c5ac2adfdf61956b45d02461a93e3)
ASoc: msm: Remove incorrect headset mic gpios

AV switch and US Euro headset switches are not supported
on apq8064 target. Hence removing unnecessary gpio pins
configuration.

Change-Id: Ia4747b59b63b0bf7c37054fb1bcebfc54079b481
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	sound/soc/msm/apq8064.c

Conflicts:
	sound/soc/msm/apq8064.c
ASoC: msm: qdsp6: Add support to configure ISO and ARIB coefficients

Add support for configuring ISO or ARIB stereo mixing
coefficients. This change introduces a function with whichi,
AAC multi-channel driver can configure ISO or ARIB coefficients
according to configuration done by the client.

Change-Id: I72b74033532a276fa3bc1d305a04720ff6767409
Signed-off-by: Amal Paul <amal@codeaurora.org>

Conflicts:
	include/sound/apr_audio.h
ASoC: wcd9310: Reset OTHR_RESET_CTR before power down

There is a missing step to clear OTHR_RESET_CTR before power down.
It could cause a glitch and power hit without it. It has to be reset.

original gerrit is https://review-android.quicinc.com/#/c/191312/
This is cherry-pick gerrit by developer to jb_2.5

Change-Id: Id96070352480be6ea412844d4f71765e2df76afe
CRs-fixed: 420142
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm: Set the minimum channels to 2 for HDMI.

The minimum channel number supported by HDMI is 2.
Set the channel to STEREO if the channel is MONO in
fixup function.

CRs-fixed: 384324
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
(cherry picked from commit 12123a1c21b2e9beb469e66cc66d7b5cdd13eb2a)
(cherry picked from commit cc72e236484f1fee01ecd9a6bdf06d7bc690dc9b)

Change-Id: I153e1e0fc73523b3a1e229bd6c8eff2b8ac6e8c1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
apq8064: Add support for hdmi multichannel

Provide support for hdmi channel fixup.
Fix channel map order to WAV format.

BUG-ID: 7156174
Signed-off-by: SathishKumar Mani <smani@codeaurora.org>

Conflicts:
	sound/soc/msm/apq8064.c
	sound/soc/msm/qdsp6/q6asm.c