Commit graph

24076 commits

Author SHA1 Message Date
Laxminath Kasam
73f564a2c2 Revert "ASoC: wcd-mbhc: Fix plug removal detection from extension cable"
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>
2016-03-23 21:19:37 -07:00
Patrick Lai
45f43cddf9 ASoC: msm: qdsp6v2: move adsp_err to c source file
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>
2016-03-23 21:19:22 -07:00
Venkata Narendra Kumar Gutta
9c8d55382c ASoC: msm: qdsp6v2: Add support for SENARY_MI2S_TX port
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>
2016-03-23 21:19:18 -07:00
Ben Romberger
c0b53092e3 ASoC: msm: qdsp6v2: Correctly free ASM no wait queue
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>
2016-03-23 21:18:58 -07:00
Ben Romberger
38ebaf2f95 ASoC: msm: qdsp6v2: Modify HW delay debug print
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>
2016-03-23 21:18:57 -07:00
Vidyakumar Athota
2263eb03e8 ASoC: wcd9335: fix mute issue on headphone during concurrency
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
2016-03-23 21:18:53 -07:00
Viraja Kommaraju
d355d220ef ASoC: qdsp6v2: Add error check for pointer and array index
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>
2016-03-23 21:18:35 -07:00
Derek Chen
81aa95aa8c ASoC: msm: add port mixer routing for quat_mi2s_rx
Add port mixer routing support from aux_pcm_tx to quat_mi2s_rx.

Change-Id: I6c72ab41123de4f4ab3a37bd23c37c58d689e509
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2016-03-23 21:18:24 -07:00
Viraja Kommaraju
793b94b398 ASoC: Add check for pointer and array index
Add check for NULL pointer access and
array index boundary.

Change-Id: Ia12a28c43b99158a90d27eecd23bdfd4b42b346e
Signed-off-by: Viraja Kommaraju <virajak@codeaurora.org>
2016-03-23 21:18:23 -07:00
Laxminath Kasam
c006b9ad3b ASoC: qdsp6v2: move AFE clock macros to header
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>
2016-03-23 21:18:21 -07:00
Vidyakumar Athota
964f63a545 ASoC: wcd9335: fix pop during CLS-AB mode
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>
2016-03-23 21:18:20 -07:00
Venkata Narendra Kumar Gutta
ed41926607 ASoC: msm: qdsp6v2: Don't register to modem for SSR callbacks
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>
2016-03-23 21:18:11 -07:00
Sudheer Papothi
e125c08ab8 ASoC: wcd9335: Increase slimbus clock gear for HPF settings
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>
2016-03-23 21:18:07 -07:00
Phani Kumar Uppalapati
58456af54d ASoC: wcd9335: Reset spline resampler after playback
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>
2016-03-23 21:17:26 -07:00
Phani Kumar Uppalapati
905abbddb5 ASoC: wcd9335: Update impedance detection parameters
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>
2016-03-23 21:17:25 -07:00
Phani Kumar Uppalapati
10d7cdb07d ASoC: wcd-mbhc: Reduce delay in detection for threshold headsets
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>
2016-03-23 21:17:24 -07:00
Phani Kumar Uppalapati
e45a913e1e ASoC: wcd-mbhc: Fix plug removal detection from extension cable
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>
2016-03-23 21:17:18 -07:00
Dhananjay Kumar
e22b97da06 ASoC: msm: fix indefinite wait in compress drain
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>
2016-03-23 21:17:06 -07:00
Bhalchandra Gajare
f5e6ba4333 ASoC: wcd9335: Configure DMIC clock drive stength from pdata
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>
2016-03-23 21:17:02 -07:00
Phani Kumar Uppalapati
6fd817114c ASoC: wcd9335: Give more headroom for headphone PA ramp
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>
2016-03-23 21:17:00 -07:00
Laxminath Kasam
83f4c5c049 ASoC: wsa881x-analog: move error prints to debug for wsa
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>
2016-03-23 21:16:47 -07:00
Bhalchandra Gajare
ccac8bdb00 ASoC: wcd_cpe: Fix message queue list corruption
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>
2016-03-23 21:16:34 -07:00
Sidipotu Ashok
22a99a40bf Asoc: msm: add support for Media Format Converter
Audio drivers to configure ADSP MFC in cases where fractional
resampling is needed.

