pipeline: add helper to retrieve the pipeline id

Add inline helper pipeline_id() to retrieve the pipeline_id from a
pipeline pointer.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
Keyon Jie 2021-01-20 10:39:59 +08:00 committed by Liam Girdwood
parent f4c9c28bc5
commit 6b590cc42d
1 changed files with 10 additions and 0 deletions

View File

@ -206,6 +206,16 @@ static inline bool pipeline_is_this_cpu(struct pipeline *p)
return p->ipc_pipe.core == cpu_get_id(); return p->ipc_pipe.core == cpu_get_id();
} }
/**
* Retrieves pipeline id from pipeline.
* @param p pipeline.
* @return pipeline id.
*/
static inline uint32_t pipeline_id(struct pipeline *p)
{
return p->ipc_pipe.pipeline_id;
}
/* pipeline creation and destruction */ /* pipeline creation and destruction */
struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc, struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc,
struct comp_dev *cd); struct comp_dev *cd);