Commit Graph

35 Commits

Author SHA1 Message Date
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Dieter Luecking
39b3e3cc9e dsp: Update ASM driver to support 32 ch
ASM supports now up to 32 channels. Extend
the ASM Channel map structures from 8 to 32
channels.

Change-Id: I958d15910785cf0c5707dec432b4dd3e272c3dc1
Signed-off-by: Dieter Luecking <dieterl@codeaurora.org>
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2018-10-04 07:13:39 -07:00
Linux Build Service Account
8903e56097 Merge "ASoC: rate limit for error log" 2018-09-20 11:43:44 -07:00
Xiaojun Sang
c226e86c15 ASoC: rate limit for error log
Use rate limit to reduce redundant log.

Change-Id: I7cd7403c42ddce7915c5ecb82504e6c38bcf0572
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-09-19 08:53:45 +08:00
Vignesh Kulothungan
e5159cdc90 dsp: asm: split check condition for NULL and stale
Split the muli-check condition into two separate check conditions.
Suppress the logs for stale condition to debug.

CRs-Fixed: 2307741
Change-Id: I984a2ea7928de052e993e77db807df83109ab423
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-09-12 11:23:34 -07:00
Karthikeyan Mani
0c1f938992 dsp: rate limit read/write error logs
Rate limit dsp read/write error logs to reduce log
prints during SSR scenario for read/write failures.

Change-Id: I031be5ebd39bdd11dc8e1eb92c77ed782f1dc149
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-08-28 14:32:37 -07:00
Vignesh Kulothungan
61e56a95a3 dsp: asm: initialize variables before use
Initialize flag variables before use in spinlocks.

CRs-Fixed: 2257317
Change-Id: I8b5973c1dfe3c7266a71d4e8ef4d5884b685ae5d
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-08-23 09:52:35 -07:00
Linux Build Service Account
6f046cdf21 Merge "ASoC: q6asm: use session lock to avoid use-after-free" 2018-08-08 23:32:14 -07:00
Linux Build Service Account
ed06521452 Merge "asoc: msm: update asm channel map for push pull mode" 2018-08-07 06:18:42 -07:00
Xiaojun Sang
fe99d5b2d1 ASoC: q6asm: use session lock to avoid use-after-free
It is possible that audio session free and param set happens
simultaneously. Audio client might be freed while param set
is doing wait_event_timeout.
Use session lock to make sure client_free happens after param set.

Change-Id: I0947c309c8e445fa2e220680e329d88bd5fe2418
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-08-02 17:38:17 +08:00
Surendar Karka
5628e8bc98 asoc: msm: update asm channel map for push pull mode
In noirq push pull mode channel map needs to be set during
ASM open shared io stream. Add support for no irq driver to
set channel map during ASM shared io stream open.

CRs-Fixed: 2267809
Change-Id: Ic1abfe60bb54b6529fbb4cf999e50196befaba46
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2018-08-02 13:05:05 +05:30
Linux Build Service Account
2cb347bab2 Merge "asoc: qcs405: Add support for AFE SPDIF interfaces" 2018-07-31 09:34:20 -07:00
Mangesh Kunchamwar
2eabdc7309 asoc: dsp: add check for integer overflow
Add check for integer overflow of user
supplied data for ADSP stream command.

CRs-Fixed: 2173850
Change-Id: Idde5665c770398629b1b0cfa2c18d3c023b0f9a2
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2018-07-27 21:32:46 +05:30
Ralf Herz
cc29b9e839 dsp: support for AFE SPDIF input interface
Support two SPDIF input and two SPDIF output interfaces in AFE.
Support 61937 compressed capture.

Change-Id: Ie71434eb53be798567a6240e0f4bf171aee305b8
Signed-off-by: Ralf Herz <rherz@codeaurora.org>
2018-07-25 21:35:33 +05:30
Linux Build Service Account
d36e5ef530 Merge "dsp: Avoid excessive list iterations" 2018-07-09 11:56:34 -07:00
Linux Build Service Account
f247ce1f32 Merge "ASOC: dsp: add spin_lock for q6asm_add_hdr" 2018-07-06 14:46:26 -07:00
Vignesh Kulothungan
96ba1625dc dsp: Avoid excessive list iterations
Exit list iteration after the required conditions
for the loop has been satisfied to avoid additional
list iteration.

Change-Id: I96872d3be469420e613ec0244588a0a8ecb50e58
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-07-05 11:40:48 -07:00
Meng Wang
d1942a26d8 dsp: add null check for temp handle
Variable mem_state in audio client(ac) is set to zero
when there is a successful memory mapping. However the
same variable is updated for various mapping commands.
Ensure to check for both memstate and specific mem_handle
to be updated in the wait condition to wake up the right
waiting command.

Change-Id: Iabba61cef0a90f636de50e9d27eecf886dc59a27
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2018-07-03 17:48:02 -07:00
Meng Wang
d5d1092c0c ASOC: dsp: add spin_lock for q6asm_add_hdr
During SSR, ac could get freed after unlock the session lock
during the execution of q6asm_callback. If we try to get the
ac->cmd_lock after ac freed, kernel panic happens.
Remove mutex_lock in reset_event to avoid kernel panic.
Add spin_lock_irqsave in q6asm_add_hdr and change spin_lock to
spin_lock_irqsave in q6asm_callback to add synchronize between
q6asm_add_hdr and q6asm_callback to avoid kernel panic.

