diff --git a/src/include/sof/lib/agent.h b/src/include/sof/lib/agent.h index b8b785ca9..b271898ea 100644 --- a/src/include/sof/lib/agent.h +++ b/src/include/sof/lib/agent.h @@ -9,6 +9,7 @@ #define __SOF_LIB_AGENT_H__ #include +#include #include #include @@ -22,6 +23,14 @@ struct sa { struct task work; }; +#if CONFIG_HAVE_AGENT + void sa_init(struct sof *sof, uint64_t timeout); +#else + +static inline void sa_init(struct sof *sof, uint64_t timeout) { } + +#endif + #endif /* __SOF_LIB_AGENT_H__ */ diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 42f90d659..d1b957c52 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -5,11 +5,14 @@ if(BUILD_LIBRARY) return() endif() +if(CONFIG_HAVE_AGENT) + add_local_sources(sof agent.c) +endif() + add_local_sources(sof lib.c alloc.c notifier.c - agent.c pm_runtime.c clk.c dma.c diff --git a/src/platform/Kconfig b/src/platform/Kconfig index 1a3b0e543..fc8ba733d 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -245,4 +245,12 @@ config SYSTICK_PERIOD as a timeout check value for system agent. Value should be provided in microseconds. +config HAVE_AGENT + bool "Enable system agent" + default y + help + Enables system agent. It can be disabled on systems + which are still unstable and cannot assure that + system agent will always execute on time. + endmenu