Commit graph

47 commits

Author SHA1 Message Date
Vignesh Kulothungan
a935cbe437 msm: adm: validate ADSP payload size before access
Check the size of ADSP payload before accessing it.

CRs-Fixed: 2380694
Change-Id: Icdc19a85b39a397ba6d7177f42ece4626b901832
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-05-22 12:18:41 -07:00
Linux Build Service Account
daa592e855 Merge "ASoC: msm: Support different POPPs to single COPP" 2018-06-21 13:37:46 -07:00
Aditya Bavanari
c966bc9cff ASoC: msm: qdsp6v2: Fix return code check in adm driver
Return error only if apr_send_pkt() function
return code is less than 0.

CRs-Fixed: 2262017
Change-Id: I98903c6c275f360d32c3af523352071d92d1ef85
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 17:31:10 +05:30
Cong Tang
c1bed40d2d ASoC: msm: Support different POPPs to single COPP
For multi COPP feature it could only allow POPPs with same app_type
to connect single COPP. But it's possible to connect different POPPs
with different app_type to single COPP, to achieve this, it should
skip the app_type check when create copp_idx.

Change-Id: Ic8d7c63d317baba09768d08bc723a6b097322f63
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-06-18 20:54:41 -07:00
Cong Tang
d82892ea91 ASoC: msm: Update channel mixer weight mixer control
Update channel mixer weight controls to support maximum 32 channels
then it could configure maximum to 32 channels by apply
weight coefficient.

Change-Id: Ibf9c130ceba23fbe086c640505c8e348c40d9ffe
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-04-23 22:35:41 -07:00
Linux Build Service Account
0c10164313 Merge "ASoC: msm: Upgrade ADM Driver to support 32 Channels" 2018-03-23 03:32:44 -07:00
Linux Build Service Account
cbae14bbfc Merge "ASoC: msm: Fix KW issues for audio drivers" 2018-03-21 10:10:17 -07:00
Cong Tang
82c2a635bd ASoC: msm: Upgrade ADM Driver to support 32 Channels
HLOS update adm driver to support ADM_CMD_OPEN_V8 for 32 channels
playback and capture capability. The endpoint payload of this
cmd should be the real channel mapping length and aligned with
four bytes.

Change-Id: I943259108becdfd27a68ce597bee37641cfc8339
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-03-20 22:35:14 -07:00
Tony Han
0152bff079 ASoC: msm: Fix KW issues for audio drivers
The fixed issues include variable initialization missing and improper NULL
pointer checking.

Change-Id: I5302cf84f7f0414fe0cf69ccc0cafc8225142c5f
Signed-off-by: Tony Han <xiahan@codeaurora.org>
2018-03-15 13:52:52 +08:00
Cong Tang
4449171493 ASoC: msm: Support Channel Mixer Cfg
Enhance Channel Mixer controls for MultiMedia Frontend.

Change-Id: Ifedac25de5ae6bad1092b66ec405bba66a80f608
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-03-02 14:56:24 +08:00
Meng Wang
3979085e74 ASoC: msm: qdsp6v2: correct return value check
When the return value of adm_populate_channel_weight is 0, it should
keep running, not return error.

Change-Id: I447b81d6edfc89db6cb3742c1719e745c6071c12
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2018-01-22 21:05:00 -08:00
Aditya Bavanari
c0e1cac7ec ASoC: msm: qdsp6v2: Update dap driver to support Instance ID
Add support to set and get dap modules params with
Instance ID support for both Dolby and DS2.
Maintain support for non Instance ID set and get param
structures as well. Use common pack and set param
functions to set and get parameters to DSP instead of
handling them at an individual module level.

CRs-Fixed: 2151551
Change-Id: Ic2722cf5d686a7b10c682ca7866f7900da9d0cdb
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2017-12-21 11:17:53 +05:30
Aditya Bavanari
2ee870a5d5 ASoC: msm: qdsp6v2: Update ADM driver to support Instance ID
Add support to set and get ADM module params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.
Use common pack and set param functions to set and
get parameters to DSP instead of handling them at an
individual module level.

CRs-Fixed: 2151551
Change-Id: Ida9591e96501a2edbffe080eb8531c860bde8539
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2017-12-21 11:16:58 +05:30
Haynes Mathew George
aa5d0fc240 ASoC: msm: qdsp6v2: Open unique COPP port for concurrent ULL streams
Routing driver reuses the same adm for streams with the same
app_type, sample_rate etc. This isn't allowed for ULL streams
as per the DSP interface. We need to open a separate COPP
port for concurrent ULL streams

