Kconfig: make volume and src components a config option

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This commit is contained in:
Adrian Bonislawski 2019-02-04 12:45:42 +01:00 committed by Liam Girdwood
parent a52a1f2502
commit 7cf738ef51
7 changed files with 47 additions and 8 deletions

View File

@ -3,3 +3,5 @@ source "src/arch/Kconfig"
source "src/platform/Kconfig"
source "src/drivers/Kconfig"
source "src/audio/Kconfig"

View File

@ -9,6 +9,8 @@ target_include_directories(sof_options INTERFACE ${GENERATED_DIRECTORY}/include)
# TODO: add Kconfig support also for testbench when it'll be decoupled from fw
set(CONFIG_HOST 1)
set(CONFIG_LIB 1)
set(CONFIG_COMP_VOLUME 1)
set(CONFIG_COMP_SRC 1)
configure_file (
"${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in"

View File

@ -1,2 +1,4 @@
#define CONFIG_HOST @CONFIG_HOST@
#define CONFIG_LIB @CONFIG_LIB@
#define CONFIG_COMP_VOLUME @CONFIG_COMP_VOLUME@
#define CONFIG_COMP_SRC @CONFIG_COMP_SRC@

View File

@ -7,15 +7,8 @@ if(NOT BUILD_HOST)
fir_hifi2ep.c
fir_hifi3.c
tone.c
src.c
src_generic.c
src_hifi2ep.c
src_hifi3.c
mixer.c
mux.c
volume.c
volume_generic.c
volume_hifi3.c
switch.c
dai.c
host.c
@ -24,6 +17,21 @@ if(NOT BUILD_HOST)
component.c
buffer.c
)
if(CONFIG_COMP_VOLUME)
add_local_sources(sof
volume.c
volume_generic.c
volume_hifi3.c
)
endif()
if(CONFIG_COMP_SRC)
add_local_sources(sof
src.c
src_generic.c
src_hifi2ep.c
src_hifi3.c
)
endif()
return()
endif()

15
src/audio/Kconfig Normal file
View File

@ -0,0 +1,15 @@
menu "Audio components"
config COMP_VOLUME
bool "Volume component"
default y
help
Select for Volume component
config COMP_SRC
bool "SRC component"
default y
help
Select for SRC component
endmenu

View File

@ -499,8 +499,16 @@ void sys_comp_host_init(void);
void sys_comp_mixer_init(void);
void sys_comp_mux_init(void);
void sys_comp_switch_init(void);
#ifdef CONFIG_COMP_VOLUME
void sys_comp_volume_init(void);
#else
static inline void sys_comp_volume_init(void) {}
#endif
#ifdef CONFIG_COMP_SRC
void sys_comp_src_init(void);
#else
static inline void sys_comp_src_init(void) {}
#endif
void sys_comp_tone_init(void);
void sys_comp_eq_iir_init(void);
void sys_comp_eq_fir_init(void);

View File

@ -2,4 +2,6 @@ add_subdirectory(buffer)
add_subdirectory(component)
add_subdirectory(mixer)
add_subdirectory(pipeline)
add_subdirectory(volume)
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()