Change-Id: Ifc85ff788347ddd893f8858064f71a07fa1ddd9c
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
2016-03-23 21:15:59 -07:00
Laxminath Kasam
4a7037e0f8 ASoC: wcd-mbhc: initialize boolean flag anc_mic_found
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>
2016-03-23 21:15:56 -07:00
Bhalchandra Gajare
164661cbb4 ASoC: wcd9335: Fix internal clock enable during SSR
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>
2016-03-23 21:15:48 -07:00
Laxminath Kasam
513c9ffd22 ASoC: wsa881x-analog: fix shutdown of wsa during playback
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>
2016-03-23 21:15:45 -07:00
Vidyakumar Athota
df607d1693 ASoC: msm-lsm-client: free lsm client data in msm_lsm_close
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>
2016-03-23 21:15:41 -07:00
Bhalchandra Gajare
d9ac385da9 ASoC: wcd_cpe_core: Perform irq cleanup once the bus is up
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>
2016-03-23 21:15:34 -07:00
vivek mehta
092ca0fe36 ASoC: msm: send gain info for all channels mask
- 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>
2016-03-23 21:15:30 -07:00
Ben Romberger
be8713afec ASoC: msm: qdsp6v2: Move asm list init before apr registration
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>
2016-03-23 21:15:30 -07:00
Walter Yang
afbbca6a77 ASoC: wcd_cpe_services: delete the redundant worker thread
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>
2016-03-23 21:15:12 -07:00
Phani Kumar Uppalapati
5c2bb64a1c ASoC: wcd9335: Change RX disconnect port sequence
Change RX disconnect port sequence so as to avoid
slimbus underflow and audio mute issues during
playback.

Change-Id: I0260e61b78e3bcfe422896dc60b15af84be424a4
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:14:58 -07:00
Banajit Goswami
d2c515c358 ASoC: wcd9335: update default VBat Bias current
Update default value for VBat Bias current for Front-end.
The increase in current value is needed to increase
robustness of VBat ADC output when the feature is used
at low temparature.

Change-Id: Ic924fa59ce867f9b32c17564f8f55406c6c467ea
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-03-23 21:14:57 -07:00
Phani Kumar Uppalapati
dc9d51cfe2 ASoC: msm: Enable MBHC 5-pole plug detection
Enable MBHC (Multi Button Headset Control) 5-pole
plug detection so as to detect the presence of
second microphone whenever any accessory is inserted
in to the headset jack.

Change-Id: I53dda0d18006109c19a1cd8ce0bc4df45a13f0bf
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:14:56 -07:00
Phani Kumar Uppalapati
f359b9f372 ASoC: wcd-mbhc: Add support for 5-pole plug detection
MBHC hardware block on WCD9335 supports 5-pole plug
detection. Add support for 5-pole plug detection in
MBHC driver.

Change-Id: Ia2620b5cc3ef5065f350549d29cde063fdd1bf04
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:13:49 -07:00
Phani Kumar Uppalapati
ed642a40cd ASoC: wcd-mbhc: Fix unbalanced irq enable/disable
Fix unbalanced mbhc electrial irq enable/disable to
avoid detection failures when headset or headphone
is inserted into an extension cable at the other
end.

Change-Id: I2eb9096f1cb45957a3d511af86cb630348581e0b
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:13:48 -07:00
Deven Patel
8b7a1ee3b5 ASoC: codecs: Skip bandwidth voting for I2C interface
For audio usecases bus bandwidth voting is required only for
slimbus. Add the check to gracefully handle I2C cases.

Change-Id: I4dcbd0e6a84f8ca9f5429ed0ec0b4795e591981d
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
2016-03-23 21:13:43 -07:00
Phani Kumar Uppalapati
3cbc7345b0 ASoC: wcd-mbhc: Avoid fake microphone insert/removal events
If headphones is removed during 3-sec polling interval,
it is possible that hs_comp_result is zero while mechanical
switch level will be low. Currently driver reports microphone
insertion followed immediately by removal in this scenario.
These fake events cause audio to continue to play on speaker
even headphones is removed during playback.

Change-Id: Ibf559e207b3370cb2cec5149f8e794cb55ca27ac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:13:29 -07:00
Bhalchandra Gajare
7efd0a9644 ASoC: wcd_cpe_core: Fix memory leak
During sound model de-registration, the message to be sent to CPE is
dynamically allocated but not freed. This causes memory leak in the
driver. Fix by adding kfree() to free the memory once the message
transfer is completed.

