In case of large value for bufcnt_t or bufcnt,
cmd_size may overflow. Buffer size allocated by cmd_size might
be not as expected.
Possible buffer overflow could happen.
CRs-Fixed: 1084210
Change-Id: I9556f18dd6a9fdf3f76c133ae75c04ecce171f08
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
When variable bufsz equals to 0, there would be infinite loop
at q6asm_audio_client_buf_alloc.
Fix the potential bug by checking bufsz beforehand.
CRs-Fixed: 1072280
Change-Id: I9640112b8945dc603e3af55fc1096bea9f7e6634
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Some of the ioctl command handling is not properly using the
copy_from_user interface. Fix these issues and cleanup the ioctl
functions to make sure there is no illegal memory access.
CRs-Fixed: 1087469
Change-Id: Ieb1beb92e7854a05b8045de0ce179d12c9a6da74
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add check in tasha_mad_input_put function to
return error on out of bounds access using
mad input value.
CRs-fixed: 1096799
Change-Id: Iddaa3fef362f7cb1919aa3bd8dd4b83133fe7c97
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Add check in tomtom_mad_input_put function to
return error on out of bounds access using
mad input value.
CRs-fixed: 1096799
Change-Id: Ied86bf88301e555b25eaa190d2d786cdad691ccd
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Add check in taiko_mad_input_put function to
return error on out of bounds access using
mad input value
CRs-fixed: 1096799
Change-Id: I75ce9e881cf05a50e874a555b2f8bd3286cdaed4
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Update machine driver AFE API calls compatible
with adsp version AVS 2.6 and AVS 2.7
Update of mclk flag in suspend call.
Change-Id: Id0b300bcf585895cc659a1882710d825d0e7a808
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
In Q6 asm and afe drivers, add API support
for AVS 2.7. Update compress driver to use
ASM volume gain compatible to verion used
Change-Id: I152a3410c99cfa37dca0eadb30b97f121f5d0a89
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
Q6 core service provides API to query ADSP
version. Update the apr with get()/set()
to use this adsp version by platform/machine drivers
Change-Id: Icf480991b4b7847cd872ab7286ed1132facff0a4
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
Timeout error is observed while waiting for
ADM_CMD_SET_PP_PARAMS_V5 command's response.
Fix the condition logic in wait_event_timeout()
to match the value set in adm_callback() when
response to ADM_CMD_SET_PP_PARAMS_V5 is received.
CRs-Fixed: 1030674
Change-Id: I711c860dc3de479eec0d22369d19615aef572ea1
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
validation of the codec variable passed to the snd_soc_read
and snd_soc_write functions are missing and can lead to DoS
as referred in CVE-2016-6690
Bug:28838221
Change-Id: I5020f77e252bade5e97efb592afb71fe1b18d952
Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
Signed-off-by: Srinivasa Rao Kuppala <srkupp@codeaurora.org>
Removed 20ms delay in RX chain PMD as it is not required.
This improves device switch and tear down latency.
CRs-Fixed: 1070432
Change-Id: Id6996dff163f390a662f628da710d8bb238f7fca
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Before accessing io mapped address, check if
qdsp6 is ready to avoid dataabort issue.
Change-Id: Ia65875cd1087520befa0d12f928dc3fd1478031a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Set token value with port index and copp id so that
correct wait queue handle can be deduced in the
callback of adm_set_stereo_to_custom_stereo command.
Change-Id: Ica4c1442c1143f46de2baa6eaf1890ad0cb4b742
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
The params array is used without initialization, which may cause
security issues. Initialize it as all zero after the definition.
CRs-Fixed: 1062271
Change-Id: If462fe3d82f139d72547f82dc7eb564f83cb35bf
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Change all audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.
CRs-Fixed: 1052832
Change-Id: I9ff5cf06b019c566973eb609bf5d37969b98d31d
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Change cpe driver to use %pK instead of %p.
%pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.
CRs-Fixed: 1052832
Change-Id: I741d9e5c5b415011348e862c3f1ee4fe28c3969f
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Initialize param length with user space argument and
check the condition for maximum length in
SND_AUDIOCODEC_EAC3 format.
CRs-Fixed: 1032820
Change-Id: I710c1f743d7502e93989e8cc487078366570e723
Signed-off-by: Surendar karka <sukark@codeaurora.org>
Schmitt trigger result is wrong if PA is enabled.
So, don't check for cross connection when PA is enabled.
CRs-Fixed: 1061507
Change-Id: Iad71abbed72aa40b5c839260f5c297a885f7d128
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Cross connection sometimes gets detected late. The issue faced is
cable is reported as headset initially, cross connection is
detected later. But before confirming cross connection, playback
starts on headset, so checking for cross connection is not
confirmed. Cable remains reported as headset. So check for cross
connection just before reporting headset.
CRs-Fixed: 1028002
Change-Id: Ida4f277f13c9a193cd7c92063b99bcf1104f107e
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
The overflow check is required to ensure that user space data
in kernel may not go beyond buffer boundary.
CRs-Fixed: 1064411
Change-Id: I54c28a8942cf1a6a47a4e8272f3159b35d753ead
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
dummy_codec is not initialized before use, which
could cause kernel panic. Initialize dummy_codec before use.
Change-Id: Iedf7a3accbd14138ab7ed9e4e36a98fd7ca9a839
Signed-off-by: Meng Wang <mwang@codeaurora.org>
In lsm-related driver files, some pointers are not set as NULL
after the memory is freed, which will leave many dangling pointers.
Set them to NULL explicitly to avoid potential risk.
CRs-Fixed: 880388
Change-Id: I44925240705608510266a51225cc02611637c571
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
After SSR, observe tones heard with high volume.
compander and hph_mode mixer controls are reset
in post reset callback which will not be in
sync with userspace settings. Avoid reset of
compander and hph_mode controls in post reset
callback.
CRs-Fixed: 1010471
Change-Id: Iacb3e27a35027037613e82e483b10b635d492a75
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Non DAP modules are disabled when DAP is enabled, and when DAP
is disabled they are suppose to move to a state as set in the
calibration data. Modules which dont have an explicit enable param
remain disabled even when DAP is disabled. Hence send an explicit
enable command to DSP for all modules followed by the
calibration data, this ensures correct state of all modules.
Change-Id: I6f8873bb11d96a20f6401eba5fe2979b6a14e11e
CRs-Fixed: 1049611
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for standalone enablement of ldo_h
in wcd9335 hardware. This is required to enable
certain audio TX use-cases.
CRs-fixed: 1032443
Change-Id: Iea068907241b42846d95d8e62e59409cdd29ca42
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: SoumyaManagoli <smanag@codeaurora.org>
A big negative data length value can bypass the current check,
update the condition to ensure that only valid data length is used
to copy the params.
CRs-Fixed: 1041130
Change-Id: I6e1a58e901e4c042acfb0ab0a6223dec2949aefe
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
For the audio get calibration ioctl compare the allocated
buffer size to the size of the header and cal type header
to ensure the buffer is big enough.
CRs-Fixed: 1038127
Change-Id: I851b4454e8420706ad3263d67e892720d46e5718
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
A big negative data length value can bypass the current check,
update the condition to ensure that only valid data length is used
to copy the params.
CRs-Fixed: 1041130
Change-Id: I6e1a58e901e4c042acfb0ab0a6223dec2949aefe
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Supported sample rates list in tash_mad1 DAI is not matching with
the given minimum and maximum sample rates
Added additional supported sample rates
Change-Id: Ia44f8dc2f6ab4c59fae7de6d9cebe073bed3ed31
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>
Supported sample rates list in tash_mad1 DAI is not matching with
the given minimum and maximum sample rates
Added additional supported sample rates
Change-Id: Ia44f8dc2f6ab4c59fae7de6d9cebe073bed3ed31
Signed-off-by: Pavan Chikkala <pavanc@codeaurora.org>
Validate input data length to ensure only relevant data
is copied.
CRs-Fixed: 1027585
Change-Id: I67eb4f162f944bbf4d9e55fb8fe93759e6b8ff91
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
For 24 bit playback decoder is opened with 16 bits per sample, So
decoder output is 16 bit only.
Set bits per sample to 24 if codec format is SNDRV_PCM_FORMAT_S24_3LE.
Set bits per sample to 16 as default value in capture prepare use case.
CRs-Fixed: 1035154
Change-Id: I14271b17441308f8ec6dfaea566c01887d1233f4
Signed-off-by: Preetam Singh Ranawat <apranawat@codeaurora.org>
Signed-off-by: Ramjee Singh <ramjee@codeaurora.org>
Size of param buffer should be big enough to hold param length
of data and param payload.
CRs-Fixed: 1033525
Change-Id: I6fa58f87a7c7df5f0485ea5b368ea090eb8bedb4
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE)
CRs-Fixed: 1011048
Change-Id: If81f3053629dc4f80a08392f392c7be735ad33c2
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Change all qdsp6v2 audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.
Change-Id: I7baa9f127266726fecf9238167a1e0128a258847
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Signed-off-by: Surendar karka <sukark@codeaurora.org>
Following commit ID's are propagated with this gerrit.
I3e3980e48ce19955b4230876887adfde5b44e8ea
I48b24d81e2047d4d4c299ca60cdbd299e172393e
Iae361cabf7b5194e12f5ddc8e32d60cf94bf28c3
I8b3271ee9af91b9e921957998e0fb074ffdebe86
I562f17363d7d38caece358a50d1e3f654d87491f
Change-Id: I1b8610f8333b91be5e2bf9ecacf916d4b25d3f54
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
For playing 24 bit through PCM driver with 40ms
buffers, bigger buffers are needed. The size (in bytes)
is 1920 (frames) x 4 (bytes per frame) x 8 (max channels).
Increase the maximum size of the buffer to fit the bigger
buffers.
Change-Id: I7a59fb18846903960c329ad163788f6791495830
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
commit ba4bc32eaa39ba7687f0958ae90eec94da613b46 upstream.
An older patch to convert the API in the s3c i2s driver
ended up passing a const pointer into a function that takes
a non-const pointer, so we now get a warning:
sound/soc/samsung/s3c2412-i2s.c: In function 's3c2412_iis_dev_probe':
sound/soc/samsung/s3c2412-i2s.c:172:9: error: passing argument 3 of 's3c_i2sv2_register_component' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
However, the s3c_i2sv2_register_component() function again
passes the pointer into another function taking a const, so
we just need to change its prototype.
Fixes: eca3b01d08 ("ASoC: switch over to use snd_soc_register_component() on s3c i2s")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE)
CRs-Fixed: 1011048
Change-Id: Id0718889e14c9f1f184899faa7159e126919537a
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE).
CRs-Fixed: 1011048
Change-Id: I5c49091d6bbff98ed8665446fffdba08446073cd
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE)
CRs-Fixed: 1011048
Change-Id: I2e72305bdbece822381b56a8a0c0cc9c7b8b0f0b
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Driver changes to use ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
command. This command supports playback/record of both 32 bit
(24 bit data in 32 bit word) and 24 bit packed. Update platform
drivers to this for SNDRV_PCM_FORMAT_S24_LE record and playback.
CRs-Fixed: 1011048
Change-Id: I6f98bf3402a737bc21daff33b13b137850a690ea
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Implement platform drivers to support shared memory based
pcm playback and capture
Change-Id: I882c67ae1c3d950b98bd002ac384cc3a7e77874a
CRs-Fixed: 992798
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Fix overwrite of updt_params allocated in heap, and stack overread
where param pointer is passed from user space.
CRs-Fixed: 989628
Change-Id: Ida8bdb7da2fcb97023dce3b6eafe4b899a51cb66
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
Add check to avoid out of bound access.
Check return value of get_user api.
CRs-Fixed: 997025
Change-Id: Ibbace116ac206007fa1928555838285304737737
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
If clk_div2 is not set, it remains enabled even
when no session is running. Set the clk_div2 param
properly if mode is BOTH_VALID.
Change-Id: I26a6f6d2121a8f93410be4a128106ee0fc4212a2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Request device ungroup of speaker channels for independent
disable. It is possible that stereo speaker channels can be
disabled one after other, so remove them from group otherwise
speaker can be left in enabled state.
CRs-fixed: 1007465
Change-Id: I358ab4edcb85ec65b064ca28368ad744f2d36870
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add check to avoid out of bound access.
Check return value of get_user api.
CRs-Fixed: 997025
Change-Id: Ibbace116ac206007fa1928555838285304737737
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
pulled in the changes from the below commits.
Ia4329ac982eb2a29a2b925897cd87ca9711c30e3
Ic0ab015098035418458a5ba7c2ffad9df20f933c
Ia091228b5a6e6d3dced2bee6cd5fecf5632a62a0
Change-Id: Ie89d37060a73a190f752eebf226c630a903f0c1b
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Following commit ID's are propagated with this gerrit.
I3e3980e48ce19955b4230876887adfde5b44e8ea
I48b24d81e2047d4d4c299ca60cdbd299e172393e
Iae361cabf7b5194e12f5ddc8e32d60cf94bf28c3
I8b3271ee9af91b9e921957998e0fb074ffdebe86
I562f17363d7d38caece358a50d1e3f654d87491f
Change-Id: I1b8610f8333b91be5e2bf9ecacf916d4b25d3f54
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
restore the cache values back of last state applied
in SSR recovery using snd_soc_cache_sync API. So
hardware codec configuration will be in sync with
userspace settings. And avoid any race condition
between the userspace updating dapm widgets and
SSR recovery updating any register value.
Change-Id: Ie2a986b5c6827b02aa3d5919cc69e7363155c45e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
After enabling moisture detection and updating thresholds,
could see increase in codec power numbers during sleep.
So donot enable moisture detection.
CRs-Fixed: 991946
Change-Id: Iede49e4608a325c47ac2cd27cdb080730d822310
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
commit d0784829ae3b0beeb69b476f017d5c8a2eb95198 upstream.
"MBC Mode", "VSS Mode", "VSS HPF Mode" and "Enhanced EQ Mode" ctls in
wm8958 codec driver are enum, while the current driver accesses
wrongly via value.integer.value[]. They have to be via
value.enumerated.item[] instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 8019c0b37cd5a87107808300a496388b777225bf upstream.
The DRC Mode like "AIF1DRC1 Mode" and EQ Mode like "AIF1.1 EQ Mode" in
wm8994 codec driver are enum ctls, while the current driver accesses
wrongly via value.integer.value[]. They have to be via
value.enumerated.item[] instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
For the targets not using boost and boost pin is kept
floating there will be high change that VDD_A53 will be
grounded and MSM will not be responsive
After discussing with PMIC systems team SBL team came up
with the work around to configure the boost register to some
pre defined values so that the issue is not reproduced.
As part of the codec init sequence the codec driver will
reset the analog part of the codec and as part of this sequence
the cofiguration done by the SBL will be defaulted.
This change will restore the 0x1C6 register if it has been configured
by SBL
Change-Id: I1a58b665b01e70bbb21b06665a8fb422d77a5ee7
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Gain for TX decimator block needs to be set after the
corresponding decimator is enabled. Otherwise, gain will
not take affect. Apply the gain by reading from regmap cache
to the codec decimator hardware after decimator is enabled.
CRs-fixed: 982473
Change-Id: Ib2d189b56e58b038a343fc974e6e3b8ef29f982d
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
commit 5e82d2be6ee53275c72e964507518d7964c82753 upstream.
While performing hw_free, DPCM checks the BE state but leaves out
the suspend state. The suspend state needs to be checked as well,
as we might be suspended and then usermode closes rather than
resuming the audio stream.
This was found by a stress testing of system with playback in
loop and killed after few seconds running in background and second
script running suspend-resume test in loop
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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>
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>
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Update codec driver in compliance with the codec device bring up
and tear down,
Also include the critical fixes in codec driver fixed.
Change-Id: I7a468a40f18315fe8a065f13b05e7410a8d54b4c
Signed-off-by: Santosh Mardi <gsantosh@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>
commit a1068045883ed4a18363a4ebad0c3d55e473b716 upstream.
The detection of direction for compress was only taking into account codec
capabilities and not CPU ones. Fix this by checking the CPU side capabilities
as well
Tested-by: Ashish Panwar <ashish.panwar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit e73694d871867cae8471d2350ce89acb38bc2b63 upstream.
For a sample rate of 12kHz the bclk was taken from the 44.1kHz table as
we test for a multiple of 8kHz. This patch fixes this issue by testing
for multiples of 4kHz instead.
Signed-off-by: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Minor version for some of the CPE commands should be
of value "1". Update the minor versions appropriately
for some of the CPE commands.
Change-Id: I034bbe156aab57410aa629f531b9c1eec3489b4f
Signed-off-by: Banajit Goswami <bgoswami@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 also.
Change-Id: Ibed962eaacf87c3eb55c569d2ae9c6363a63cace
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
The data channel for buffering has two endpoints, one on the MSM and
another on the codec. When codec endpoint is torn down, it waits for an
interrupt for channel teardown from hardware. But, since MSM endpoint is
still connected, the interrupt is never receieved and the codec wait
gets timed out. This adds delay in data channel teardown. Fix this issue
by making sure the MSM endpoint is torn down first and then the codec
endpoint gets torn down.
CRs-fixed: 940132
Change-Id: Ie6529e9269aa29fb3d312b816c3d83e9e3e6e10e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
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>
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>
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>
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>
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>
Reduce insert and remove debounce value on wcd9335 to 96msec
to improve device switch latency during audio playback usecase.
Change sets the insert and remove debounce to 96msec.
Change-Id: I62a4e29af050da3b6be4afc1267b1b03f786c63e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
The buffer used for look-ahead-buffering is allocated during IOCTL from
userspace. It is possible that userspace can invoke this IOCTL multiple
times without invoking the IOCTL to de-allocate the buffer. This results
in out of memory issue for buffer allocation during stress testing. Fix
this issue by avoiding multiple buffer allocations.
CRs-fixed: 942452
Change-Id: Id9eb99dc2c8527fbbe1fe79fca1cdcea232c33da
Signed-off-by: Bhalchandra Gajare <gajare@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>
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>
Clear TX HOLD when ANC is enabled and decimator
10 to 13 are selected.
Change-Id: I18c1ddeacc59c1ae7d88daf371c84140c0459693
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
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>
Since the underlying codec can have different memory map, it is possible
the starting offset and size for DRAM can be different as well. This
causes the collected dumps to be incorrect on some platforms. Fix the
ramdump collection to obtain DRAM offset and size from CPE services
which is aware of the codec being used.
CRs-fixed: 929517
Change-Id: I6a592d8f97da117d1e58154460cd0b8f3cbf62c7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The DRAM size used for codec WCD9335 is incorrect, this is causing the
dumps to be wrong. Update the DRAM size for WCD9335 as per the memory
map.
CRs-fixed: 929517
Change-Id: Ie4815b4cedf429b0d7045b84381d945bde62d5ce
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
When BUSID pin is connected to ground, wsa speaker should be
set as left. When it is connected to VDD, wsa speaker should
be set as right. Current setting is inversed.
Correct stereo wsa speaker left/right setting for 8976.
Change-Id: If2b44be202f084d76cd9e58307d36c3fce802e3f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Port fixes for TX pop and spkr gain updates for tasha.
Also add fix in WSA for retry when device re-enumeration.
Change-Id: I6573517a101a4e5b0c34ef07a78c7dd0a4f127e5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In device switch from bongo speaker to HPH, observe
pop in headset. Since the PA select bit is changed
to HPH before DAC disable when tearing down bongo
speaker, this can result in pop in headset. Move
the PA selection bit to be changed to HPH after
PA and DAC disable.
Change-Id: Idb4f96f03880563e4bb81b98f623b6b05f27da8e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
After SSR, MICBIAS is not enabled as micb_ref is not correct.
So set micb_ref to zero post SSR.
Change-Id: Iaffa7a29799a9b3ed7a46da3cb11a2d4c47e45e9
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
From second detection onwards, buffered data has one extra
stale sample before the actual data even though CPE TX PP
(PingPong) buffer is properly disabled. Avoid this extra data
by clearing TX PP buffer memory after reading the complete buffer.
Change-Id: Id3183f64136e827641ab4d00450dbdb7806f00ab
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Default FIFO watermark value is set as 8 bytes. Observed data skipping
randomly at higher sample rates with default watermark value. Increase
the watermark value to 16 bytes to avoid data loss.
Change-Id: Ic595f62f243b6087ceb2dc61089f957b6a6f8121
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
When userspace requests small duration of buffer then it is possible
that the buffer can overflow if only one buffer is queued at a time.
This is because of more channel setup time than buffer size duration.
Queue two buffers with slimbus before starting AFE port to avoid
data loss.
Change-Id: Iabb6f6b1d0e3ee8227ed8be26a64e7eb025e7018
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently 16KHz is the maximum supported CPE data transfer
rate. Add support to transfer LAB(Look Ahead buffer) data
from CPE at maximum rate of 384KHz/32bit.
Change-Id: Ic4475d91ca2962c90f424816ef03df0a68ccdf92
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
CPE PP(ping-pong) buffer hardware block is added to support
higher data transfers from CPE in WCD9335 V2. Update codec
driver to enable CPE PP buffer path.
Change-Id: I030cef25d6eddc72a02859f6ee78f201efc3dd43
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently only one CPE AFE output port is supported. Add
an API to get CPE AFE port ID from codec driver. Use that
port ID for LAB buffering.
Change-Id: I74fdeb1800a64ed775608967e4d315f28d48e9ef
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>