This commit removes the unnecessaries spaces after casts, fixing
the checkpatch error: "No space is necessary after a cast".
Signed-off-by: Constantin Raducanu <raducanu.costi@gmail.com>
icl, cml whl are sharing some toplogy files. Create platform specific files
including DSP configuration, SSP setting and DMIC to simplify platform
settings.
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Add noreturn attribute to decrease number of
false positives when using assert / panic.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Clang cannot compile some xtensa-specific ASM, so it
has to be ignored when running static analysis.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Add support for compiling FW with settings acceptable for clang,
in order to let it perform static analysis on the code.
Clang works mostly on ASTs made out of C code, so there is
no need to build complete signed binary for it.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Add option for building FW for clang's scan-build.
This static analyzer works out-of-the-box only for compilers
compatible with Clang. For most of embedded compilers
there will be some adjustment needed when BUILD_CLANG_SCAN
is enabled. This flag is not suitable for every build scenario,
it has to be supported for given toolchain / architecture.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Separate post-processing steps to not have fw image parts building
mixed with tools processing.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Mixer shouldn't go into COMP_STATE_PREPARE if there is at least
one source in COMP_STATE_PAUSED.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
New IP version introduces Version ID and Parameter registers
and optionally added Timestamp feature.
VERID and PARAM registers are placed at the top of registers
address space and some registers are shifted according to
the following:
Tx/Rx data registers and Tx/Rx FIFO registers keep their
addresses, all other registers are shifted by 8.
SAI Memory map is described in chapter 13.10.4.1.1 I2S Memory map
of the Reference Manual [1].
In order to make as less changes as possible we attach an offset
to each register offset to each changed register definition. The
offset is specified via CONFIG option. We now that this new SAI
version is supported only for i.MX8M.
[1]https://cache.nxp.com/secured/assets/documents/en/reference-manual/IMX8DQXPRM.pdf?__gda__=1583251106_f508ef5d5353cd8fc33150778708874b&fileExt=.pdf
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Introduced solution is more elegant and reliable because of
masking given argument in SET_BITS.
Moreover remove unused masks which usability is taken by SET_BITS
macro with given bits range.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The two functions in sof/audio/format.h are renamed to more descriptive
get_sample_bytes() and get_frame_bytes() to avoid potentially same
name variables to shadow the inline functions defined in the header.
The shadowing happened in component ASRC. The DAI component and another
header audio_stream.h uses these functions and needed minor edits.
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch removes redundant code. The local variables update were
remains of executing the changed if statements as while loop. Since
it is no more done the code can be simplified.
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit removes unused output_rate field from
comp_dev struct. If needed, component can retrieve
rate parameter from sink/source buffers.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Overwrite frame_fmt hardware parameters with DAI private frame_fmt
in dai_comp_get_hw_params() function as DAI component is able to
convert stream with different frame_fmt's
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Changes implementation of notifications allocation.
Instead of using common empty list of messages let's
switch to allocating message per source of notification.
This way we won't have problem with memory and lack of
empty messages and also we will be able to optimize memory.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds helper methods for IPC notifications allocation and free.
This way we can allocate only the size we need without preallocating
the maximum size. Free operation automatically handles synchronization.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds improved implementation for sending IPC notifications
to host. New function takes ipc_msg directly and adds
it to message queue if message is not already there.
Also critical notifications will be sent right away
or added to the beginning of the queue if sending fails.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Returns status -EBUSY, when IPC upstream channel is
currently busy and notification cannot be sent.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds additional parameter to control whether upstream IPC
channel is currently free or not. It's helpful in case
for some reason checking IPC bits is not enough.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
In such a solution it is possible to assign BIT(31) to
uint32_t register value without any warning.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Fix false positive return value for upsupported platforms.
Fix wrong parameter passed in when mutliple platform test.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit moves fetching mux/demux processing functions from
mux_prepare() to mux_set_values(). It insures us against
situation when we fetch proc_func in mux_prepare() and
after that comes mux_set_values() with new mux config.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Fix cppcheck warning:
[src/drivers/dw/ssi-spi.c:111]: (style) struct member
'spi_reg_list::ctrlr1' is never used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fix cppcheck warnings
[src/audio/kpb.c:202]: (style) Variable 'temp_ca_size' is assigned a
value that is never used.
[src/audio/kpb.c:742]: (style) Variable 'current_time' is assigned a
value that is never used.
[src/audio/kpb.c:946]: (style) Variable 'local_buffered' is assigned a
value that is never used.
[src/audio/kpb.c:948]: (style) Variable 'drain_interval' is assigned a
value that is never used.
[src/audio/kpb.c:954]: (style) Variable 'period_bytes_limit' is
assigned a value that is never used.
[src/audio/kpb.c:984]: (style) Variable 'local_buffered' is assigned a
value that is never used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fix cppcheck warning (ret not modified between two returns).
[src/audio/detect_test.c:700] -> [src/audio/detect_test.c:710]:
(warning) Identical condition 'ret', second condition is always false
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Introduce SSTSA_TXEN and SSRSA_RXEN macro to define bit value in
header file instead of usage raw value in source code.
Moreover use SET_BITS to set Rx/Tx slot value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This enum code, and whats more important, related structures is
unused in whole source code, so it shouldn't be kept.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It's a part of ABI interface, so enum value shouldn't change
for example after removing some old enum code.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This conversion in source code looks quite magic. It should be described
in header file where are registers bits description.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
When some error occur during fopen routine, then errno should be
returned instead of success code.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The sof-logger and potentially other debug API clients perform ABI
compatibility check using the single FW ABI version. The same one is used
by the primary FW client which is the kernel driver. If there is a change
made to the debug API, the main ABI has to be updated to protect integrity
of the debug tools while such a change may not affect the kernel driver
at all.
This patch introduces new debug ABI version to be increased when changing
user space debug interfaces while the the main ABI is not affected.
Recompilation and installation of the new driver every time the tunneled
debug protocol is upgraded may be avoided.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
There was missing argument in file_get_hw_params, what breaks compilation.
Fixes: 2b84838 ("Testbench: Instantiate file component as host")
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch updates the SRC to run with the updated test topologies
set. The script is also cleaned up a bit.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the load_aif_in_out(), load_dai_in_out(),
and load_pipeline() calls similarly as done for testbench to
prevent the Fuzzer build fail.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the fail to execute tests due to recent pipeline
updates. Now the fileread and filewrite component is instantiated
as host or DAI depending on stream direction. The DAI file component
is added the capability to report HW stream parameters. In testbench
case the stream parameters originate from command line parameters.
The file params() handling is updated to be similar as in other
components to successfully propagate the parameters.
The added capture pipelines support is not fully functional and will
be fixed later.
The testbench cleanup includes elimination of global variables for
certain component ids. The needed misc parameters were added to
testbench parameters struct that is passed through most topology
parsing functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the tplg-build.sh script by omitting DMIC capture
test topologies generation, tone topolgies generation due to no
use and no maintenance. They can be fixed later.
The all DAI permutations are generated only for volume pipeline. The
src is removed. Instead a new algorithms topologies generation loop
is added for UP2 (APL) compatible topologies. The algorithms are
ASRC, FIR, IIR, and SRC.
The test-all, capture, playback macros are updated to use
PIPELINE_PCM_ADD and set up DAI for SCHEDULE_TIME_DOMAIN_TIMER. The
duplication of TEST_DAI_PORT in macro call is replaced by 0 to
prevent topology load fail on device.
The test-equalizer-playback-ssp.m4 is removed as obsolete.
Pipelines are added for FIR and IIR playback and capture. SRC playback
pipeline is improved by making tokens instance specific. The SRC
capture pipeline macro is only cosmetically improved.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous copy() function frames computation code contained
a mistake that unnecessarily prevented the filter core to access
more than nominal amount of samples from source buffer in pull mode.
It have corrupted occasionally input PCM samples and possibly
could have stalled the algorithm with an impossible processing amount
constraint.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>