Change-Id: I72cf959fe6a764920a13d565c72243a80ac4f236
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-07-03 08:34:46 +08:00
Aditya Bavanari
d66cc71409 dsp: 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-18 12:57:32 +05:30
Vikram Panduranga
c712c17ab0 dsp: Add support for custom encoder
Add support to set custom encoder in ASM which
can be enabled through compress capture path.

Change-Id: I563c59eb3a0213c26ce69d3c2f8d650cf3c7d32d
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2018-06-05 12:57:23 -07:00
Karthikeyan Mani
145e63390c dsp: q6asm: check for buffer size before read
Check for debugfs ops buf size passed before reading
to avoid reading out of bounds.

Change-Id: Idd5e755ac16448af5751e2f3381097f234e74a74
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-04-09 10:37:38 -07:00
Xiaojun Sang
75642c362c 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-04-02 22:00:23 +08:00
Vikram Panduranga
770b8383d2 dsp: Mark cal block after use
After applying calibration on DSP, cal block
is marked stale to ensure same calibration is not
reused for future usecase.

Change-Id: I9f446c0602f4ab34ca71b9d2611319624fb19cd2
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2018-03-16 17:54:53 -07:00
Vignesh Kulothungan
fa497d2051 ASoC: dsp: Update audio effects driver to support Instance ID
Add support to set and get audio effects 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: I0fdba2560950c931a2ec6f152499fd4bb9f59086
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-03-04 23:22:34 -08:00
Vignesh Kulothungan
f20d5b7ea5 ASoC: dsp: Update ASM driver to support Instance ID
Add support to set and get ASM 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: I633ce10a83d9033d42fadb7bad0b26842459df84
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-03-04 23:22:19 -08:00
Vignesh Kulothungan
1ccc875287 ASoC: dsp: Update rtac driver to support Instance ID
Add support to set and get rtac 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: Ic96e83477e72dc5ffa4d87a1e98c34814bbd0b8d
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-03-04 23:07:03 -08:00
Banajit Goswami
08bb73698a dsp: update MSM Audio ION wrappers to align with upstream
Between Linux-4.9 and Linux-4.14, upstream has updated the
ION APIs significantly to make ION ready to bring out of
staging folder. This has changed the way ION and dma_buf
APIs used to work together for allocating, mapping and
deallocating ION buffers.
Update MSM Audio ION wrapper functions used by audio drivers
to reflect these ION API changes as per upstream ION.

Change-Id: I63097e147a397aa3a538f69ac88b6fb10871c3dc
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-02-04 03:41:06 -08:00
Meng Wang
9730cdd47e ASoC: dsp: add spin lock to protect ac
There is a possible use after free for the ac variable
that causes kernel panic. Add spinlock to fix race
condition to avoid this issue.

Change-Id: I71638c269f572ff1eaad87682fa000cd1dad407d
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2017-12-12 23:44:08 -08:00
Linux Build Service Account
5643be1804 Merge "ASoC: allow drivers to compile both static and dynamic" 2017-12-12 09:56:54 -08:00
Xiaoyu Ye
f423ab17d3 dsp: unlock the mutex before return to avoid potential deadlock
Function "q6asm_set_shared_circ_buff" has a potential scenario that
can cause deadlock due to a missing call to unlock mutex before return.
Avoid this potential deadlock by calling the mutex unlock just before
the return of function "q6asm_set_shared_circ_buff".

Change-Id: Ic454eb5eb57c7616d891277c09e0e3bd37e63cd2
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-12-10 21:27:39 -08:00
Asish Bhattacharya
5faacb3a7e ASoC: allow drivers to compile both static and dynamic
Based on where the code is synced the driver should allow
both static and dynamic linked compilation.
Also remove __exit for modules loaded from another common
init/exit functions.

Change-Id: Ib58f152002aba3af4446f9bbd9b82c279212bd0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2017-12-07 19:57:27 +05:30
Laxminath Kasam
8b1366a648 Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.

Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-11-02 13:42:09 +05:30
Aditya Bavanari
a8aea17ddd dsp: fix dangling pointer access
Assign the circular buffer address to port buffer only after ION
allocation is succesful to fix dangling pointer access.
Also, lock the circular buffer memory allocation in order to
avoid multiple allocations for a port.

CRs-Fixed: 2096407
Change-Id: I22c1d55ea611ac59cdca51924787f6831bad8c2b
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2017-09-15 11:33:28 +05:30
Laxminath Kasam
605b42f92c audio-lnx: Rename folders to new flat structure.
Kernel audio drivers can be categorised into below folders.
asoc - ALSA based drivers,
asoc/codecs - codec drivers,
ipc - APR IPC communication drivers,
dsp - DSP low level drivers/Audio ION/ADSP Loader,
dsp/codecs - Native encoders and decoders,
soc - SoC based drivers(pinctrl/regmap/soundwire)

Restructure drivers to above folder format.
Include directories also follow above format.

Change-Id: I8fa0857baaacd47db126fb5c1f1f5ed7e886dbc0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-18 16:56:12 -06:00