Commit graph

70 commits

Author SHA1 Message Date
Aditya Bavanari
92ba699743 ASoC: msm: qdsp6v2: Remove param_size from pkt_size of apr header
As param_size is included in apr header pkt_size, out of
bounds access occurs in glink. Remove the param size addition
to fix this issue.

CRs-Fixed: 2472208
Change-Id: If8b34aeacd3bc9ba67ac9276eb1a8ebf0933f9f9
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-08-30 09:24:36 +02:00
Karthikeyan Mani
a919f50d96 dsp: afe: check for minimum size before payload access
Check if payload data is atleast the minimum expected size
before accessing the data in it.

Change-Id: Ia1295ca5ad5d002122e416fae53588681da687ea
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-21 10:37:29 -07:00
Karthikeyan Mani
26ac9f568e dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-20 00:39:09 -07:00
Xiaojun Sang
7289a6a51e dsp: validate token before usage as array index
Token from DSP might be invalid for array index. Validate the
token before being used as array index.

Change-Id: I9f47e1328d75d9f9acf7e85ddb452019b6eced0a
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-03-26 05:23:32 -07:00
Derek Chen
e049020258 ASoC: msm: qdsp6v2: add lsm support for tdm ports
Add LSM routing and kcontrol support for TDM
backend ports.

Change-Id: Ie6d05691a3e763fe1b7f37dd86415091f7da0e6d
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-06-08 15:10:11 -07:00
Linux Build Service Account
5c49e73d6d Merge "ASoC: msm: qdsp6v2: enable DMA channel control" 2018-05-06 02:07:09 -07:00
Derek Chen
3404b6eb56 ASoC: msm: qdsp6v2: enable DMA channel control
Enable AFE driver to request and release
LPASS DMA channel indices.

CRs-fixed: 2126719
Signed-off-by: Derek Chen <chenche@codeaurora.org>
Change-Id: Ic40bbf9aa7170d2c91cef45ddca7a86ccd27c4b0
2018-04-27 13:54:38 -07:00
Derek Chen
dc4f540fd2 ASoC: msm: move tdm grp mgt to afe for anc support
Move TDM group management from CPU dai to AFE
driver to support LPASS resource access from
ANC platform driver.

CRs-fixed: 2153236
Signed-off-by: Derek Chen <chenche@codeaurora.org>
Change-Id: Ib22bb95cd72426e44863200e0d4581c62b12481a
2018-04-20 10:43:33 -07:00
Cong Tang
1280bf572d ASoC: msm: Upgrade AFE TDM Driver to support 32 Channels
HLOS update AFE TDM driver to support 32 channels playback
and capture since ADSP firmware has already support on this.
Only TDM interface would support 32 channels ability.

Change-Id: I22c23a4b8b43fcbe9950b5df5e8a8faa374efce4
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-03-05 18:30:08 +08:00
Aditya Bavanari
7e2b30f53a ASoC: msm: qdsp6v2: Fix memory allocation issue in afe_sidetone
When afe sidetone params are set, memory allocation is not
done before packing the param data. Allocate memory before
packing the param data to fix this.

CRs-Fixed: 2189218
Change-Id: I38cc5a1a948228235e178f46bfce99fa8dec3bd8
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-02-13 23:14:05 +05:30
Cong Tang
ef4db31849 ASoC: msm: qdsp6v2: Fix Set Lpass Clk Timeout Issue
Lpass set clk time timeout due to afe_callback waked up wrong
wait_queue, use index in token instead of IDX_CLOBAL_CFG.

Change-Id: I25ce1fbba5692d0a30e946a54096b5b7a58f51e7
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-01-30 11:27:22 +08:00
Aditya Bavanari
43f8fb6053 ASoC: msm: qdsp6v2: Update AFE driver to support Instance ID
Add support to set and get AFE 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: I9f2cc097a0f1a99a4639bb0cd636500b41a41b1b
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2017-12-21 11:10:35 +05:30
Vikram Panduranga
b80e0c7dcf ASoC: msm: qdsp6v2: Enable AFE sidetone based on mixer ctl setting
AFE sidetone is currently enabled based on a combination
of mixer control setting and default config in ACDB.
This change will limit enablement to mixer control setting alone.

