Commit graph

607 commits

Author SHA1 Message Date
Rohit kumar
8c12285cf3 dsp: asm: Add check for num_channels before calling q6asm_map_channels
Channel_mapping array size varies for different commands.
Add check for num_channels before calling q6asm_map_channels.

Change-Id: Iccbcfe82f716fc0ffe0a26b1779dcaa1c3cb805b
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2019-03-01 03:42:08 -08:00
Soumya Managoli
c29b12e26d ASoC: msm: qdsp6v2: Handle invalid session for dtmf enable
If session id is invalid then dtmf voice info will also
be invalid.

Add check to return error if session id is invalid.

CRs-Fixed: 2306771
Change-Id: I362340f9f666c95949eaa94d0ced4cb3a1b9abab
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-09-17 03:53:13 -07:00
Tanya Dixit
700502714a rtac: Add mutex lock to ensure proper fops access
Add mutex lock in rtac_open and rtac_release
to avoid usage count discrepancies leading
to multiple calls to unmap memory resulting in
null pointer dereference.

CRs-Fixed: 2271712
Change-Id: Ie6da28837c352030b8d7e377d68a70cf04e7072a
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2018-09-11 19:07:54 +05:30
Soumya Managoli
5206b51937 asoc : msm: Fix zero size pointer issue
APPS crashes randomly due to invalid memory allocation
in q6asm_audio_client_buf_free_contiguous.
Added check to return error if memory allocation size is 0.

Change-Id: I40f49aa147d513b29b56224a5ee77ccbb2dcc110
CRs-Fixed: 2285272
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-09-04 04:53:26 -07:00
Erin Yan
2a7de56683 q6asm: retry asm_open_read and asm_open_loopback when session id conflict
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines.  Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.

The patch allowed audio capture stream and loopback stream to try all
available session ids in case of session id conflict error, to support
concurrent playback from multiple virtual machines.

Change-Id: I01b4da65f3e5716dd14c20c614b53f3c45dd9ea3
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
2018-08-14 19:49:31 -07:00
Satish Babu Patakokila
595690c416 ASoC: msm: Fix config control indices for TX DAIs
Correct the config control indices for TX DAIs of MI2S interface.

Change-Id: Ie8bf646a0c1fbd30abdb34703ae1f90ed9b484e8
Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
2018-07-10 03:50:13 -07:00
Soumya Managoli
06cd2ea4b5 ASoC: msm: qdsp6v2: Update LSM param hdr size
q6lsm_pack_params requires param hdr size
to be filled and sent as argument.
Change is to update size with param_hdr_v3 struct size.

Change-Id: Id2380f3ceb887e1fc73b7f5f8e28ac93029082e4
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-07-06 05:01:11 -07:00
Ramprasad Katkam
804e259983 ASoC: msm: qdsp6v2: Add mutex protection for rtac cal apis
Add mutex lock protection to synchronize rtac
calibration set and get api calls.

Change-Id: Ieb2d01642ecefff6405bb59554157c304b4b651d
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-07-02 07:06:01 -07:00
Linux Build Service Account
b6a5f53741 Merge "ASoC: msm: qdsp6v2: add routing from MM6 to SEC MI2S RX" 2018-06-27 14:44:12 -07:00
Linux Build Service Account
daa592e855 Merge "ASoC: msm: Support different POPPs to single COPP" 2018-06-21 13:37:46 -07:00
Linux Build Service Account
b60fb8e724 Merge "ASoC: msm: qdsp6v2: Fix rtac memory unmap issue in ASM driver" 2018-06-21 04:04:07 -07:00
Linux Build Service Account
8164a41508 Merge "ASoC: msm: qdsp6v2: Fix return code check in adm driver" 2018-06-21 04:04:06 -07:00
Derek Chen
a83fb6663f ASoC: msm: qdsp6v2: add routing from MM6 to SEC MI2S RX
Add routing support from multimedia6 frontend
to secondary MI2S RX backend.

Change-Id: I6755fcf2a0fef0407d3492fe66260d22de2a7daf
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-06-21 00:14:48 -07:00
Aditya Bavanari
e4f474eb8e ASoC: msm: qdsp6v2: Fix AFE RTC set parameter
Fix offset address to use set parameter structure while
copying data from user instead of get parameter structure
for AFE_PORT_CMD_SET_PARAM_V3 case.

