HW MAD bypass feature is to facilitate input to CPE by avoiding
MAD in codec. This is done by routing DEC1 data to CPE. Add the
required changes to support this feature.
CRs-fixed: 938514
Change-Id: I7788b1475cd22bdea291bcae47f048131b220ce3
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
When vdd micbias is connected to regulator, need enable
regulator when micbias is needed.
To detect special headset, micbias need to be set to 2.7v.
Regulator need get enabled before special headset detection.
Change-Id: Iae361cabf7b5194e12f5ddc8e32d60cf94bf28c3
Signed-off-by: Meng Wang <mwang@codeaurora.org>
With 3.18 kernel, get_session_time command to
DSP is updated to new command. This
command is not supported on older targets as
they have an older DSP version. To have backwards
compatibility, based on DSP version choose which
command to use.
CRs-Fixed: 978676
Change-Id: I76b0cfcd84df90d7a206690cb8aa1eb773fdc53d
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Move spin lock init for no wait que before apr registration.
If apr registration fails asm free client will free
the no wait que by acquiring spin lock. Hence spin lock
init for no wait que should happen before apr registration.
CRs-Fixed: 979701
Change-Id: I5ef85e39ab5e3babfb2e097005c0d1553cc38f51
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add support to enable Bluetooth A2DP playback
via DSP.
CRs-Fixed: 978676
Change-Id: I02f2af671bed10e45b764af5cc9a0977a3d9e66e
Signed-off-by: Ramlal Karra <rkarra@codeaurora.org>
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add SET and GET parameter APIs to query speaker
parameters in feedback speaker protection FTM mode.
CRs-Fixed: 974621
Change-Id: I1a51e5033d7836c0c996621593cd2f4dd6982dcd
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
The worker thread can either be stopped through kthread_stop or could
return from the function on some conditions. Since thread has two exit
points, this is causing a race condition where kthread_stop indefinitely
waits for the thread to exit. Make the thread standalone and always call
do_exit itself to exit instead of stopping it through kthread_stop.
CRs-fixed: 972943
Change-Id: If95cbd6ee895d566887453e98421d1514147441b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add 32/48KHz sample rate capability to the VoIP driver to
allow VoIP application which uses 32KHz/48KHz sample
rate to take Voice path.
Change-Id: I654b97ffc36b993114899e85706914d99ef44abc
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Compress offload playback failures observed if SSR is triggered
during playback. Compress_write is blocked as there are no bytes
consumed by the DSP. During SSR, based on the reset events,
driver has to update the bytes copied by the DSP so that write
gets unblocked.
CRs-Fixed: 966659
Change-Id: I24d5bf09b3453f101adb9487298e6fbdfeb15e4a
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Add slimbus 6 playback hostless and slimbus_6_rx back-end
dai-link to enable independent backend for different devices
during audio playback.
Change-Id: Ibc12ca8ad2c99316c52092b74462ecd7bfbded5c
CRs-fixed: 940415
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Add codec rx4 dai to support independent backend for different
devices.
CRs-fixed: 940415
Change-Id: I48b24d81e2047d4d4c299ca60cdbd299e172393e
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Update the slimbus RX 6 routing and add the slimbus RX6 hostless
to support more use cases.
CRs-fixed: 940415
Change-Id: I4fcea97cc4a0c876609fbaa8f5eecf3b4914e776
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Check if 'mbhc_cb' is NULL in wcd_mbhc_stop() before
dereferrencing.
CRs-Fixed: 972101
Change-Id: I3b2348bddb071e5bf7bc2e5d6885bb3c1ba2c195
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
Invert the bit clock for afe tdm ports for msm8996 to
align the lpass and ext codec hw clock and avoid
bit corruption.
Change-Id: Ic36ab733b227a34ebb8401dd11e99f943b0c8839
Signed-off-by: Derek Chen <chenche@codeaurora.org>
CRs-fixed: 973480
In speaker protection usecase, if SWR_CH is already
set to 2 due to bootup tone playback then the initial
calibration fails. As the WSA register writes will
fail due to gr_sid will not match with dev_num
and temperature read will return negative value.
To address this, when session teardown reset the
soundwire master channel count in tasha driver.
CRs-Fixed: 961023
Change-Id: I80ee0dedac8fa81ce54a0e61c839a97b9b45d36b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Introduce new Kconfig for purpose of enabling LPASS
audio driver debugging utilities. Initial utility is
to induce kernel panic upon encountering error from
audio components in ADSP.
CRs-fixed: 968775
Change-Id: I9f802f32892d55be83d4b8a6e861ab09f6336093
Signed-off-by: Patrick Lai <plai@codeaurora.org>
This reverts commit 099e839e730b89630404bfc9a375049ac01b8f93 ("ASoC:
wcd-mbhc: Fix plug removal detection from extension cable")'.
Headset insertion is giving spurious electrical insertion removal
interrupts. Hence headset is not detected properly. This is seen on
RCM devices for normal US headset on 8937/msmgold/msmtitanium. On MTP
some specific headsets are exhibiting this behavior.
Change-Id: Ida016cc29950dabcaaf6bfc1b751e77e3cccd20c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In preparation to add more debugging hooks to LPASS driver, convert
adsp error code and string conversion functions to C source file.
CRs-fixed: 968775
Change-Id: Ic074a318ede4188a8fd603efddce71ed820ee560
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add support for SENARY_MI2S_TX port to enable FBSP.
This port is configured to send VI feedback data from
WSA to ADSP during FBSP.
Change-Id: I4fb1beb7bfedbe513ba43a69e67fbcc815d34595
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Remove improper deletion of list head and protect list
deletion with spinlock. Spinlock protects the list
from access in ADSP callback at the same time the
list is being deallocated.
Change-Id: I1b102cd99e7c80e1dfd4e2054b9ba7e0ca26d6a7
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Change the HW delay debug print so it does not
seem like an error. Adds comments in the code
describing the HW delay feature.
Change-Id: I0955623a7bdb0f4180c908ba079cf6f900e496a5
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Currently class-H controller is not enabled when lineout is enabled
first and then headphone is enabled. Because of this mute is observed
on headphone during lineout and headphone concurrent scenarios.
Fix mute on headphone by enabling class H block during concurrency.
Change-Id: Ibed962eaacf87c3eb55c569d2ae9c6363a63cace
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
CRs-Fixed: 957405
Add NULL check for the pointer to make sure memory is
allocated. Add array boundary check for the index
before using the same array.
Change-Id: Ifd35ca0c0a1cbeee18d7797ea6b43ea31be0eeba
Signed-off-by: Viraja Kommaraju <virajak@codeaurora.org>
Add port mixer routing support from aux_pcm_tx to quat_mi2s_rx.
Change-Id: I6c72ab41123de4f4ab3a37bd23c37c58d689e509
Signed-off-by: Derek Chen <chenche@codeaurora.org>
As AFE clock version macros can be used
in other drivers, move them to header file.
Change-Id: Iae5717c181e81bf7a6161742e8d062d09bedfb78
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Pop is observed during starting of the playback in CLS-AB mode.
Fix the pop issue by updating register sequence properly.
Change-Id: Iff17245e8a2b14354cc99150a57394ce81ec29b8
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Voice driver doesn't create any sessions related to voice call
on modem and hence there is no clean up on APSS is required
when modem SSR is triggered. Cleanup the code in voice driver
which is executed during modem SSR.
CRs-Fixed: 955696
Change-Id: I7536162e49b0eb56f63e7c8e59e0c050123c05fe
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Increase slimbus clock gear for setting of Tx HPF(High pass filter)
cut off frequency properly. Change will ensure Tx HPF cut off
frequency will applied in the codec.
Change-Id: I7d7c3243c63cd3b9242a15344ecdae89ec9ee977
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Reset spline resampler after audio playback is completed
to clear the FIFO and avoid any noise being generated.
Change-Id: I30ed6a337c3bb08f6197f7ee575b323f0b0acfac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Update mbhc impedance detection parameters namely, LDO control
and Nshift, to get better accuracy for headphone left and right
impedance values.
Change-Id: I8b3271ee9af91b9e921957998e0fb074ffdebe86
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Certain headsets have threshold on microphone for detection.
Currently mbhc driver takes about 3 to 4 seconds to detect those
headsets. Reduce delay in detection for threshold headsets by
increasing micbias to 2.7v.
Change-Id: I744bafb78560f39806d656c98582d8162fa10dfd
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Fix plug removal detection by enabling electrical removal
irq when headset/headphone accessory is removed from the
other end of extension cable.
Change-Id: I585a81e6c01b4ddd249f76614fb933beea3755fc
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
In compressed driver streams might get stopped while
ioctl drain is started but not completed, since buffers
are drained in multiple stages when gapless mode is
enabled.
Check stream state before issuing wait commands to
prevent waiting for drain ack on stopped streams.
Change-Id: I606639c103a7aed90dd9a4561fa6dffc3d4c3822
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
It is possible that differnt platforms could configure to DMIC clock
drive strength differently. Allow this configuration by setting the DMIC
clock drive strength through pdata.
CRs-fixed: 938006
Change-Id: I6f9f8a947e0efca31d0c50dec9a5973079bb48c4
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Give more headroom for headphone PA ramp up and down during
impedance detection to avoid any click and pop or ramp error.
Change-Id: I3e3980e48ce19955b4230876887adfde5b44e8ea
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
For each successful wsa read and write, we are printing the
values. Moving the print to debug.
Change-Id: I1b5c6b345b1d967d43f26bd9b1d4731d02ad021c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When clients are trying to send message while the worker thread is
processing existing messages, there is possibility that the message
queue can get corrupted. This can result into kernel crash. Fix to make
sure the message queue does not get corrupted.
CRs-fixed: 951194
Change-Id: I1eb5232d9d079ecc9d28b95737333c1198a8b20c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Audio drivers to configure ADSP MFC in cases where fractional
resampling is needed.
Change-Id: Ifc85ff788347ddd893f8858064f71a07fa1ddd9c
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
As anc_mic_found is not initialized, it is taking
input as true and report as ANC Headphone results
in wrong accessory detection. Initialize the flag
to false that fixes the issue.
Change-Id: I1c9912e2ab396a8a0a31065b826d6f92a0603215
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
After subsystem restart is completed, driver will try to restore the
internal clock state to state before subsystem restart. In some cases,
it is possible that the internal clock state is not restored properly.
This causes the internal clock to be off when it is expected to be
turned on. Fix this issue by making sure the clock states are restored
correctly post subsystem restart.
CRs-fixed: 948899
Change-Id: I0084287b2d3b62c7498bae423952e64dd0d6e0f4
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Enable count of WSA startup/shutdown is not handled.
Add counter to handle the startup and shutdown properly.
Change-Id: I8c46fdd900c51d3e8d766b824f17996919779ba9
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Currently lsm client data is deallocated when q6lsm_open() fails
which can cause memory corruption if lsm client data is accessed
after freed. Fix this issue by deallocating the client data only
in msm_lsm_close().
Change-Id: If048c26a0ffd8a346a28622183cbf2ba1e7e5ff3
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
During subsystem restart, it is possible that while the underlying bus
is down, the irq driver has already performed its cleanup. In such case,
when CPE driver requests to cleanup its own irq, the irq driver attempts
to hold an lock that is already freed. Fix this issue by performing the
CPE driver irq cleanup after bus is up rather than when bus is down.
CRs-fixed: 948899
Change-Id: I2772e89bbdc855baa9fcf7a34a9c16f2f5c05c32
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
- currently gain is added for only number of channels and clip
channel count is send to dsp.
- but it is possible that channel mask that driver has is different
than what dsp discovers after decoding the codec config data
- volume will not be applied to channels that differ between driver
and dsp and device volume will not apply on these channels
- change is to control multi-channel volume using master gain
Change-Id: Icd8ca4e935d9095dd9ef8b65eff34629326fb563
Signed-off-by: vivek mehta <mvivek@codeaurora.org>
Move list init for no wait que before apr registration.
If apr registration fails asm free client will free
the no wait que.
Change-Id: I4707dbf4771a1ec313898adb2284c06ef1fb5b3a
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Currently worker thread in cpe service is created twice.
The second thread handler overwrites the first one. The first
thread is not freed when the service is cleaned up. The fix
prevents creation of the redundant thread.
CRs-Fixed: 949165
Change-Id: Idd76b76d4f7f25d2592ca7c336dbee77b6efc7eb
Signed-off-by: Walter Yang <yandongy@codeaurora.org>