Commit graph

10650 commits

Author SHA1 Message Date
Linux Build Service Account
f1af63f8a2 Merge "ASoC: wcd9335: Fix out of bounds for mad input value" 2017-01-06 04:11:04 -08:00
Linux Build Service Account
3379409aeb Merge "ASoC: wcd9330: Fix out of bounds for mad input value" 2017-01-06 04:11:03 -08:00
Linux Build Service Account
797e984939 Merge "ASoC: wcd9320: Fix out of bounds for mad input value" 2017-01-06 04:11:02 -08:00
Xiaojun Sang
1a0bf95d9a ASoC: soc: prevent risk of buffer overflow
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>
2017-01-05 02:06:52 -08:00
Xiaojun Sang
a9e79718d1 ASoC: qdsp6v2: fix potential bug of infinite loop
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>
2017-01-05 01:52:41 -08:00
Bhalchandra Gajare
530f3a0fd8 ASoC: msm-lsm-client: cleanup ioctl functions
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>
2017-01-03 23:31:16 -08:00
Xiaojun Sang
ae6485b965 ASoC: soc: msm: initialize buffer to prevent kernel data leakage
To prevent potential kernel stack data leakage, initialize
channel_map[].

CRs-Fixed: 1100878
Change-Id: I7b81cea20485bc7514551672bb54c7fd455049e3
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2017-01-03 23:23:11 -08:00
Karthikeyan Mani
1e895f4704 ASoC: wcd9335: Fix out of bounds for mad input value
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>
2017-01-03 23:18:55 -08:00
Karthikeyan Mani
424c78e96d ASoC: wcd9330: Fix out of bounds for mad input value
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>
2017-01-03 23:18:39 -08:00
Karthikeyan Mani
c9198deaef ASoC: wcd9320: Fix out of bounds for mad input value
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>
2017-01-03 23:18:29 -08:00
Sharad Sangle
6b7ecac777 ASoC: msm: qdsp6v2: DAP: Add check to validate param length
To avoid buffer overflow, validate input length used to
fetch visualizer data.

CRs-fixed: 1096672
Change-Id: I224bc2f20d94182713c565972fb0bd52cad6f3fd
Signed-off-by: Sharad Sangle <assangle@codeaurora.org>
2017-01-03 22:29:31 -08:00
SoumyaManagoli
c96c94eac1 ASoC: msm: Update 8952-slimbus driver with AVS 2.7 support
Update machine driver AFE API calls compatible
with adsp version AVS 2.6 and AVS 2.7.

