From aaf354fc8daca0b783dc0e1f05caf89d6485fdaf Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Wed, 26 Sep 2018 10:25:47 +0200 Subject: [PATCH] ipc: add support for comp cmd on slave cores Adds support for executing component command on pipelines executed on slave cores. Signed-off-by: Tomasz Lauda --- src/ipc/handler.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/ipc/handler.c b/src/ipc/handler.c index a53c715c2..b724cfa03 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -53,12 +53,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #define iGS(x) ((x >> SOF_GLB_TYPE_SHIFT) & 0xf) @@ -767,6 +769,29 @@ static int ipc_glb_debug_message(uint32_t header) * Topology IPC Operations. */ +static int ipc_comp_cmd(struct comp_dev *dev, int cmd, + struct sof_ipc_ctrl_data *data) +{ + struct idc_msg comp_cmd_msg; + int core = dev->pipeline->ipc_pipe.core; + + /* pipeline scheduled on current core */ + if (cpu_get_id() == core) + return comp_cmd(dev, cmd, data); + + /* check if requested core is enabled */ + if (!cpu_is_core_enabled(core)) + return -EINVAL; + + /* build IDC message */ + comp_cmd_msg.header = IDC_MSG_COMP_CMD; + comp_cmd_msg.extension = IDC_MSG_COMP_CMD_EXT(cmd); + comp_cmd_msg.core = core; + + /* send IDC component command message */ + return idc_send_msg(&comp_cmd_msg, IDC_BLOCKING); +} + /* get/set component values or runtime data */ static int ipc_comp_value(uint32_t header, uint32_t cmd) { @@ -785,7 +810,7 @@ static int ipc_comp_value(uint32_t header, uint32_t cmd) } /* get component values */ - ret = comp_cmd(comp_dev->cd, cmd, data); + ret = ipc_comp_cmd(comp_dev->cd, cmd, data); if (ret < 0) { trace_ipc_error("eVG"); return ret;