CRs-Fixed: 2083105
Change-Id: I569b32830145d6dae99449d0bc4148b2f60b101d
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Acked-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2017-07-31 18:31:56 -07:00
Linux Build Service Account
a2c6e77e46 Merge "ASoC: msm: qdsp6v2: Add matrix limiter support" 2017-07-16 21:04:55 -07:00
Varun Balaraj
701ac49eb7 ASoC: q6dspv2: Support for pan-scale and downmix set param
Add support for set params on ASM/ADM for MFC and
Volume modules. Make PSPD mitrix set param api generic.

Change-Id: I75a5b9e3fd2316b75be41439848f89190944bc36
Signed-off-by: Varun Balaraj <varunb@codeaurora.org>
2017-07-13 01:47:22 -07:00
Ben Romberger
88fad2e0e1 ASoC: msm: qdsp6v2: Add matrix limiter support
Add matrix limiter to ADM. Limiter is used to
prevent saturation when mixing multiple audio
streams. It should be applied after ADM open
but before ADM matrix map.

Change-Id: I6787fe869e8ceee13694245b744ecd74c3a49682
CRs-Fixed: 2064258
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2017-06-29 14:53:48 -07:00
Linux Build Service Account
2277a4c12d Merge "ASoC: msm: qdsp6v2: Remove size checks when finding ADM cal" 2017-06-22 23:41:08 -07:00
Meng Wang
b1b77c6c11 ASoc: msm: add support for mixing data from different COPPs
Different COPPs can be mixed into one POPP when recording
data. Use ADM_CMD_SET_PSPD_MTMX_STRTR_PARAMS_V5 cmd to support
this requirement.

Change-Id: If079b586fafe84f7dec7732c7037af2f59f063c7
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2017-06-05 00:35:49 -07:00
Siddartha Shaik
c340bec5c7 ASoC: msm: Add transcode loopback driver
Add DSP transcode loopback. Userspace can use this driver
to support TX to RX audio HW DSP loopback.

CRs-Fixed: 2049714
Change-Id: Ie83f5ca2c626c8fffbec4624f3e35c6c179d4c8c
Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
2017-05-30 17:59:31 +05:30
Ben Romberger
df14423aaa ASoC: msm: qdsp6v2: Remove size checks when finding ADM cal
Remove size checking when looking for ADM calibration.
If no calibration is active for that device a size of
0 is sent. If size is checked while finding calibration
while multiple devices on the same path are active a
device where no calibration is expected will improperly
pull calibration for a different device.

Change-Id: Idfc68e879a615873c8b23d3ec4ddf8dc1dfc777c
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2017-05-26 10:22:57 -07:00
Linux Build Service Account
3e95a21f1f Merge "ASoC: qdsp6v2: Remove Eagle code" 2017-04-28 22:10:47 -07:00
Alexy Joseph
4bf68bf13c ASoC: qdsp6v2: Remove Eagle code
Eagle driver is not in use any more.
Remove the code and associated calls
to it.

CRs-Fixed: 1103106
Change-Id: Ice5333861beda9538f0783b70b3267523d16fd2b
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
2017-04-24 02:59:28 -07:00
Aditya Bavanari
4d4eafb1e2 ASoC: msm: qdsp6v2: Add support for speaker swap
Add mixer control to swap the speaker channels.
Use MFC module to update the channel mapping.

When playback is started with speaker device and
device orientation changes, swapping L/R channel
mixer control command is sent to DSP with the MFC
module.

CRs-Fixed: 1026248
Change-Id: I1d80ecc7f1e3cfb8f8cdf71c384e92a07023be5c
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-04-20 22:24:12 -07:00
Derek Chen
8457647af6 ASoC: msm: qdsp6v2: add memset of adm open before usage
Add memset of adm open v5 and v6 structure before
value assignment to avoid warning of uninitialized stack.

CRs-fixed: 1112462
Change-Id: I18681f6b191e96118fde9ae774d105dc6b677858
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2017-02-28 08:04:41 -08:00
Siena Richard
fcbf2fad44 ASoC: msm: add support for multi-copps for multiple BEs
Add support for multi-copps for multiple BEs with independent
calibration data. This allows for more accurate calibration of device
copps.

CRs-fixed: 1110411
Change-Id: I72ce501408a474eb620a088172e3c4d789ab5ef0
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2017-02-06 14:26:08 -08:00
Revathi Uddaraju
6df96093b3 ASoC: msm: qdsp6v2: Add support to connect LSM to ADM
LSM will connect to ADM to apply preprocessing and improve
detection performance. LSM can also directly connect to AFE
similar to the existing mechanism.
MAD polling will be disabled in case of LSM connects to ADM.
Add EC reference end channel, bit format and sample rate control
to configure far end params for Echo Cancellation.

Change-Id: I4684ae346884d656e95350b7a63929b91a843512
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Signed-off-by: Revathi Uddaraju <revathiu@codeaurora.org>
2017-01-30 16:54:59 +05:30
Linux Build Service Account
59656208b7 Merge "drivers: soc: qcom: Add overflow check in ADM driver" 2017-01-19 09:52:38 -08:00
Rahul Sharma
396b064d4b ASoC: msm: qdsp6v2: allow mic selection for multichannel ec
Allow MIC channel selection as the primary channel requested
by the application on Multichannel Echo Cancellation module.