CRs-Fixed: 1094689
Change-Id: Ida8ead8a2826b5b7e69f503fdda32a7aa9a421b5
Signed-off-by: SoumyaManagoli <smanag@codeaurora.org>
2016-11-29 17:40:24 +05:30
Laxminath Kasam
227ec1921d ASoC: msm: Update machine driver with AVS 2.7 support
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>
2016-11-15 10:56:47 +05:30
Laxminath Kasam
d990217def ASoC: msm: add support for AVS 2.7 in native drivers
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>
2016-11-14 18:46:24 +05:30
Ramlal Karra
2e6a457e55 ASoC: msm: qdsp6v2: Add support to query adsp version
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>
2016-11-14 18:37:12 +05:30
Karthik Reddy Katta
51464dccb7 ASoC: msm: qdsp6v2: Fix timeout error in ADM_CMD_SET_PP_PARAMS_V5
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>
2016-11-04 00:05:38 -07:00
Ravi Kumar Siddojigari
4d27721b0d ASoC: Add args validation in snd_soc_read/write functions
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>
2016-10-27 22:05:28 -07:00
Rohit kumar
275037e9ea ASoC: msm8x16-wcd: Remove 20ms sleep in rx chain PMD
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>
2016-10-18 21:00:28 -07:00
Laxminath Kasam
86db9a5bfb ASoC: msm: add q6core ready check before io access
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>
2016-10-13 00:16:45 -07:00
Shiv Maliyappanahalli
a712ad950d ASoC: msm: qdsp6v2: set token for stereo_to_custom_stereo command
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>
2016-10-02 23:43:02 -07:00
Linux Build Service Account
2836feb0dc Merge "ASoC: msm: initialize the params array before using it" 2016-09-26 17:26:13 -07:00
Linux Build Service Account
446cc1e68e Merge "ASoC: soc: change audio drivers to use %pK" 2016-09-26 11:16:15 -07:00
Linux Build Service Account
ce4f8c5835 Merge "ASoC: soc: change audio cpe drivers to use %pK" 2016-09-26 11:16:15 -07:00
Walter Yang
62c02898a5 ASoC: msm: initialize the params array before using it
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>
2016-09-26 02:51:09 -07:00
Xiaojun Sang
5c5b851abe ASoC: soc: change audio drivers to use %pK
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>
2016-09-26 01:40:40 -07:00
Xiaojun Sang
9eb9c42ff3 ASoC: soc: change audio cpe drivers to use %pK
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>
2016-09-26 01:39:51 -07:00
Surendar karka
de37ad8632 ASoC: msm: qdsp6v2: check param length for EAC3 format
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>
2016-09-26 00:22:51 -07:00
Linux Build Service Account
d5184a8945 Merge "ASoC: utils: initialize dummy_codec before use" 2016-09-23 23:19:21 -07:00
Linux Build Service Account
c0e54e6166 Merge "ASoC: wcd-mbhc: correct cross connection check" 2016-09-23 23:19:20 -07:00
Linux Build Service Account
13bf74d005 Merge "ASoC: wcd-mbhc: fix inconsistent detection of euro headset" 2016-09-23 23:19:20 -07:00
Linux Build Service Account
9566895a9e Merge "ASoC: msm: Add Buffer overflow check" 2016-09-23 11:49:43 -07:00
Yeleswarapu Nagaradhesh
ef97090632 ASoC: wcd-mbhc: correct cross connection check
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>
2016-09-22 23:20:56 -07:00
dojha
dc6b448e93 ASoC: wcd-mbhc: fix inconsistent detection of euro headset
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>
2016-09-22 23:18:57 -07:00
Karthik Reddy Katta
b7094c554f ASoC: msm: Add Buffer overflow check
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>
2016-09-22 12:24:46 -07:00
Meng Wang
2dbcc6fa22 ASoC: utils: initialize dummy_codec before use
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>
2016-09-22 12:14:07 -07:00
Laxminath Kasam
8aa27b7359 ASoC: wcd9335: reduce speaker teardown latency
In tasha codec, speaker teardown latency is high.
Acquire clock gear for complete teardown sequence
to improve latency.

CRs-Fixed: 1065561
Change-Id: I7db756e363cb66d22eb5d516e6e512e89e26e6a3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-09-21 05:09:46 -07:00
Walter Yang
653f4571de ASoC: msm: set pointers to NULL after kfree
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>
2016-09-12 04:21:41 -07:00
Pradosh Das
72b69ffec9 Merge commit 'b73847a75055daf57295a8d32fd2c3f998d0b72a' into HEAD
Change-Id: I240d1eae11f98e46ac3c3dfbd69805e4343921fd
Signed-off-by: Pradosh Das <prados@codeaurora.org>
2016-09-08 23:14:17 +05:30
Laxminath Kasam
abe32f1ca0 ASoC: wcd9335: Fix compander disable after SSR
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>
2016-09-01 02:59:38 -07:00
Ashish Jain
246ecc54ee ASoC: msm: qdsp6v2: DAP: Enable non DAP modules on DAP disable
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>
2016-08-24 19:59:33 -07:00
Linux Build Service Account
ed6472d52e Merge "ASoC: msm: qdsp6v2: DAP: Update check to validate data length" 2016-08-09 22:23:36 -07:00
Phani Kumar Uppalapati
6c6a0906bd ASoC: wcd9335: Enable standalone ldo_h
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>
2016-08-04 13:16:46 +05:30
Ashish Jain
56c4e8930e ASoC: msm: qdsp6v2: DAP: Update check to validate data length
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>
2016-07-31 20:59:44 -07:00
Ben Romberger
515a74b801 ASoC : msm: qdsp6v2: Add size check in audio cal ioctl
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>
2016-07-27 01:12:43 -07:00
Pradosh Das
571b43a792 Merge commit '4742aa9efad673157273b07095ac1070dd2f02ea' into HEAD
Conflicts:
        drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
        sound/soc/msm/msm8952-slimbus.c