CRs-fixed: 933901
Change-Id: I02f25fc3457d530de436eb33da1709517b597e7b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-03-23 21:13:27 -07:00
Honghao Liu
a5e5d05ce2 ASoC: msm: add slot and channel config support for TDM devices
Add support for slot and channel configuration in CPU dai driver
for TDM devices. Remove the probing of slot and channel info from
device tree.

Change-Id: I9d65779b7ef70fac741569f0584b15db29093e0c
Signed-off-by: Honghao Liu <honghaol@codeaurora.org>
2016-03-23 21:13:21 -07:00
Sudheer Papothi
5843838a49 ASoC: wcd9335: Re-align ANC co-efficient pointers for EAR path
Re-align ANC(Active Noise Cancellation) co-efficient pointers for
ANC functionality to work properly on EAR path.

Change-Id: Ied6f3372e2172c9205478e807a1b42510bf49505
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 21:13:15 -07:00
Bhalchandra Gajare
c2c5e11c28 ASoC: wcd_cpe_core: Mark functions as static
Some of the functions that are supposed to be static are not declared to
be static. Cleanup the driver to make sure all functions specific to
this file are marked as static.

Change-Id: Ie2e0a7a1df5d49e8b6ed2af90b1a727e5c08746d
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-03-23 21:13:14 -07:00
Bhalchandra Gajare
159c5b3b4a ASoC: wcd_cpe_services: Clear internal state before notifying clients
When CPE services notifies the client that response to any message is
received, it is possible that the client may send another message even
before the CPE services cleared the current message response as these
both are run in different thread contexts, this will cause the command
queue to be corrupted. Fix this issue by clearing internal state of CPE
services command queue before notifying clients the clients the result
of message transfer completion.

CRs-fixed: 946375
Change-Id: I4b31201747edd7fdee57294ff559ccb21e582608
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-03-23 21:13:13 -07:00
Bhalchandra Gajare
341a164794 ASoC: wcd_cpe_core: Fix race conditions during message transfer
Currently, it is possible there could be race condition when there are
multiple messages to be sent to CPE. Add changes to fix the possible
race conditions.

CRs-fixed: 946375
Change-Id: I6a290c00b08fa3afc64acf40cd339a0203f73d96
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-03-23 21:13:12 -07:00
Phani Kumar Uppalapati
12c198132e ASoC: wcd9335: Notify channel count to soundwire master
Notify channel count to soundwire master so that
it can use broadcast command to configure the slave
devices whenever channel count is greater than 1.

Change-Id: I0cb80ebe84e6010f9ea54d73eacf0e8f2782b724
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:13:11 -07:00
Bhalchandra Gajare
f95641a7b7 ASoC: msm-cpe-lsm: Improve handling of errors during buffering
The channel setup errors are not handled in some cases, add fix to
handle the errors gracefully for look ahead buffering.

CRs-fixed: 943741
Change-Id: Ifbaf8a05e0e1f4c7e099a1664e914d430345ee37
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-03-23 21:13:09 -07:00
Laxminath Kasam
6d4b0deeb6 ASoC: audio: update API name for populate upper 32bits
In audio ion driver, append msm_audio_ to API
populate_upper_32bits to maintain consistency
across other API names in this driver.

Change-Id: I72aace56bf8e80c6dd83f768876253d2c7f334bb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-03-23 21:13:03 -07:00
Sudheer Papothi
38afeba1a6 ASoC: wcd9335: Increase slimbus clock gear during device path bringup
Increase slimbus clock gear during device path bringup for faster
execution of register read and writes. This will improve the
latency during device path bringup.

Change-Id: I3118eecde7dd8e90fff05a6e0c6efa4052013a44
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 21:12:55 -07:00
Sudheer Papothi
7f81f92c5a Revert "ASoC: wcd9335: Increase slimbus clock gear to reduce cold start latency"
This reverts commit dac17fb61688 ("ASoC: wcd9335: Increase slimbus clock
gear to reduce cold start latency").
This change is not needed as pre and post dapm events are getting
called even for front end dai links which results in latency
during device path bringup.

Change-Id: I3f35317bc11aec100fbcc1f9304bc23a97c7c39a
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 21:12:54 -07:00
Yeleswarapu Nagaradhesh
2b7260c155 ASoC: wcd: add support for wcd9326 codec
Use efuse register values, to differentiate between
wcd9326 and wcd9335 codecs.

Change-Id: I68e7ae5eb1717dccd0af975670ac3644304996b9
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
2016-03-23 21:12:50 -07:00