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>
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>
Check if payload data is big enough before accessing
the data in it.
Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add support for tertiary and quaternary audio PCM interface
to msm platform.
Change-Id: I985200bbff55583ac09bf7444ecbc5cf6ab7eb41
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
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>