Change-Id: If4516c52837e61afda301496b9053cb44ea59dd9
Signed-off-by: Pradosh Das <prados@codeaurora.org>
2016-07-26 12:02:09 +05:30
Ashish Jain
07120b47e5 ASoC: msm: qdsp6v2: DAP: Update check to validate data length
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>
2016-07-21 07:48:02 -07:00
Linux Build Service Account
a5ed42c3d4 Merge "ASoc: wcd9335: Fixed supported sample rates in tash_mad1 DAI" 2016-07-21 04:32:14 -07:00
Laxminath Kasam
abd1f28cc0 ASoC: dapm: correct the macro to SND_SOC_DAPM_CLASS_RUNTIME
macro SND_SOC_DAPM_CLASS_PCM is deprecated.
Replace with updated macro SND_SOC_DAPM_CLASS_RUNTIME.

Change-Id: I1f94a32f2b6020eea84923019631caf9c3c63128
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-07-18 00:14:43 -07:00
Pavan Chikkala
212bbc2898 ASoc: wcd9335: Fixed supported sample rates in tash_mad1 DAI
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>
2016-07-14 23:28:24 -07:00
Linux Build Service Account
8d8a1d03fd Merge "ASoc: wcd9335: Fixed supported sample rates in tash_mad1 DAI" 2016-07-14 05:16:22 -07:00
Pavan Chikkala
cf00836d49 ASoc: wcd9335: Fixed supported sample rates in tash_mad1 DAI
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>
2016-07-13 16:19:27 +05:30
Linux Build Service Account
0fadfecd42 Merge "ASoC: open ASM session with 24 bit for 24 bit playback." 2016-07-12 10:18:48 -07:00
Linux Build Service Account
05e74ad58b Merge "ASoC: msm: qdsp6v2: Change audio drivers to use %pK" 2016-07-12 03:35:22 -07:00
Linux Build Service Account
528f8330ca Merge "ASoC: msm: qdsp6v2: DAP: Add check to validate data length" 2016-07-11 06:53:37 -07:00
Linux Build Service Account
ce1abd96b0 Merge "ASoC: msm: qdsp6v2: DAP: Add check to validate param length" 2016-07-11 06:53:37 -07:00
Ashish Jain
f73d6c9c8c ASoC: msm: qdsp6v2: DAP: Add check to validate data length
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>
2016-07-10 23:57:44 -07:00
Ramjee Singh
4615ac6e00 ASoC: open ASM session with 24 bit for 24 bit playback.
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>
2016-07-08 10:56:37 +05:30
Ashish Jain
952e938f8c ASoC: msm: qdsp6v2: DAP: Add check to validate param length
To avoid buffer overflow, validate input length used to
fetch visualizer data.

