Switch audio drivers to SPDX identifier on msm-4.19.
Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
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>
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>
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>
Initialize flag variables before use in spinlocks.
CRs-Fixed: 2257317
Change-Id: I8b5973c1dfe3c7266a71d4e8ef4d5884b685ae5d
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Switch to DLKM for all audio kernel modules.
Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
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>