Change-Id: I038d51177adc3e1da45ea7fdf9386362390f181d
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2017-04-17 14:47:27 -07:00
Linux Build Service Account
4b7986eaba Merge "ASoC: msm: qdsp6v2: fix to remove ftm_cfg mode update" 2017-03-21 13:28:40 -07:00
Vidyakumar Athota
dcba29af2d ASoC: msm: qdsp6v2: fix to remove ftm_cfg mode update
Speaker FTM(factory test mode) configuration mode is reset
during afe_set_cal_fb_spkr_prot() API which is causing FTM
mode to be overwritten if afe_set_cal_fb_spkr_prot() API
is called before FTM mode sent to DSP. Fix this issue by
not resetting FTM mode.

Change-Id: Ic1112a66b6e1413441f408b74609c621c770534b
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-03-03 14:50:24 -08:00
Xiaojun Sang
409b6ad29d Revert "ASoC: soc: qdsp6v2: add support for slimbus VI recording"
This reverts commit 641fb2817f ("ASoC: soc: qdsp6v2:
add support for slimbus VI recording").
It is unnecessary to support concurreny of VI
recording and speaker protection.

CRs-Fixed: 1113625
Change-Id: Iffc8ac4f9e28347dcc95ea3bf42a691655195f9f
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2017-03-01 10:27:15 +08:00
Linux Build Service Account
b0e13cce52 Merge "ASoC: qdsp6v2: send afe calibration in acdb id mismatch cases" 2017-02-21 05:33:47 -08:00
Linux Build Service Account
8f808604e1 Merge "ASoC: msm: qdsp6v2: Add initialization and range check in q6afe" 2017-02-15 06:11:39 -08:00
Linux Build Service Account
df10dee979 Merge "ASoC: msm: qdsp6v2: Add TDM support for PCM compressed mode" 2017-02-15 06:11:36 -08:00
Vidyakumar Athota
2bbbac2c16 ASoC: qdsp6v2: send afe calibration in acdb id mismatch cases
AFE calibration data block is sent to DSP only if ACDB ID matches with
ACDB ID that is updated from routing driver. For hostless FE DAIs, ACDB
IDs are not updated in routing driver, which results in failure while
sending AFE calibration block to DSP. Fix this issue by sending default
AFE calibration data in acdb ID mismatch cases.

Change-Id: Icaa399f9251e69ce456e4d560101cb842efcd230
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-02-14 16:02:41 -08:00
Josh Kirsch
d6cacdfe65 ASoC: msm: qdsp6v2: Add TDM support for PCM compressed mode
Add support for 352800 sampling rates and 32 bps for the TDM.
Add support for PCM compress passthough mode with mixer controls.

CRs-fixed: 1116515
Change-Id: Iab059a5a6b6ce8f57717023467677a399a60032e
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2017-02-13 01:08:43 -08:00
Manish Dewangan
563050b247 ASoC: msm: qdsp6v2: Add support to query Drift.
Afe driver changes to query avtimer vs device drift.
Drift obtained can be used to pull the device pll so
that avtimer and device are in sync.

CRs-Fixed: 1112258
Change-Id: I4d4ddb0dbc06270553d583f266a44ddbe9412d1a
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
2017-02-12 22:17:21 -08:00
Linux Build Service Account
45ad5727c9 Merge "ASoC: msm: qdsp6v2: Add INT3 Tx port for LSM" 2017-02-10 06:46:05 -08:00
Linux Build Service Account
f85e7d3750 Merge "ASoC: msm: qdsp6v2: Add endianness control for USB devices" 2017-02-10 06:45:53 -08:00
Linux Build Service Account
dc51fe91f5 Merge "ASoC: qdsp6v2: Clear memory map handle during ADSP SSR" 2017-02-09 13:15:51 -08:00
Linux Build Service Account
f1fa109c74 Merge "ASoC: qdsp6v2: update afe topology to RTAC driver" 2017-02-09 13:15:47 -08:00
Linux Build Service Account
38b12d2ace Merge "ASoC: msm: add support for multi-copps for multiple BEs" 2017-02-09 03:11:59 -08:00
Haynes Mathew George
60a73c0652 ASoC: msm: qdsp6v2: Add endianness control for USB devices
Add mixer control to set the endianness of the playback/capture
USB device.

CRs-Fixed: 2003737
Change-Id: I99102c3bb64e321fb3e5df38428e63a406f91d7e
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
2017-02-08 18:00:28 -08:00
Ashish Jain
c9127aa9c1 ASoC: msm: qdsp6v2: Add INT3 Tx port for LSM
Add INT3 Tx port for LSM to support detections in
cases where this port is used.

Change-Id: Ifddd0dce0b62a352ee10fad9d11b2e83b2d5f902
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
2017-02-07 18:12:25 +05:30
Xiaoyu Ye
9d1c3be760 ASoC: msm: qdsp6v2: Add initialization and range check in q6afe
Add initialization and range check to prevent unattended variables
causing buffer overflow.

CRs-Fixed: 2000634
Change-Id: Ia8a4dfedc7dc4aa300a1012e883c7b23451231f0
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-02-06 18:26:53 -08:00
Vidyakumar Athota
ee18cfb860 ASoC: qdsp6v2: Clear memory map handle during ADSP SSR
AFE topology information is not shown in real time audio calibration
tool(RTAC) after ADSP subsystem restart because memory map handle is
not reset. Set/get param APIs fail because of this stale memory map
handle. Fix this issue by clearing AFE memory map handle during SSR.

Change-Id: Id8b1fad6580c11ba504e8781643f3d0f584eae7b
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-02-06 16:48:27 -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
Vidyakumar Athota
6cd1cb7964 ASoC: qdsp6v2: update afe topology to RTAC driver
In device switch scenarios, AFE topology is stored in Real Time
Audio Calibration(RTAC) driver before afe ports are open, which
is invalid. Update AFE topology in RTAC driver after topology ID
is obtained during AFE port open.

Change-Id: I034321126fb0ffc9a2871f3c64f29f8aaedb21e7
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-02-03 14:57:40 -08:00
Xiaoyu Ye
811f1faa25 ASoC: msm: qdsp6v2: Fix range check logic of port index
The case of port index equals AFE_MAX_PORTS is not checked.
Add this corner case to avoid wrong port number.

CRs-Fixed: 1114578
Change-Id: I466cb7d87313e55e9e0bd08a7ab43f3ea36b8b9a
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-02-03 10:43:58 -08:00
Linux Build Service Account
8f716987eb Merge "ASoC: msm: qdsp6v2: Add support for AFE sidetone" 2017-01-28 08:41:47 -08:00
Laxminath Kasam
01a680eb49 ARM: dts: msm: Add audio fixes for SDM660
Update internal codec settings for RX/TX devices.
Disable lpass notifier in analog codec driver.
Handle 44.1K support in machine driver to
disable MCLK before request for change in
MCLK frequency.

Change-Id: I5f78f07da46dee0c66e4e374da600e2e5c5d8e21
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-01-25 17:42:05 +05:30
Laxminath Kasam
5faffa091e ASoC: Audio bringup fixes for SDM660
Update fixes for SDM660 external and internal
codec variants from audio.

Change-Id: Id2a05700e96f4670181d510d6bce7bccc2919bfc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-01-17 21:06:56 +05:30
Siena Richard
5ccf5cf5f8 ASoC: msm: qdsp6v2: Add support for AFE sidetone
Add support for AFE sidetone whenever USB device or
codec sidetone is not available or supported.

Change-Id: I325ba6448efb4c021a2974ad813be4f8192e9ad1
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2017-01-11 18:56:31 -08:00
Linux Build Service Account
a7c2e1aaa5 Merge "ASoC: msm: qdsp6v2: Add mutex in afe_map_cal_data" 2016-12-09 19:59:37 -08:00
Rohit Kumar
48cf12d6e4 ASoC: msm: qdsp6v2: Add mutex in afe_map_cal_data
Add mutex_lock in afe_map_cal_data around afe_cmd_memory_map to
avoid update of this_afe.status by afe_set_lpass_clk_cfg afe callback.
This fixes the failure of afe_cmd_memory_map waitqueue to enter into
sleep when wait_event_timeout is called as this_afe.status is already
zero leading to invalid map_handle.

CRs-Fixed: 1094151
Change-Id: I4833253803c162c98578ba7ce599ea1edafc1724
Signed-off-by: Rohit Kumar <rohitkr@codeaurora.org>
2016-12-05 20:52:49 -08:00
Xiaojun Sang
641fb2817f ASoC: soc: qdsp6v2: add support for slimbus VI recording
Add a new dailink for slimbus VI sense recording.
SLIMBUS_TX_VI and SLIMBUS_4_TX can coexist.
VI recording and speaker protection cannot work
simultaneoulsy due to shared physical afe port.

CRs-Fixed: 1087025
Change-Id: If074b7042e09d1e69147546461e6fa42d427350e
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2016-12-05 21:47:34 +08:00
Xiaoyu Ye
9001be4187 ASoC: msm: qdsp6v2: Fix an incorrect string comparison logic
A conditional branch is skipped due to incorrect string comparison.
It is fixed by using "strcmp" to perform string comparison.

CRs-fixed: 1085889
Change-Id: I12be44ac272fc5079230feb6ae24c68ccde99cf2
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-11-23 14:17:39 -08:00
Laxminath Kasam
8452fff703 ASoC: msm: Add support for INTx ports and clocks
Add support for new DSP INTx MCLK, INTx IBIT CLK
and INTx MI2S ports. New internal codec and msm
based soundwire codec use these clocks and port_ids.

CRs-Fixed: 1083537
Change-Id: I72e0a15c8a283c68a3ed10cfd02a4e3d9526c312
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-11-07 11:54:50 +05:30
Linux Build Service Account
f319f3de8b Merge "ASoC: msm: qdsp6v2: Index check for out of range" 2016-11-03 06:23:55 -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
Naresh Tanniru
ce3c3a600a ASoC: msm: qdsp6v2: support for configurable bit format for AFE encoder
Add support for configurable bit width for AFE encoder.
Add new mixer ctl to set for usecases which enables
configuring different input/output bit format
on AFE for usecases such as APTXHD encoder for 24bit input
and 16bit output.

Change-Id: I62326a097cbd71a3ec2b93a0120284d8f71f5d57
Signed-off-by: Naresh Tanniru <ntanniru@codeaurora.org>
2016-10-05 06:27:08 -07:00
Linux Build Service Account
1b95c57dc7 Merge "ASoC: msmcobalt: add support for MI2S and AUX PCM" 2016-09-24 02:00:40 -07:00
Kuirong Wang
e079354544 ASoC: msm: add tertiary and quaternary audio PCM support
Add support for tertiary and quaternary audio PCM interface
to msm platform.

Change-Id: I985200bbff55583ac09bf7444ecbc5cf6ab7eb41
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2016-09-21 17:29:16 -07:00
Kuirong Wang
b105c4f9de ASoC: msm: update to align afe memory mapping as multiple of 4KB
It is required the buffer size to ADSP are multiple of 4kB. Update
the buffer size to be 4kB alignment before passing to ADSP.

CRs-Fixed: 1040066

Change-Id: I34f1b611000f5d9e4ae4c13a89b8571faa0f3393
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2016-09-21 10:13:21 -07:00
Linux Build Service Account
f51db1aa4a Merge "ASoC: msm: qdsp6v2: check if index is out of range before use" 2016-09-08 20:01:32 -07:00