CRs-Fixed: 1033540
Change-Id: I445d1ba3bce47308bc31ae24a70d5ee358f22a2d
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
2016-07-05 00:10:02 -07:00
Ashish Jain
a7dc368b80 ASoC: msm: qdsp6v2: DAP: Allocate param buffer with correct size
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>
2016-07-05 00:09:27 -07:00
Manish Dewangan
03780f6d89 ASoC: wcd9335: add support for packed 24 bit.
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>
2016-07-01 15:33:05 +05:30
Ben Romberger
bccff9608d ASoC: msm: qdsp6v2: Change audio drivers to use %pK
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>
2016-06-28 00:42:15 -07:00
Santosh Mardi
55c3562b2f ASoC: WCD9335: important changes on tasha codec
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>
2016-06-22 03:01:23 -07:00
Alexy Joseph
75ba72b4f3 ASoC: msm: qdsp6v2: Increase period size for pcm driver.
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>
2016-06-16 03:10:33 -07:00
Arnd Bergmann
fba8a3ecb4 ASoC: s3c24xx: use const snd_soc_component_driver pointer
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>
2016-06-07 10:42:51 +02:00
Manish Dewangan
742694c6fb ASoC: msm8952: add support for packed 24 bit.
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>
2016-06-03 04:07:24 -07:00
Manish Dewangan
3fbc74ea17 ASoC: msm8x16-wcd: add support for packed 24 bit.
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>
2016-06-03 04:06:56 -07:00
Manish Dewangan
0915628790 ASoC: msm8x16-wcd: add support for packed 24 bit.
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>
2016-06-03 04:06:10 -07:00
Manish Dewangan
db1c78108c ASoC: msm: qdspv2: add support for MULTI_CHANNEL_PCM_V3 command
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>
2016-06-03 04:05:35 -07:00
Haynes Mathew George
db6966ecd4 ASoC: msm: qdsp6v2: pull mode playback and push mode record.
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>
2016-06-03 04:05:03 -07:00
Weiyin Jiang
fc035bdcc2 ASoC: msm: audio-effects: misc fixes in h/w accelerated effect
Adding memory copy size check and integer overflow check in h/w
accelerated effect driver.

Change-Id: I17d4cc0a38770f0c5067fa8047cd63e7bf085e48
CRs-Fixed: 1006609
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-26 13:27:30 -07:00
Linux Build Service Account
e3c387bbc6 Merge "ASoC: msm: audio-effects: fix stack overread and heap overwrite" 2016-05-23 09:48:03 -07:00
Weiyin Jiang
29bf42e49d ASoC: msm: audio-effects: fix stack overread and heap overwrite
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>
2016-05-23 02:34:21 -07:00
Weiyin Jiang
68f1526ec9 ASoC: msm: audio-effects: misc fixes in h/w accelerated effect
Adding memory copy size check and integer overflow check in h/w
accelerated effect driver.

Change-Id: I17d4cc0a38770f0c5067fa8047cd63e7bf085e48
CRs-Fixed: 1006609
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-19 00:31:15 -07:00
Linux Build Service Account
32db365f05 Merge "ASoC: dapm: Fix race condition with dapm mutex lock" 2016-05-10 02:46:45 -07:00
Linux Build Service Account
de19f6de35 Merge "swr-wcd-ctrl: Ensure soundwire banks are always in sync" 2016-05-10 02:46:43 -07:00
Ashish Jain
6e267f07e8 ASoC: msm: qdsp6v2: DAP: Fix buffer overflow
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>
2016-05-06 05:27:39 -07:00
Laxminath Kasam
7e17b8ec9b ASoC: msm: pass clk_div2 value when enable and disable
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>
2016-05-04 11:11:30 -07:00
Laxminath Kasam
0517f5ae6f ASoC: dapm: Fix race condition with dapm mutex lock
In headset usecase, observe race condition for
dapm mutex lock. snd_soc_dapm_put_pin_switch,
snd_soc_dapm_force_enable_pin, snd_soc_dapm_set_pin
APIs are updated to handle the lock correctly.

Change-Id: I6910d28869dc172f80232f8fd6b11db10f52f59b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-05-03 06:09:52 -07:00
Phani Kumar Uppalapati
4a6320a4c5 ASoC: wsa881x: Request device ungroup for speaker disable
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>
2016-05-03 04:51:21 -07:00
Ashish Jain
4aecfab390 ASoC: msm: qdsp6v2: DAP: Fix buffer overflow
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>
2016-04-29 03:21:36 -07:00
Santosh Mardi
39326a27dd ASoC: msm: critical tasha fixes for 48x2 frames
pulled in the changes from the below commits.

Ia4329ac982eb2a29a2b925897cd87ca9711c30e3
Ic0ab015098035418458a5ba7c2ffad9df20f933c
Ia091228b5a6e6d3dced2bee6cd5fecf5632a62a0

