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: 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: 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: wcd9320: Add NULL check to avoid crash

Check for NULL pointer before passing the parameter for string
manipulation to avoid pointer dereference.

CRs-Fixed: 682551
Change-Id: I74610e4679e4808c633c0ea80d3b3e389faf46d0
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
ASoC: wcd93xx: Remove delay for Slimbus during SSR recovery

When SLIMBUS data channel is to be torn down, CODEC driver
waits for channel removal interrupt from SLIMBUS slave device
with 1 second timeout as measure to prevent system from lock
down in case channel removal interrupt never arrive due to
known reason. When ADSP SSR happen, SLIMBUS would be reset
hence data channel will be gone inherently. Waiting for 1
second will only prolong SSR recovery latency. Update to
avoid the delay after SSR.

Change-Id: Ic6a94ddd1150ba143f4dd33aac1785d7d2ee7653
CRs-fixed: 653504
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Revert "random: make 'add_interrupt_randomness()' do something sane"

This reverts commit 46668c15dc813e3abcbd08d1aca7189b311de373.
Revert "ASoC: compr: Disable soft-pause for compress playback"

This reverts commit 69408c042531128b195ffc6e68b4f7af61ed9381.
ASoC: msm: Check the pointers before memcpy

Check the pointers before memcpy when the application queries
the adsp capability for compressed audio. Invalid pointer
can cause kernel panic when doing memcpy.

CRs-fixed: 665297
Change-Id: I522deffc42f792b8dfdcf50272a80cd0d1e5a9ee
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: msm: qdsp6v2: Userspace interaction cleanup

Compress ioctl function transfers data to/from userspace
and additionally implements logic to process ioctl command.
Ioctl function should delegate the processing to internal
functions for support compat mode.
This change moves the processing into internal function.

Change-Id: Id3a3cbd000ce319dcf2a01fa4eae941c042b2b37
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>

ASoC: core: Add compat support for compress driver

Change adds compat ioctl for supporting 32 bit userspace
client when kernel is compiled for 64 bit.

Change-Id: I3ac51187f9c53feaec4b2ea309beaefc4e9acf53
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ib96cb419ade042d21a1213f6d8c2ff339f5d1c56
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
Revert "ASoC :msm: Increase Proxy buffering"

This reverts commit ada69c2505074672306bdaba2109e90f76733157.
Revert "Reduce min capture period size from 320 to 64"

This reverts commit 6bbf44d6e99bcfc59f04fb4b63e15c4e915ba7cd.
ASoC: msm: EOS timeout now based on audio data

The timeout value, in relation to waiting for the
EOS command completion message from ADSP, is now
based on the time it will take the ADSP to stream
the remaining audio buffers.

Change-Id: I76fa7d97b91052afd8884aab40bc5df040951be5
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ASoC: msm: fix the audio mute issue post SSR

On receiving the RESET_EVENTS the in_count is not incremented
leading to the wait timeout in the capture_copy.
This causes the capture session not to be closed from the client post SSR.
Post SSR, read error causes the state mismatch for the clients
leading to no audio issue.

Change-Id: I58bb4d4b6e8f1e229e635563206b49948dbe5826
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
asoc: msm: Correct the max period size for PCM output

Change-Id: I29867879747831a225a08b94b0dd3bc8f26cff30
ASoC: msm: qdsp6v2: extra low latency mode change for audio capture

For low latency audio capture sessions adm should be
opened in low latency mode.This change checks for low latency
mode and passes the info to adm.

Change-Id: I8cc5efc44f7500d7abf6db54f8ab74d60f1bbf97
CRs-fixed: 622080
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
ASoC: msm: qdsp6v2: Fix voice mute issue when EC ref is set

Function voc_set_ext_ec_ref returns 0 on success, handle the
return value of this function appropriately to avoid mute issue.

CRs-Fixed: 601078
Change-Id: I7226c088410bf4a2effe0d060f839dc7928359bf
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
ASoC: msm: qdsp6v2: update default channel mapping

- Update default 5.1 and 7.1 channel mapping in q6adm.c
  for compress offload multi-channel playback.
- Update default 5.1 and 7.1 channel mapping in q6asm.c
  for PCM format multi-channel playback.
- Channel mapping can be overwritten by mixer controls
  passed from user space/HAL.

Change-Id: I168277f08790773411b7965784143318f72df64b
CRs-Fixed: 582601
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
ASoC: msm: qdsp6v2: Check for null pointer

Add check for null pointer after kmalloc in
config_debug_fs_init() and log error message if
true.

CRs-Fixed: 575229
Change-Id: I9824ffa447153581efdf7cb87838538d1e99b0f2
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ASoC: msm: qdsp6v2: Add meaningful labels

Add meaningful labels to goto on error
conditions in config_debug_fs_init(). Also
added more robust error handling in same
function.

Change-Id: I160bd921e3a43a30f2bf40f532be675c1134716b
CRs-Fixed: 575229
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>