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: qdsp6v2: Update log message priority to debug

Update log message priority to debug to avoid excessive logging
when hardware delay entries are not found in acdb.

Change-Id: I88210d5f228b6221a11a591e3b4200e95146f972
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>
ASoC: msm: qdsp6v2: Add support for EVRCNW format

Add changes to support VoIP call with EVRCNW audio format.

Change-Id: Iaaedbc6434cee4a59bf22c265bfe463df55a19fd
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: qdsp6v2: Add support to configure min and max rates

Add support to configure min and max frame rates for EVRC/EVRCB/
EVRCWB/EVRCNW codecs. This change is needed to support variable
length frames for VoIP calls.

Change-Id: Id17dd645b17b1b8c1dc21afcf20dbc7e2c9c0d30
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: qdsp6v2: Add support for non-pcm VoIP formats

This change is needed to support non-pcm vocoder formats
for VoIP call.

Change-Id: If69d52450816a0f438de1fa17d6382b1e0fb9247
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: Add few more Dolby endpoint dependent paramters

While turning Dolby effecrs on and off from its UI app, volume of
levels vary and difference is observed. Dolby requires few more
paramters to be sent based on endpoints for proper tuning.

CRs-Fixed: 503579
Change-Id: Ibae16d417d4df53eb2bf27475ed24fa409af3861
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
ASoC: msm: update endpoint based DAP table for REMOTE_SUBMIX

Update endpoint parameters table for REMOTE_SUBMIX and FM
endpoints used for Miracast devices in DAP driver.

Change-Id: I9bda1d884f93c131149b3cae0f22a0113020d6e7
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
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: Correct the EC reference RX port id for 0x1001

The EC reference RX port id that is being used for
PRIMARY_MI2S_TX is not correct and is set to 0 currently.
Set this to proper RX port id of 0x1000.

Change-Id: Id7a88076f06816adcb50e9cee0b83da10393883f
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
diag: dci: Safeguard to prevent Integer Underflow and Memory Leak

At certain point in diag driver there can be integer underflow
thus can lead to memory leak. Added a safeguard for that.

Change-Id: I2a0304f5b9888fe12ca9ef5fbaa9a68ee4ab9c15
Crs-fixed: 556860
Signed-off-by: Katish Paran <kparan@codeaurora.org>
misc: isa1200: Change mutex for isa1200 vibrator

Change i2c client device mutex to local driver mutex
for isa1200 vibrator which is used while enabling and
disabling the clock.

CRs-Fixed: 545512
Change-Id: I4f61c629c503c658410b5c14da2e1612b82ec201
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
ASoC: wcd9320: Add support for notification of codec events

Add Support for machine driver to register for codec event. Machine
driver needs do one time ADSP AFE configuration after codec
initialization after ADSP SSR. So add support for machine driver to
register for codec initialization event.

CRs-Fixed: 487983
Change-Id: I3e4a392659ae8c88d845f5337760fda3af94a117
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>

Conflicts:

	sound/soc/codecs/wcd9320.h

Signed-off-by: Ajay Dudani <adudani@codeaurora.org>

Conflicts:
	sound/soc/codecs/wcd9320.h
gcc 4.7 cleanups

Fix warnings due to -Wmaybe-uninitialized in GCC 4.7.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
ASoC: msm8x10-wcd: Add the internal bias for mic1

Add codec internal bias for mic1
in order for compatible hardware mic design

Change-Id: Ie90d449fd629ebe034673df49c4e2cd0917c8ada
Signed-off-by: Walter Yang <quic_yandongy@codeaurora.org>
ASoC: wcd9xxx: don't wait for mic volage to settle

When electrical mbhc runs removal irq shouldn't run mic voltage settle
logic as it can mean actual headset removal.
Fix to report plug type removal immediately to avoid delay.

CRs-fixed: 482885
Change-Id: I01779cb9b8031613c8b9f2377ff723101700c6b9
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9320: Update headphone static gain in companding mode

Depending on the buik voltage, the static gain for headphone path
are different when compander is enabled. -3dB static gain is required
if the buik voltage is 1.8V and 0dB gain is required while the buik
voltage is 2.15V. Update the codec driver to match the requirement.

Change-Id: Ia21c8732362176d20956a817058ede3c4a472c52
CRs-Fixed: 500280
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: wcd9xxx: use separate mutex for bandgap and clock get/put

Current bandgap and clock get/put uses the big codec lock which is widely
used by entire resource manager.  Embrace bandgap and clock resource
manager api with big codec lock can lead deadlock on certain device
switch case.  Introduce separate mutex only for bandgap and clock resource
manager api to be able to avoid mutex deadlock.

CRs-fixed: 501236
Change-Id: Ia9ee12d767c86ed3db2223f1a4721834b7d6768d
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>

Conflicts:
	sound/soc/codecs/wcd9320.c
ASoC: wcd9xxx: Reset Tapan codec post adsp subsystem restart

Exercise codec reset as part of ADSP subsystem restart handling
and also update codec and ASoC cache registers to defaults. This
is required to clean up codec state post ADSP restart.

CRs-Fixed: 485962
Change-Id: If1574372adaeda5d3a4a015ee580dfba5b161a52
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9xxx: don't clear pending mbhc interrupt

Clear mbhc irq before dispatching it to avoid lost irq when the same
irq asserts while driver is handling previous one.

CRs-fixed: 488535
Change-Id: I43ff7553258c0e8b260f233bbb064a5b8f118120
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9xxx: don't acquire BCL from codec driver

Codec driver shouldn't acquire BCL lock especially from DAPM widget.
Otherwise mutex deadlock can happen in below scenario.
--
thread0                         | thread1
                                | *lock BCL
                                | power up DAPM widget B
                                |         snd_soc_dapm_sync()
DAPM widget A starts sync       |
*lock BCL                       |
--

Fix codec driver to hold codec->mutex instead of BCL and prevent possible
mutex deadlock.

CRs-fixed: 502427
Change-Id: Ibc4a70eba4824a384874244f36831e2d98c85d4b
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>