Change-Id: Ie89d37060a73a190f752eebf226c630a903f0c1b
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-04-26 03:11:39 -07:00
Linux Build Service Account
29dd47b53a Merge "ASoC: WCD9335: important changes on tasha codec" 2016-04-18 09:47:50 -07:00
Santosh Mardi
6c21d6ca04 ASoC: WCD9335: important changes on tasha codec
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>
2016-04-13 05:26:48 -07:00
Linux Build Service Account
7386fee655 Merge "ASoC: msm: donot set thresholds for moisture detection" 2016-04-13 04:27:41 -07:00
Linux Build Service Account
a1ec19d175 Merge "ASoC: msm: critical tasha fixes" 2016-04-12 08:14:33 -07:00
Laxminath Kasam
86b7482e23 ASoC: msm8x16-wcd: Fix SSR mute issue on speaker
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>
2016-04-11 05:42:49 -07:00
Santosh Mardi
6203e5d262 ASoC: msm: critical tasha fixes
tasha fixes pulled in by the below change id.

I4ca4a554c0a83d4053301ca5dd2afb8b09fa5194
I2cb4447b36fef111ed1f9b8991b3882b8d57f6a7
I80ee0dedac8fa81ce54a0e61c839a97b9b45d36b

Change-Id: I258d5bb48a25f13e0c0f348a8f6a7bf1b38922d0
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-03-22 13:04:44 +05:30
Yeleswarapu Nagaradhesh
e1da4961c9 ASoC: msm: donot set thresholds for moisture detection
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>
2016-03-18 18:39:32 +05:30
Takashi Iwai
86ac250ac1 ASoC: wm8958: Fix enum ctl accesses in a wrong type
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>
2016-03-16 08:41:36 -07:00
Takashi Iwai
2f2ba1da9c ASoC: wm8994: Fix enum ctl accesses in a wrong type
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>
2016-03-16 08:41:36 -07:00
Linux Build Service Account
186fb6e30c Merge "ASoC: msm: critical tasha fixes" 2016-03-10 19:53:30 -08:00
Linux Build Service Account
386f581369 Merge "ASoC: msm8x16: update boost config register" 2016-03-10 08:38:59 -08:00
Santosh Mardi
1adeaee336 ASoC: msm: critical tasha fixes
tasha fixes pulled in by the below change id.

I7d7c3243c63cd3b9242a15344ecdae89ec9ee977
I30ed6a337c3bb08f6197f7ee575b323f0b0acfac
I585a81e6c01b4ddd249f76614fb933beea3755fc
I744bafb78560f39806d656c98582d8162fa10dfd
I256d183b830c9addf1bd07264c2ed9b069762a36

Change-Id: Iaec182b20f5db96b09d26ae0b1e8cdf964abc272
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-03-10 16:09:45 +05:30
Santosh Mardi
960f83a1a9 ASoC: msm8x16: update boost config register
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>
2016-03-07 21:24:40 -08:00
Phani Kumar Uppalapati
632b5da9b4 ASoC: wcd9335: Update TX gain correctly after decimator enable
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>
2016-02-29 22:04:04 -08:00
Vinod Koul
f042b75af1 ASoC: dpcm: fix the BE state on hw_free
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>
2016-02-19 14:22:39 -08:00
Linux Build Service Account
ac29f66c3b Merge "ASoC: wcd-mbhc: Add pointer validation checks in wcd-mbhc-v2.c" 2016-02-09 02:52:10 -08:00
Karthik Reddy Katta
bfc2d94474 ASoC: wcd-mbhc: Add pointer validation checks in wcd-mbhc-v2.c
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>
2016-02-07 07:17:26 +05:30
Santosh Mardi
c0836c8365 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>
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-02-01 22:58:47 +05:30
Santosh Mardi
ced48f7a4a ASoC: wcd9335: update codec driver according to QCRG 22
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>
2016-02-01 22:52:44 +05:30
Bhalchandra Gajare
0f2881a424 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-01-31 21:10:04 -08:00
Vinod Koul
9a76e683b6 ASoC: compress: Fix compress device direction check
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>
2016-01-28 21:49:31 -08:00
Nikesh Oswal
1702ac2fae ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz
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>
2016-01-28 21:49:31 -08:00
Sachin Pandhare
48436c8169 ASoC: wm8962: correct addresses for HPF_C_0/1
commit e9f96bc53c1b959859599cb30ce6fd4fbb4448c2 upstream.

