Curtis Malainey
8dc97ccf94
ASoC: SOF: Deprecate invalid enums in IPC3
...
The switch component was never completed and sat half empty for over 3
years. It was recently deleted. For modern components this would
require not change in the kernel but since this was a legacy allocation
from the enum days of IPC3 we should mark the respective enum as
deprecated.
The splitter component was never even got a source file in the firmware.
Therefore also delete it since this is not needed.
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20230731213242.434594-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-07-31 23:24:03 +01:00
Jyri Sarha
cb3cdef331
ASoC: SOF: ipc4: Add macros for chain-dma message bits
...
In the chained DMA mode, the firmware allocates buffers for the host
and link DMA, and takes care of copying data between host- and
link-DMA buffers in a low-latency thread. This is different to a
regular pipeline, no processing is allowed, and the connection between
host- and link DMA is handled with a dedicated IPC.
This patch exposes the macros needed to create the required IPC messages.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com >
Reviewed-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20230321092654.7292-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-03-21 12:13:30 +00:00
Peter Ujfalusi
11f45690b3
ASoC: SOF: ipc4: Add macro to set the core_id in create_pipe message
...
The create pipeline message can carry the target code_id which is set to
0 at the moment.
Add macros to set the core_id in the message extension.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20230307123556.31328-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-03-07 13:58:12 +00:00
Ranjani Sridharan
2d271af1af
ASoC: SOF: ipc4-pcm: Use the PCM stream's pipeline_info during trigger
...
Use the list of pipelines in the PCM stream's pipeline info to trigger
the pipelines in the right order. Add a helper for triggering pipelines
in batch mode that will be used to trigger multiple pipelines at the
same time.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Libin Yang <libin.yang@intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20230127120031.10709-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2023-01-27 12:14:07 +00:00
V sujith kumar Reddy
75af419919
ASoC: SOF: Add DAI configuration support for AMD platforms.
...
Add support for configuring sp and hs DAI from topology.
Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com >
Link: https://lore.kernel.org/r/20221129100102.826781-1-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-11-29 12:56:09 +00:00
Mark Brown
aeb2e9c4ee
ASoC: Merge up fixes
...
Merge the fixes branch up so we can apply further AMD work.
2022-11-29 12:55:51 +00:00
Pierre-Louis Bossart
f5f8ad3fcd
ASoC: SOF: dai: move AMD_HS to end of list to restore backwards-compatibility
...
The addition of AMD_HS breaks Mediatek platforms by using an index
previously allocated to Mediatek. This is a backwards-compatibility
issue and needs to be fixed. All firmware released by AMD needs to be
re-generated and re-distributed.
Fixes: ed2562c64b ("ASoC: SOF: Adding amd HS functionality to the sof core")
Link: https://github.com/thesofproject/sof/issues/6615
Link: https://lore.kernel.org/alsa-devel/36a45c7a-820a-7675-d740-c0e83ae2c417@collabora.com/
Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com >
Reviewed-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com >
Reviewed-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20221117232120.112639-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-11-18 11:39:46 +00:00
Kai Vehmanen
003b786b67
ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older
...
Originally in commit b2ebcf42a4 ("ASoC: SOF: free widgets in
sof_tear_down_pipelines() for static pipelines"), freeing of pipeline
components at suspend was only done with recent FW as there were known
limitations in older firmware versions.
Tests show that if static pipelines are used, i.e. all pipelines are
setup whenever firmware is powered up, the reverse action of freeing all
components at power down, leads to firmware failures with also SOF2.0
and SOF2.1 based firmware.
The problems can be specific to certain topologies with e.g. components
not prepared to be freed at suspend (as this did not happen with older
SOF kernels).
To avoid hitting these problems when kernel is upgraded and used with an
older firmware, bump the firmware requirement to SOF2.2 or newer. If an
older firmware is used, and pipeline is a static one, do not free the
components at suspend. This ensures the suspend flow remains backwards
compatible with older firmware versions. This limitation does not apply
if the product configuration is updated to dynamic pipelines.
The limitation is not linked to firmware ABI, as the interface to free
pipeline components has been available already before ABI3.19. The
problem is in the implementation, so firmware version should be used to
decide whether it is safe to use the newer flow or not. This patch adds
a new SOF_FW_VER() macro to compare SOF firmware release versions.
Link: https://github.com/thesofproject/sof/issues/6475
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20221101114913.1292671-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-11-01 18:28:07 +00:00
Peter Ujfalusi
3ab2c21e65
ASoC: SOF: Intel: Add ipc4 library loading implementation
...
On Intel HDA platforms the library loading is done via DMA and an IPC
message is also need to be sent to initiate the downloading of the new
library.
Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Chao Song <chao.song@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20221020121238.18339-16-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-10-21 13:05:07 +01:00
Gustavo A. R. Silva
b264ef7969
ASoC: SOF: control.h: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
...
Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.
This helper allows for flexible-array members in unions.
Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/211
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Link: https://lore.kernel.org/r/YzIcZ11k8RiQtS2T@work
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-09-27 12:08:00 +01:00
V sujith kumar Reddy
ed2562c64b
ASoC: SOF: Adding amd HS functionality to the sof core
...
Add I2S HS control instance to the sof core.
This will help the amd topology to use the I2S HS Dai.
Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220913144319.1055302-4-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-09-20 19:38:03 +01:00
Peter Ujfalusi
e9bcfea156
ASoC: SOF: ipc4: Add macro to get core ID from log buffer status message
...
The LOG_BUFFER_STATUS message includes the ID of the core which updated
its log buffer.
With IPC4 each core logs to a different slot in the debug window.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20220909114332.31393-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-09-09 18:48:45 +01:00
Brent Lu
af468aadf0
ASoC: SOF: dai-intel: add SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON bit
...
Update definition for mclk always-on feature and increase the
SOF_ABI_MINOR number for interface change.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Brent Lu <brent.lu@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220725195343.145603-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-07-25 22:37:02 +01:00
Daniel Baluta
3f70c360d4
ASoC: SOF: Copy compress parameters into extended data
...
Allocate memory at the end of sof_ipc_stream_params to store
snd_compr_params in order to be sent them to SOF firmware.
This will help firmware correctly configure codecs parameters.
Notice, that we use 2 bytes from the reserved pool in order to store
the extended data length. This is compatible with older FWs where
there was no extended data.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220712141531.14599-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-07-12 15:22:07 +01:00
Ajit Kumar Pandey
689614ce48
ASoC: SOF: topology: add code to parse config params for ACPDMIC dai
...
Add sof_ipc_dai_acpdmic_params and tokens to parse dmic channels and
rate params from topology file
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220614075251.21499-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-06-14 11:22:10 +01:00
Peter Ujfalusi
bd3df9ff25
ASoC: SOF: ipc4: Add set_core_state pm_ops implementation
...
IPC4 uses the SET_DX message to enable/disable cores managed by the DSP.
The dx_state.core_mask indicates which core is going to change state,
the dx_state.dx_mask is to power on (1) or off (0) the core.
In the dx_mask only those bits (cores) checked which bit is set in the
core_mask, other bits (cores) ignored.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220610083549.16773-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-06-10 13:31:41 +01:00
Ranjani Sridharan
71cb8ad1a7
ASoC: SOF: Add header for IPC4 manifest
...
Add the header for the IPC4 manifest.
Co-developed-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Rander Wang <rander.wang@intel.com >
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20220511171648.1622993-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-05-12 11:41:27 +01:00
YC Hung
2cb29da3f2
ASoC: SOF: ipc: introduce cont_update_posn in sof_ipc_stream_params struct
...
The host stream position is updated when no_stream_position is set as 0.
However current implementation updates host stream position only when
report data is larger than or equal to host period size which is decided
by the period size of host side. It maybe cause host stream position
update not in time. Therefore this patch introduces another field
"cont_update_posn", a boolean value aimed to update host stream position
continuously and based on period size of pipeline. It can get better
precise when need to update host stream position from firmware.
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: YC Hung <yc.hung@mediatek.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220509170425.54640-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-05-10 14:01:54 +01:00
Peter Ujfalusi
ed85a6e6fe
ASoC: SOF: Add initial header file for ipc4
...
The header file contains essential structure definitions, description of
bit fields and bits in the ipc4 header and an internally used ipc4 message
container definition.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20220505094818.10346-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-05-05 13:24:44 +01:00
Linus Torvalds
3ce62cf4dc
Merge tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
...
Pull flexible-array transformations from Gustavo Silva:
"Treewide patch that replaces zero-length arrays with flexible-array
members.
This has been baking in linux-next for a whole development cycle"
* tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
treewide: Replace zero-length arrays with flexible-array members
2022-03-24 11:39:32 -07:00
Ranjani Sridharan
839e484f9e
ASoC: SOF: make struct snd_sof_dai IPC agnostic
...
Remove the comp_dai and dai_config members of struct snd_sof_dai and
replace it with a void *private field. Introduce a new struct
sof_dai_private_data that will contain the pointer to these two fields.
The topology parser will populate this structure and save it as part of
the "private" member in snd_sof_dai. Change all users of these fields to
use the private member instead.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220308164344.577647-18-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-03-09 13:30:09 +00:00
Ranjani Sridharan
7a976552a4
ASoC: SOF: make struct snd_sof_widget IPC agnostic
...
Parse the UUID token and save it in the new uuid field in struct
snd_sof_widget. struct sof_ipc_comp_ext is no longer needed. So remove
it too.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220308164344.577647-12-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-03-09 13:30:02 +00:00
Curtis Malainey
4aaa06b227
ASoC: SOF: fix 32 signed bit overflow
...
Shifting in a signed 32bit container past the signed bit is technically
undefined behaviour. Fix by using unsigned types. Found via cppcheck.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com >
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220304205733.62233-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-03-07 13:12:52 +00:00
Stephen Kitt
4fe6a63077
ASoC: SOF: Replace zero-length array with flexible-array member
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use "flexible array members"[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
This helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines
on memcpy().
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/78
Link: https://github.com/KSPP/linux/issues/180
Suggested-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Stephen Kitt <steve@sk2.org >
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Link: https://lore.kernel.org/r/20220217132755.1786130-1-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-02-17 17:13:36 +00:00
Gustavo A. R. Silva
5224f79096
treewide: Replace zero-length arrays with flexible-array members
...
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].
This code was transformed with the help of Coccinelle:
(next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
@@
identifier S, member, array;
type T1, T2;
@@
struct S {
...
T1 member;
T2 array[
- 0
];
};
UAPI and wireless changes were intentionally excluded from this patch
and will be sent out separately.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/78
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
2022-02-17 07:00:39 -06:00