[Sound-open-firmware] [PATCH] pipeline: add API to cancel any pipeline work

Liam Girdwood liam.r.girdwood at linux.intel.com
Wed Sep 20 15:57:59 CEST 2017


Add an API call to allow pipelines to cancel any scheduled work.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/audio/pipeline.c              | 6 ++++++
 src/include/reef/audio/pipeline.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c
index 687efe9..626cc92 100644
--- a/src/audio/pipeline.c
+++ b/src/audio/pipeline.c
@@ -953,9 +953,15 @@ void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev)
 {
 	schedule_task(&p->pipe_task, p->ipc_pipe.deadline,
 		p->ipc_pipe.priority, dev);
+
 	schedule();
 }
 
+void pipeline_schedule_cancel(struct pipeline *p, struct comp_dev *dev)
+{
+	schedule_task_complete(&p->pipe_task);
+}
+
 static void pipeline_task(void *arg)
 {
 	struct pipeline *p = arg;
diff --git a/src/include/reef/audio/pipeline.h b/src/include/reef/audio/pipeline.h
index ad01dfd..29c509f 100644
--- a/src/include/reef/audio/pipeline.h
+++ b/src/include/reef/audio/pipeline.h
@@ -113,6 +113,7 @@ int init_pipeline(void);
 
 /* schedule a copy operation for this pipeline */
 void pipeline_schedule_copy(struct pipeline *p, struct comp_dev *dev);
+void pipeline_schedule_cancel(struct pipeline *p, struct comp_dev *dev);
 
 /* get time pipeline timestamps from host to dai */
 void pipeline_get_timestamp(struct pipeline *p, struct comp_dev *host_dev,
-- 
2.11.0



More information about the Sound-open-firmware mailing list