CRs-Fixed: 2256728
Change-Id: I61e41f366f365734a47080b79179fbe3021ee8a7
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 19:01:12 +05:30
Aditya Bavanari
04708e34ee ASoC: msm: qdsp6v2: Fix rtac memory unmap issue in ASM driver
During unmap of rtac block in ASM, mem_map_handle
address is set to zero instead of the value. Set the
map handle value to zero to avoid issue in freeing the
ion memory.

CRs-Fixed: 2254339
Change-Id: I6584be029d4c8dde235e722149c758df0db9916e
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 17:50:52 +05:30
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
Linux Build Service Account
51b2f06de2 Merge "ASoC: msm: qdsp6v2: add lsm support for tdm ports" 2018-06-15 03:06:20 -07:00
Linux Build Service Account
f8c3bac9ce Merge "ASoC: msm: qdsp6v2: Rx DTMF detection via voice stream callback" 2018-06-15 03:06:19 -07:00
Vatsal Bucha
b9e306af63 ASoC: qdsp6v2: Fix null pointer dereference for prtd pointer
Private data pointer may not be initialized before
access it in adsp_stream_cmd_put. NULL check for prtd
avoids the issue.

CRs-Fixed: 2252497
Change-Id: Ibd888be601d5b42ed4f4644ed22596a26b61f8fe
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-06-13 22:59:54 -07:00
Timothy Sham
fe515e9936 ASoC: msm: qdsp6v2: Rx DTMF detection via voice stream callback
Allow msm-pcm-voice-v2 driver to enable Rx DTMF detection and
route the DTMF detection event from QDSP6 to a registered
mixer event callback.

Change-Id: I9ffb714d1ec5dd0f4e2c229830d7170324b295bb
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
2018-06-12 14:00:49 -04: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
ebae906ccd Merge "q6asm: retry asm open in case of session id conflict" 2018-06-08 10:20:25 -07:00
Linux Build Service Account
51c5c162c1 Merge "ASoC: msm: Add mixer controls for module enabling" 2018-06-05 20:30:51 -07:00
Han Lu
53c8faf4dc q6asm: retry asm open in case of session id conflict
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines.  Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.

The patch allowed audio playback stream to try all available session ids
in case of session id conflict error, to support concurrent playback from
multiple virtual machines.

Change-Id: If98d05898cec3f05d80c750ec8a014add3b1f34c
Signed-off-by: Han Lu <hanlu@codeaurora.org>
2018-06-04 00:32:36 -07:00
Linux Build Service Account
addd4dab16 Merge "ASoC: msm: add boot marker for mi2s and auto sound card" 2018-05-29 05:07:37 -07:00
Rahul Sharma
e01d6aedaa ASoC: msm: Add mixer controls for module enabling
Mixer controls are added to enable or disable
ADSP modules.

Change-Id: Ia2471c3fc25429001ccf19d6b30d34d6e2cf9d27
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2018-05-27 16:24:45 +05:30
Linux Build Service Account
45c4f7d22f Merge "ASoC: msm: Modify buf size check to prevent OOB error" 2018-05-24 02:46:45 -07:00
Zhiqiang Tu
996c86f94e ASoC: msm: add boot marker for mi2s and auto sound card
Add boot marker for booting KPI measurement.

Change-Id: I58fac2a1bed4f9c4e484b3dadb6a766c260f3f06
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-22 13:33:41 +08:00
Linux Build Service Account
1ff291a124 Merge "ASoC: msm: check payload size before memory allocation" 2018-05-20 19:31:51 -07:00
Linux Build Service Account
e1c2b1f918 Merge "ASoC: msm: qdsp6v2: return the proper LPASS status" 2018-05-20 19:31:50 -07:00
Xiaojun Sang
ad40ee7b44 ASoC: msm: check payload size before memory allocation
Buffer from mixer ctl or ADSP is composed of payload size and
actual payload. On a 32 bit platform, we could have an overflow
if payload size is below UINT_MAX while payload size + sizeof(struct)
is over UINT_MAX. Allocated memory size would be less than expected.
Check payload size against limit before memory allocation.

