From a2cf03a83fe8b1e3673cb2fb8b593e0806e92bf3 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 12:12:43 +0100 Subject: [PATCH 1/7] Kconfig: make FIR component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 12 ++++++++---- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 3328cf9d6a1d..82a602451832 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -11,6 +11,7 @@ set(CONFIG_HOST 1) set(CONFIG_LIB 1) set(CONFIG_COMP_VOLUME 1) set(CONFIG_COMP_SRC 1) +set(CONFIG_COMP_FIR 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 2acb0a09150c..596344f1d4d6 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -2,3 +2,4 @@ #define CONFIG_LIB @CONFIG_LIB@ #define CONFIG_COMP_VOLUME @CONFIG_COMP_VOLUME@ #define CONFIG_COMP_SRC @CONFIG_COMP_SRC@ +#define CONFIG_COMP_FIR @CONFIG_COMP_FIR@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 394be214eb51..ce647b45ac7d 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -2,10 +2,6 @@ if(NOT BUILD_HOST) add_local_sources(sof eq_iir.c iir.c - eq_fir.c - fir.c - fir_hifi2ep.c - fir_hifi3.c tone.c mixer.c mux.c @@ -32,6 +28,14 @@ if(NOT BUILD_HOST) src_hifi3.c ) endif() + if(CONFIG_COMP_FIR) + add_local_sources(sof + eq_fir.c + fir.c + fir_hifi2ep.c + fir_hifi3.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index b60b1db78fea..42447c36988b 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -12,4 +12,10 @@ config COMP_SRC help Select for SRC component +config COMP_FIR + bool "FIR component" + default y + help + Select for FIR component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 3756cdd0806a..5f3a98d5497a 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -511,7 +511,11 @@ static inline void sys_comp_src_init(void) {} #endif void sys_comp_tone_init(void); void sys_comp_eq_iir_init(void); +#ifdef CONFIG_COMP_FIR void sys_comp_eq_fir_init(void); +#else +static inline void sys_comp_eq_fir_init(void) {} +#endif /** @}*/ From 3bb1f4dce677b54115c421d7322a0258fe271a5f Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 12:36:29 +0100 Subject: [PATCH 2/7] Kconfig: make IIR component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 8 ++++++-- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 82a602451832..dded769f33c1 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -12,6 +12,7 @@ set(CONFIG_LIB 1) set(CONFIG_COMP_VOLUME 1) set(CONFIG_COMP_SRC 1) set(CONFIG_COMP_FIR 1) +set(CONFIG_COMP_IIR 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 596344f1d4d6..dac7b16fac17 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -3,3 +3,4 @@ #define CONFIG_COMP_VOLUME @CONFIG_COMP_VOLUME@ #define CONFIG_COMP_SRC @CONFIG_COMP_SRC@ #define CONFIG_COMP_FIR @CONFIG_COMP_FIR@ +#define CONFIG_COMP_IIR @CONFIG_COMP_IIR@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index ce647b45ac7d..67b7abdcef91 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,7 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - eq_iir.c - iir.c tone.c mixer.c mux.c @@ -36,6 +34,12 @@ if(NOT BUILD_HOST) fir_hifi3.c ) endif() + if(CONFIG_COMP_IIR) + add_local_sources(sof + eq_iir.c + iir.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 42447c36988b..50ca7730415e 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -18,4 +18,10 @@ config COMP_FIR help Select for FIR component +config COMP_IIR + bool "IIR component" + default y + help + Select for IIR component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 5f3a98d5497a..901f2648245d 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -510,7 +510,11 @@ void sys_comp_src_init(void); static inline void sys_comp_src_init(void) {} #endif void sys_comp_tone_init(void); +#ifdef CONFIG_COMP_IIR void sys_comp_eq_iir_init(void); +#else +static inline void sys_comp_eq_iir_init(void) {} +#endif #ifdef CONFIG_COMP_FIR void sys_comp_eq_fir_init(void); #else From 54a0905b5a6518dec1c28837723cd2a705c5be9e Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 13:01:16 +0100 Subject: [PATCH 3/7] Kconfig: make Tone component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 6 +++++- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index dded769f33c1..733cf614514d 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -13,6 +13,7 @@ set(CONFIG_COMP_VOLUME 1) set(CONFIG_COMP_SRC 1) set(CONFIG_COMP_FIR 1) set(CONFIG_COMP_IIR 1) +set(CONFIG_COMP_TONE 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index dac7b16fac17..5d14bf49180d 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -4,3 +4,4 @@ #define CONFIG_COMP_SRC @CONFIG_COMP_SRC@ #define CONFIG_COMP_FIR @CONFIG_COMP_FIR@ #define CONFIG_COMP_IIR @CONFIG_COMP_IIR@ +#define CONFIG_COMP_TONE @CONFIG_COMP_TONE@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 67b7abdcef91..aa6399623e25 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,6 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - tone.c mixer.c mux.c switch.c @@ -40,6 +39,11 @@ if(NOT BUILD_HOST) iir.c ) endif() + if(CONFIG_COMP_TONE) + add_local_sources(sof + tone.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 50ca7730415e..bd94bbf1a73f 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -24,4 +24,10 @@ config COMP_IIR help Select for IIR component +config COMP_TONE + bool "Tone component" + default y + help + Select for Tone component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 901f2648245d..88390d5a5fa7 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -509,7 +509,11 @@ void sys_comp_src_init(void); #else static inline void sys_comp_src_init(void) {} #endif +#ifdef CONFIG_COMP_TONE void sys_comp_tone_init(void); +#else +static inline void sys_comp_tone_init(void) {} +#endif #ifdef CONFIG_COMP_IIR void sys_comp_eq_iir_init(void); #else From 41fe6479fcb09cf8ce51f9c9c909d322023900af Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 13:26:53 +0100 Subject: [PATCH 4/7] Kconfig: make Mixer component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 6 +++++- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ test/cmocka/src/audio/CMakeLists.txt | 4 +++- 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 733cf614514d..b482506b77f3 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -14,6 +14,7 @@ set(CONFIG_COMP_SRC 1) set(CONFIG_COMP_FIR 1) set(CONFIG_COMP_IIR 1) set(CONFIG_COMP_TONE 1) +set(CONFIG_COMP_MIXER 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 5d14bf49180d..66c79d899c0a 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -5,3 +5,4 @@ #define CONFIG_COMP_FIR @CONFIG_COMP_FIR@ #define CONFIG_COMP_IIR @CONFIG_COMP_IIR@ #define CONFIG_COMP_TONE @CONFIG_COMP_TONE@ +#define CONFIG_COMP_MIXER @CONFIG_COMP_MIXER@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index aa6399623e25..e17e70e298c6 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,6 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - mixer.c mux.c switch.c dai.c @@ -44,6 +43,11 @@ if(NOT BUILD_HOST) tone.c ) endif() + if(CONFIG_COMP_MIXER) + add_local_sources(sof + mixer.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index bd94bbf1a73f..1a5c85ec0d75 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -30,4 +30,10 @@ config COMP_TONE help Select for Tone component +config COMP_MIXER + bool "Mixer component" + default y + help + Select for Mixer component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 88390d5a5fa7..706dc8ac7b21 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -496,7 +496,11 @@ void sys_comp_init(void); /* default base component initialisations */ void sys_comp_dai_init(void); void sys_comp_host_init(void); +#ifdef CONFIG_COMP_MIXER void sys_comp_mixer_init(void); +#else +static inline void sys_comp_mixer_init(void) {} +#endif void sys_comp_mux_init(void); void sys_comp_switch_init(void); #ifdef CONFIG_COMP_VOLUME diff --git a/test/cmocka/src/audio/CMakeLists.txt b/test/cmocka/src/audio/CMakeLists.txt index 2f808759125c..4e9fd26650f6 100644 --- a/test/cmocka/src/audio/CMakeLists.txt +++ b/test/cmocka/src/audio/CMakeLists.txt @@ -1,6 +1,8 @@ add_subdirectory(buffer) add_subdirectory(component) -add_subdirectory(mixer) +if(CONFIG_COMP_MIXER) + add_subdirectory(mixer) +endif() add_subdirectory(pipeline) if(CONFIG_COMP_VOLUME) add_subdirectory(volume) From 7807c2f226b72d45b126122e102dcd7febb2bf70 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 13:43:06 +0100 Subject: [PATCH 5/7] Kconfig: make MUX component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 6 +++++- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index b482506b77f3..65ff256cc37a 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -15,6 +15,7 @@ set(CONFIG_COMP_FIR 1) set(CONFIG_COMP_IIR 1) set(CONFIG_COMP_TONE 1) set(CONFIG_COMP_MIXER 1) +set(CONFIG_COMP_MUX 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 66c79d899c0a..9daa3b857d78 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -6,3 +6,4 @@ #define CONFIG_COMP_IIR @CONFIG_COMP_IIR@ #define CONFIG_COMP_TONE @CONFIG_COMP_TONE@ #define CONFIG_COMP_MIXER @CONFIG_COMP_MIXER@ +#define CONFIG_COMP_MUX @CONFIG_COMP_MUX@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index e17e70e298c6..f696f6d9a1fd 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,6 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - mux.c switch.c dai.c host.c @@ -48,6 +47,11 @@ if(NOT BUILD_HOST) mixer.c ) endif() + if(CONFIG_COMP_MUX) + add_local_sources(sof + mux.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 1a5c85ec0d75..41a286c08a2d 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -36,4 +36,10 @@ config COMP_MIXER help Select for Mixer component +config COMP_MUX + bool "MUX component" + default y + help + Select for MUX component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 706dc8ac7b21..8843c0bb2c6e 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -501,7 +501,11 @@ void sys_comp_mixer_init(void); #else static inline void sys_comp_mixer_init(void) {} #endif +#ifdef CONFIG_COMP_MUX void sys_comp_mux_init(void); +#else +static inline void sys_comp_mux_init(void) {} +#endif void sys_comp_switch_init(void); #ifdef CONFIG_COMP_VOLUME void sys_comp_volume_init(void); From 97e0c9749671ef4914bd1bc461a67f8c48f6b6ad Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 15:05:44 +0100 Subject: [PATCH 6/7] Kconfig: make Switch component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 6 +++++- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 65ff256cc37a..f3e411a87926 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -16,6 +16,7 @@ set(CONFIG_COMP_IIR 1) set(CONFIG_COMP_TONE 1) set(CONFIG_COMP_MIXER 1) set(CONFIG_COMP_MUX 1) +set(CONFIG_COMP_SWITCH 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 9daa3b857d78..ea5b89ad7f9e 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -7,3 +7,4 @@ #define CONFIG_COMP_TONE @CONFIG_COMP_TONE@ #define CONFIG_COMP_MIXER @CONFIG_COMP_MIXER@ #define CONFIG_COMP_MUX @CONFIG_COMP_MUX@ +#define CONFIG_COMP_SWITCH @CONFIG_COMP_SWITCH@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index f696f6d9a1fd..63b95ab4f01b 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,6 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - switch.c dai.c host.c pipeline.c @@ -52,6 +51,11 @@ if(NOT BUILD_HOST) mux.c ) endif() + if(CONFIG_COMP_SWITCH) + add_local_sources(sof + switch.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 41a286c08a2d..f6f5a3390ff3 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -42,4 +42,10 @@ config COMP_MUX help Select for MUX component +config COMP_SWITCH + bool "Switch component" + default y + help + Select for Switch component + endmenu diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 8843c0bb2c6e..83bec2071b9a 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -506,7 +506,11 @@ void sys_comp_mux_init(void); #else static inline void sys_comp_mux_init(void) {} #endif +#ifdef CONFIG_COMP_SWITCH void sys_comp_switch_init(void); +#else +static inline void sys_comp_switch_init(void) {} +#endif #ifdef CONFIG_COMP_VOLUME void sys_comp_volume_init(void); #else From f4ed234b2279d5d85bae15b08902554c0b965a02 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 11 Feb 2019 15:26:39 +0100 Subject: [PATCH 7/7] Kconfig: make DAI component a config option Signed-off-by: Adrian Bonislawski --- src/arch/host/CMakeLists.txt | 1 + src/arch/host/config.h.in | 1 + src/audio/CMakeLists.txt | 6 +++++- src/audio/Kconfig | 6 ++++++ src/include/sof/audio/component.h | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index f3e411a87926..4bfd37396cfb 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -17,6 +17,7 @@ set(CONFIG_COMP_TONE 1) set(CONFIG_COMP_MIXER 1) set(CONFIG_COMP_MUX 1) set(CONFIG_COMP_SWITCH 1) +set(CONFIG_COMP_DAI 1) configure_file ( "${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in" diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index ea5b89ad7f9e..f4dca43951ee 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -8,3 +8,4 @@ #define CONFIG_COMP_MIXER @CONFIG_COMP_MIXER@ #define CONFIG_COMP_MUX @CONFIG_COMP_MUX@ #define CONFIG_COMP_SWITCH @CONFIG_COMP_SWITCH@ +#define CONFIG_COMP_DAI @CONFIG_COMP_DAI@ diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 63b95ab4f01b..0093d5cbd851 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,6 +1,5 @@ if(NOT BUILD_HOST) add_local_sources(sof - dai.c host.c pipeline.c pipeline_static.c @@ -56,6 +55,11 @@ if(NOT BUILD_HOST) switch.c ) endif() + if(CONFIG_COMP_DAI) + add_local_sources(sof + dai.c + ) + endif() return() endif() diff --git a/src/audio/Kconfig b/src/audio/Kconfig index f6f5a3390ff3..34a83efa00e8 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -1,5 +1,11 @@ menu "Audio components" +config COMP_DAI + bool "DAI component" + default y + help + Select for DAI component + config COMP_VOLUME bool "Volume component" default y diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 83bec2071b9a..01e8563cd68c 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -494,7 +494,11 @@ static inline void comp_cache(struct comp_dev *dev, int cmd) void sys_comp_init(void); /* default base component initialisations */ +#ifdef CONFIG_COMP_DAI void sys_comp_dai_init(void); +#else +static inline void sys_comp_dai_init(void) {} +#endif void sys_comp_host_init(void); #ifdef CONFIG_COMP_MIXER void sys_comp_mixer_init(void);