From datasheet:
R17408 (4400h) HPF_C_1
R17409 (4401h) HPF_C_0
17048 -> 17408 (0x4400)
17049 -> 17409 (0x4401)

Signed-off-by: Sachin Pandhare <sachinpandhare@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-28 21:49:31 -08:00
Banajit Goswami
6dc16be24f ASoC: wcd_cpe_core: fix minor version for CPE commands
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>
2016-01-12 21:24:06 -08:00
Linux Build Service Account
439728d4bc Merge "ASoC: wcd9335: fix mute issue on headphone during concurrency" 2016-01-12 09:40:05 -08:00
Vidyakumar Athota
8cb35f09d0 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 also.

Change-Id: Ibed962eaacf87c3eb55c569d2ae9c6363a63cace
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2016-01-11 01:13:54 -08:00
Bhalchandra Gajare
7a75d9ed2a ASoC: msm-cpe: Fix sequence for data channel teardown
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>
2016-01-10 21:47:39 -08:00
Bhalchandra Gajare
93bf48e2f8 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-01-07 03:36:52 -08:00
Bhalchandra Gajare
135b4bfbbd 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>
2015-12-28 15:35:59 +05:30
Linux Build Service Account
3d614e166e Merge "ASoC: msm-lsm-client: free lsm client data in msm_lsm_close" 2015-12-25 00:36:24 -08:00
Linux Build Service Account
331b4090c5 Merge "ASoC: wcd_cpe_core: Perform irq cleanup once the bus is up" 2015-12-25 00:36:23 -08:00
Linux Build Service Account
c0b938d67e Merge "ASoC: wcd9335: Fix internal clock enable during SSR" 2015-12-24 18:09:23 -08:00
Vidyakumar Athota
546f362e97 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>
2015-12-24 01:53:33 -08:00
Bhalchandra Gajare
cf46be12f9 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>
2015-12-24 01:51:30 -08:00
Bhalchandra Gajare
68136bf124 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>
2015-12-24 01:50:21 -08:00
Bhalchandra Gajare
7db6403fbb 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>
2015-12-23 02:35:18 -08:00
Linux Build Service Account
7b296b52d9 Merge "ASoC: wcd_cpe_services: delete the redundant worker thread" 2015-12-22 04:47:05 -08:00
Linux Build Service Account
d23b7aeec2 Merge "ASoC: wcd_cpe_services: Fix DRAM size for WCD9335" 2015-12-22 04:47:01 -08:00
Linux Build Service Account
6495302484 Merge "ASoC: wcd_cpe_core: Fix address and size for ramdumps" 2015-12-22 04:47:00 -08:00
Linux Build Service Account
2dba80e36f Merge "ASoC: msm-cpe-lsm: Fix out of memory on buffer allocation" 2015-12-22 04:46:59 -08:00
Linux Build Service Account
fd175ae6f5 Merge "ASoC: wcd-mbhc: reduce insert and remove debounce on wcd9335" 2015-12-22 04:46:58 -08:00
Sudheer Papothi
e26b6ab560 ASoC: wcd-mbhc: reduce insert and remove debounce on wcd9335
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>
2015-12-17 02:16:20 -08:00
Bhalchandra Gajare
488973e30e ASoC: msm-cpe-lsm: Fix out of memory on buffer allocation
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>
2015-12-17 00:45:24 -08:00
Linux Build Service Account
5499e3b5c7 Merge "ASoC: msm: Add support for HW MAD bypass feature for listen" 2015-12-16 23:09:22 -08:00
Walter Yang
aec82b54fc 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>
2015-12-16 22:22:24 -08:00
Linux Build Service Account
dc13208569 Merge "ASoC: wcd9335: Clear TX HOLD for ANC input MUX'es" 2015-12-16 13:17:19 -08:00
Venkata Narendra Kumar Gutta
053e755ca8 ASoC: msm: Add support for HW MAD bypass feature for listen
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>
2015-12-15 20:03:55 -08:00
Phani Kumar Uppalapati
a651e3c85f ASoC: wcd9335: Clear TX HOLD for ANC input MUX'es
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>
2015-12-14 09:11:51 -08:00
Phani Kumar Uppalapati
1a968d5fc2 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>
2015-12-14 05:58:18 -08:00
Bhalchandra Gajare
f01927ebcd ASoC: wcd_cpe_core: Fix address and size for ramdumps
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>
2015-12-12 00:52:40 -08:00
Linux Build Service Account
f04aae3c62 Merge "ASoC: msm: fix indefinite wait in compress drain" 2015-12-11 18:49:17 -08:00
Bhalchandra Gajare
ac9b9130b2 ASoC: wcd_cpe_services: Fix DRAM size for WCD9335
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>
2015-12-10 23:58:27 -08:00
Linux Build Service Account
5a42580d46 Merge "ARM: dts: msm: correct stereo wsa speaker setting for 8976 devices" 2015-12-04 12:44:22 -08:00
Linux Build Service Account
b5154c4552 Merge "ASoC: msm8x16-wcd: Fix hph pop in switching usecase" 2015-12-04 12:44:22 -08:00
Linux Build Service Account
182099f21d Merge "ASoC: wcd9335: re-set micb_ref to zero post SSR" 2015-12-04 12:44:20 -08:00
Linux Build Service Account
0fb91456df Merge "ASoC: wcd9335: add fixes for TX pop and spkr gain updates" 2015-12-04 12:43:59 -08:00
Linux Build Service Account
953d2255a4 Merge "ASoC: msm: increase slimbus channel FIFO watermark value" 2015-12-04 12:43:28 -08:00
Linux Build Service Account
75b4505e08 Merge "ASoC: msm-cpe-lsm: Queue 2 buffers with slimbus before afe start" 2015-12-04 12:43:27 -08:00
Linux Build Service Account
36a98dc86c Merge "ASoC: msm: add support for faster CPE data transfer rate" 2015-12-04 12:43:26 -08:00
Yeleswarapu Nagaradhesh
676c042483 ARM: dts: msm: correct stereo wsa speaker setting for 8976 devices
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>
2015-12-03 03:51:57 -08:00
Laxminath Kasam
984910d8e0 ASoC: wcd9335: add fixes for TX pop and spkr gain updates
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>
2015-12-01 02:38:44 -08:00
Laxminath Kasam
4469042b92 ASoC: msm8x16-wcd: Fix hph pop in switching usecase
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>
2015-11-26 21:37:29 -08:00
Yeleswarapu Nagaradhesh
a93236328e ASoC: wcd9335: re-set micb_ref to zero post SSR
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>
2015-11-26 21:31:26 -08:00
Vidyakumar Athota
a54b5908ff ASoC: wcd9335: reset CPE TX PP buffer memory
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>
2015-11-19 03:01:43 -08:00
Vidyakumar Athota
8222a86039 ASoC: msm: increase slimbus channel FIFO watermark value
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>
2015-11-19 02:58:46 -08:00
Vidyakumar Athota
8d96120d13 ASoC: msm-cpe-lsm: Queue 2 buffers with slimbus before afe start
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>
2015-11-19 02:52:41 -08:00
Vidyakumar Athota
a9e07835aa ASoC: msm: add support for faster CPE data transfer rate
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>
2015-11-19 02:49:28 -08:00
Vidyakumar Athota
68f2f0ccea ASoC: wcd9335: add support for CPE PP buffer
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>
2015-11-19 02:46:30 -08:00
Vidyakumar Athota
dd2229b265 ASoC: wcd_cpe_core: add support to select CPE AFE port
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>
2015-11-19 02:42:34 -08:00