[Sound-open-firmware] [PATCH 2/4] Add API to send DMA trace host offset.

yan.wang at linux.intel.com yan.wang at linux.intel.com
Thu Nov 9 07:17:36 CET 2017


From: Yan Wang <yan.wang at linux.intel.com>

Fill IPC strucure by current host offset and send it.

Signed-off-by: Yan Wang <yan.wang at linux.intel.com>
---
 src/include/reef/ipc.h |  3 +++
 src/ipc/intel-ipc.c    | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/include/reef/ipc.h b/src/include/reef/ipc.h
index 472aca8..fcab45b 100644
--- a/src/include/reef/ipc.h
+++ b/src/include/reef/ipc.h
@@ -166,4 +166,7 @@ struct ipc_comp_dev *ipc_get_comp(struct ipc *ipc, uint32_t id);
  */
 int ipc_comp_dai_config(struct ipc *ipc, struct sof_ipc_dai_config *config);
 
+/* send DMA trace host buffer position to host */
+int ipc_dma_trace_send_position(void);
+
 #endif
diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c
index 902e5a6..1df88c4 100644
--- a/src/ipc/intel-ipc.c
+++ b/src/ipc/intel-ipc.c
@@ -619,6 +619,19 @@ error:
 	return -EINVAL;
 }
 
+/* send DMA trace host buffer position to host */
+int ipc_dma_trace_send_position(void)
+{
+	struct sof_ipc_dma_trace_posn posn;
+
+	posn.rhdr.hdr.cmd =  SOF_IPC_GLB_TRACE_MSG | SOF_IPC_TRACE_DMA_POSITION;
+	posn.host_offset = _ipc->dmat.host_offset;
+	posn.rhdr.hdr.size = sizeof(posn);
+
+	return ipc_queue_host_message(_ipc, posn.rhdr.hdr.cmd, &posn,
+		sizeof(posn), NULL, 0, NULL, NULL);
+}
+
 static int ipc_glb_debug_message(uint32_t header)
 {
 	uint32_t cmd = (header & SOF_CMD_TYPE_MASK) >> SOF_CMD_TYPE_SHIFT;
-- 
2.7.4



More information about the Sound-open-firmware mailing list