From: Yan Wang yan.wang@linux.intel.com
When SOF side receives trace level IPC message, set it to global trace level array or component structure for future usage.
Signed-off-by: Yan Wang yan.wang@linux.intel.com --- Test with: CNL nocodec SOF master: c1f2682c210201bbbc96fce7b382b25b90d19775 SOF-Tool master: 86fe688a2b4f68a1ce87e0951686be12a00f1a3c https://github.com/plbossart/sound/tree/topic/sof-v4.14: d09db67c5a9d6dfc85f700669fa2e43c678c8d51 --- src/ipc/handler.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 581ce9e..41290ca 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -510,6 +510,34 @@ static int ipc_glb_pm_message(uint32_t header) * Debug IPC Operations. */
+static int ipc_dma_trace_levels(uint32_t header) +{ + struct sof_ipc_dma_trace_levels *levels = _ipc->comp_data; + struct sof_ipc_reply reply; + int err; + + if (levels->comp_id == -1) + err = dma_trace_set_global_level(_ipc->dmat, levels->type, + levels->level); + else + err = ipc_set_comp_level(_ipc, levels->comp_id, levels->level); + + if (err < 0) + goto error; + + /* write reply message to the outbox */ + reply.hdr.size = sizeof(reply); + reply.hdr.cmd = header; + reply.error = 0; + mailbox_hostbox_write(0, &reply, sizeof(reply)); + return 0; + +error: + if (err < 0) + trace_ipc_error("eA!"); + return -EINVAL; +} + static int ipc_dma_trace_config(uint32_t header) { #ifdef CONFIG_HOST_PTABLE @@ -619,6 +647,8 @@ static int ipc_glb_debug_message(uint32_t header) switch (cmd) { case iCS(SOF_IPC_TRACE_DMA_PARAMS): return ipc_dma_trace_config(header); + case iCS(SOF_IPC_TRACE_DMA_LEVELS): + return ipc_dma_trace_levels(header); default: trace_ipc_error("eDc"); trace_error_value(header);