[Sound-open-firmware] [PATCH 2/2] agent: integrate system agent into idle loop.

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Dec 21 18:18:04 CET 2017


Initialise the SA during platform init and then notify SA of idle in the
main audio loop.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/platform/baytrail/platform.c | 4 ++++
 src/tasks/audio.c                | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c
index 5cda2da..3114ac1 100644
--- a/src/platform/baytrail/platform.c
+++ b/src/platform/baytrail/platform.c
@@ -46,6 +46,7 @@
 #include <reef/clock.h>
 #include <reef/ipc.h>
 #include <reef/trace.h>
+#include <reef/agent.h>
 #include <reef/dma-trace.h>
 #include <reef/audio/component.h>
 #include <config.h>
@@ -284,6 +285,9 @@ int platform_init(struct reef *reef)
 	trace_point(TRACE_BOOT_PLATFORM_CLOCK);
 	init_platform_clocks();
 
+	/* init the system agent */
+	sa_init(reef);
+
 	/* Set CPU to default frequency for booting */
 	trace_point(TRACE_BOOT_SYS_CPU_FREQ);
 	clock_set_freq(CLK_CPU, CLK_MAX_CPU_HZ);
diff --git a/src/tasks/audio.c b/src/tasks/audio.c
index af241d7..800aa36 100644
--- a/src/tasks/audio.c
+++ b/src/tasks/audio.c
@@ -36,6 +36,7 @@
 #include <reef/timer.h>
 #include <reef/interrupt.h>
 #include <reef/ipc.h>
+#include <reef/agent.h>
 #include <platform/interrupt.h>
 #include <platform/shim.h>
 #include <reef/audio/pipeline.h>
@@ -81,12 +82,13 @@ int do_task(struct reef *reef)
 	while (1) {
 
 		/* sleep until next IPC or DMA */
+		sa_enter_idle(reef);
 		wait_for_interrupt(0);
 
 		/* now process any IPC messages from host */
 		ipc_process_msg_queue();
 
-		/* schedule any idle taks */
+		/* schedule any idle tasks */
 		schedule();
 	}
 
-- 
2.14.1



More information about the Sound-open-firmware mailing list