Change-Id: I0bf19ca7b8c93083177a21ad726122dc20f45551
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-05-16 14:28:32 +08:00
Derek Chen
125ff102eb ASoC: msm: qdsp6v2: return the proper LPASS status
Allow the LPASS status check API to return
the proper status code.

CRs-fixed: 2126725
Change-Id: I6c34036ec30c7d4ce8aaefb70d19b04b211f7355
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-05-14 17:28:59 -04:00
Timothy Sham
6e3516ef4c ASoC: msm: qdsp6v2: increase max Rx DTMF duration
Increase the maximum value of the DTMF Rx Generate
mixer command and change the read to int16 to allow
for clients to be able to set '-1', infinite tone.

Change-Id: I44eed4712bb05a70b4464d9db38c348c131a3f61
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
2018-05-08 14:27:20 -07:00
Linux Build Service Account
b4728dbe0e Merge "ASoC: msm: qdsp6v2 : Add AFE port validation for MULTICHAN_HDMI_RX" 2018-05-06 02:07:12 -07:00
Linux Build Service Account
fb913f564f Merge "ASoC: msm: add TDM routing for DTMF driver and dtmf fe dai to apq8096" 2018-05-06 02:07:10 -07:00
Linux Build Service Account
5c49e73d6d Merge "ASoC: msm: qdsp6v2: enable DMA channel control" 2018-05-06 02:07:09 -07:00
Timothy Sham
a98fd17446 ASoC: msm: add TDM routing for DTMF driver and dtmf fe dai to apq8096
Added DTMF mixer routing for QUAT_TDM_RX2 for automotive. Also added
the DTMF front-end dai to apq8096 driver.

Change-Id: I3652efd939774ff8cb7c40445747f0edbf6b3c7f
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
2018-05-03 18:05:49 -04:00
Linux Build Service Account
6934044c51 Merge "ASoC: msm: move tdm grp mgt to afe for anc support" 2018-05-01 17:00:37 -07:00
Linux Build Service Account
0af3c13aa0 Merge "ASoC: msm: Update channel mixer weight mixer control" 2018-05-01 06:26:32 -07:00
Ramu Gottipati
ad131d3ea9 ASoC: msm: qdsp6v2 : Add AFE port validation for MULTICHAN_HDMI_RX
validate port doesn't handle MULTICHAN_HDMI_RX
and causes failure to set afe params.
Included MULTICHAN_HDMI_RX in port validation

Change-Id: I3603ec2a3d392970cb48be1658b6030d3f4107f2
Signed-off-by: Ramu Gottipati <ramug@codeaurora.org>
2018-04-30 13:50:59 +05:30
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
Soumya Managoli
63f8971543 ASoC: msm: Modify buf size check to prevent OOB error
Expected buffer size to read is 2 bytes.
Corrected the size check to return error
when count is not 2.

Change-Id: I43b572d191f6f98a8a790b5ae77b43fabcd7329a
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-04-27 11:31:54 +05:30
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
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
Derek Chen
d048e87a75 ASoC: msm: update listen service dai to low latency pcm
Update listen 8 audio service DAI LINK to use low
latency PCM session with multimedia22 frontend for
extended concurrency support.
Add routing for TDM RX CPU DAIs to MultiMedia22.

Signed-off-by: Derek Chen <chenche@codeaurora.org>
Change-Id: I3b67cf4b19773b714ca367941a86e6ac062c6597
2018-04-19 08:18:51 -07:00
Derek Chen
c230fbe3c0 ASoC: msm: qdsp6v2: add 24b capture support for tert mi2s
Add support for 24 bits capture for Tertiary MI2S
interface in CPU DAI links.

Change-Id: I2453c5e7efb957d9c2a1fb832c1a456d0672af9a
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-03-28 10:57:21 -07:00
Linux Build Service Account
9a72ed233c Merge "ASoC: msm: Upgrade ASM Driver to support 32 Channels" 2018-03-23 03:32:45 -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
Cong Tang
a1d5bb9297 ASoC: msm: qdspv2: fix NULL pointer exception in core driver
NULL pointer dereference occurs while getting version size
when version info memory allocation fails.
Add NULL check to avoid this NULL pointer exception.

Change-Id: I589b2114f67df0eeaaa817bad05cd7d44786d3ad
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-03-21 19:49:22 -07:00