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.

Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Wait for enough time for Line PAs to get settled

During fast switching of audio playback, we need to wait
for 5ms for the LINE PAs to get settled down before enabling
them again for playback. Same delay is also required after PA
is enabled. Add the required delays after LINE PAs are enabled
or disabled.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Fix DAPM timeout when accesing MAD calibration

request_firmware called by MAD configuration requires
user space daemon to locate MAD codec calibration data.
When system is in suspend state either due to sleep or
user space daemon not ready or filesystem is down then
it needs be up briefly before accesing the codec
calibration data. This change fixes the accesing the
codec calibration data by codec when in suspend state.

Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Fix null pointer access for event callback

The ASoC machine driver provides callback to codec driver to setup
certain settings that are specific to the machine. It is possible that
machine driver does not provide this callback when there are no machine
specific settings. In such cases the callback will be NULL. Make sure to
not access the callback if it is NULL to avoid null pointer dereference.

Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
drivers: mfd: Cleanup of wcd drivers

Kernel has defined printk format specifiers and typedefs
for datatypes.
Using the format strings will remove need for typecasting.
This change cleans up wcd msm drivers to use the kernel
defined data types and format specifiers for printk.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Fix for VI feedback underflow errors

VIfeedback capture widget was added in the speaker RX path.When speaker
is enabled, the VI feedback capture widget would be turned on.
During the shutdown of speaker RX path VI feedback codec path is
shutdown first and then the AFE port is closed. This will cause the
underflow errors during the shutdown seqeunce.
Change removes the vifeedback capture widget from playback path and
creates a new capture path.Userspace module will enable/disbale the VI
feedback path via mixer control.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Add HD2 tuning coefficients for HPH path

Add 2nd Harmonic Distortion (HD2) tuning coefficients
for HPH path. HD2 coefficients get turned ON during HPH
enable and turned OFF during path tear down. Enabling HD2
coefficients would increase the Headphone PA efficiency during
audio playback.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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

Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: handle VoIP call recovery during SSR

Add support for VoIP call auto recovery during Sub System Restart(SSR).

Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Linux 3.4.99