CRs-fixed: 1102004
Change-Id: I94ba0f3171b4c7ebcc9936ca4f192f68de7be034
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2017-01-17 10:26:18 -08:00
Karthik Reddy Katta
1673c4655d drivers: soc: qcom: Add overflow check in ADM driver
Add overflow check for param length to prevent
heap overflow while allocating memory for
ADM parameters.

CRs-Fixed: 1103334
Change-Id: I1163aeaabbc84dba4cd0739a35ecbdee18b42717
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
2017-01-15 20:20:02 -08:00
Linux Build Service Account
efaccb4adb Merge "ASoC: msm: qdsp6v2: Add control for ICC Volume" 2017-01-12 22:39:17 -08:00
Derek Chen
b5e3d1e282 ASoC: msm: qdsp6v2: Add control for ICC Volume
Add control via ADM set PP Params to control volume of ICC
through a mixer command "Internal ICC Volume".

CRs-fixed: 1025376
Change-Id: I2b7099fe6d3a510859af42f1ac37a6db6e1b453c
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2017-01-09 10:17:59 -08:00
Derek Chen
97f8286b25 ASoC: msm: qdsp6v2: add support for ADM_OPEN_V6 for multi-mic ec
Add support for ADM_CMD_DEVICE_OPEN_V6 when the mixer path
specifies to use the multi-mic-echo-reference, which configures
the EndPoint2 for Echo Reference.

CRs-fixed: 1022080
Change-Id: I474f39a3437fa18003f4342e003d689b95837699
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2017-01-06 13:38:55 -08:00
Weiyin Jiang
41417b2031 ASoC: msm: enable DAP set license logic on 8998
Since we move to GEF implementation for Dolby post processing,
disabling DAP/DAX2 driver logic on msm8998 target except for
license validation.

CRs-Fixed: 1094027
Change-Id: I33c5625026611856f6cdd8c6e0b5d7ef229ba8c7
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-12-07 16:20:08 +08:00
Linux Build Service Account
f319f3de8b Merge "ASoC: msm: qdsp6v2: Index check for out of range" 2016-11-03 06:23:55 -07:00
Ashish Jain
9c4a39fcd6 ASoC: msm: Enable Media Format converter for all resampling usecases
With support of playback for native 384kHz, it is recommended to avoid
resampling in afe even for non fractional rates, hence enable media
format converter in all usecases whenever resampling is needed.

Change-Id: I94b9091b8349d6388fbe5c29eabe3666c86e5cce
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
2016-10-24 03:27:13 -07:00
Vikram Panduranga
7f43c41e90 ASoC: msm: qdsp6v2: Index check for out of range
Check if index is a non-negative value before it is used.
Also, initialize return variable to default value before
it is used so that it does not return uninitialized value.

CRs-Fixed: 1059495
Change-Id: I94a6fc02436734b4f398d1a72f53b3ae68612679
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2016-10-11 15:05:00 -07:00
Revathi Uddaraju
ab56d1f7bb ASoC: msm: qdsp6v2: Update device mapping for 7 channel
Add support for adm 7 channel mapping.

CRs-Fixed: 1045949
Change-Id: I85b36357bbb097b79f417c11c947f3405f0ff7ef
Signed-off-by: Revathi Uddaraju <revathiu@codeaurora.org>
2016-09-28 03:09:32 -07:00
Karthik Reddy Katta
3eec500686 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-06-23 13:56:25 -07:00
Karthik Reddy Katta
1438b8b5dd ASoC: msm: qdsp6v2: Fix unmap memory command failure
Add pointer validation checks to prevent sending
invalid handles to ADSP as part of unmap memory
regions command.

CRs-Fixed: 1018367
Change-Id: I0dfb2fccb4414ed82ee10d73576fda66a273043d
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
2016-06-17 15:15:17 -07:00
Ben Romberger
b65caeaa32 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>
2016-05-24 11:58:34 -07:00
Shiv Maliyappanahalli
af35f6d738 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-05-06 12:06:20 -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
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
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
5a20e4b489 ASoC: msm: Update audio drivers for kernel 4.4
Update audio drivers for kernel 4.4

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:11:27 -07:00
Sudheer Papothi
be1a516dcb ASoC: msm: Add Audio drivers for MSM targets
Add snapshot for audio drivers for MSM targets. The code is
migrated from msm-3.18 kernel at the below commit/AU level -

AU_LINUX_ANDROID_LA.HB.1.3.1.06.00.00.187.056
(e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1)
(Promotion of kernel.lnx.3.18-151201.)

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:11:25 -07:00