Skip to content

Commit e23b774

Browse files
committed
Audio: template_comp: Add a new SOF template component
This patch contains all needed to add a new minimal SOF component to FW build for TGL and more recent platforms plus sof-testbench4 simulation. the component name is template_comp and it is easy to duplicate for new component development from scratch. The component supports one switch kcontrol. When enabled the component swaps or reverses the channels order if there are two or more channels. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 2b4a565 commit e23b774

17 files changed

Lines changed: 504 additions & 2 deletions

File tree

src/audio/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
115115
list(APPEND base_files host-legacy.c)
116116
sof_list_append_ifdef(CONFIG_COMP_DAI base_files dai-legacy.c)
117117
endif()
118+
if(CONFIG_COMP_TEMPLATE_COMP)
119+
add_subdirectory(template_comp)
120+
endif()
118121
endif()
119122

120123
### Common files (also used in shared library build)

src/audio/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ rsource "mfcc/Kconfig"
164164

165165
rsource "codec/Kconfig"
166166

167+
rsource "template_comp/Kconfig"
168+
167169
endmenu # "Audio components"
168170

169171
menu "Data formats"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
if(CONFIG_COMP_TEMPLATE_COMP STREQUAL "m")
4+
add_subdirectory(llext ${PROJECT_BINARY_DIR}/template_comp_llext)
5+
add_dependencies(app template_comp)
6+
else()
7+
add_local_sources(sof template_comp.c)
8+
endif()

src/audio/template_comp/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
config COMP_TEMPLATE_COMP
4+
tristate "Template_Comp component"
5+
default y
6+
help
7+
Select for template_comp component. Reason for existence
8+
is a minimal component example and possible use as
9+
placeholder in processing pipelines. As example processing
10+
it swaps or reverses the channels when the control switch
11+
is enabled.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2025 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("template_comp"
5+
SOURCES ../template_comp.c
6+
LIB openmodules
7+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <tools/rimage/config/platform.toml>
2+
#define LOAD_TYPE "2"
3+
#include "../template_comp.toml"
4+
5+
[module]
6+
count = __COUNTER__

0 commit comments

Comments
 (0)