ipc: initial host notification support

Provides ipc_send_comp_notification function for
sending custom notifications to the host.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
This commit is contained in:
Slawomir Blauciak 2019-03-29 13:47:18 +01:00 committed by Liam Girdwood
parent 06c030defc
commit 0bcc7a597b
2 changed files with 16 additions and 0 deletions

View File

@ -144,6 +144,8 @@ void ipc_schedule_process(struct ipc *ipc);
int ipc_stream_send_position(struct comp_dev *cdev,
struct sof_ipc_stream_posn *posn);
int ipc_send_comp_notification(struct comp_dev *cdev,
struct sof_ipc_comp_event *event);
int ipc_stream_send_xrun(struct comp_dev *cdev,
struct sof_ipc_stream_posn *posn);

View File

@ -437,6 +437,20 @@ int ipc_stream_send_position(struct comp_dev *cdev,
sizeof(*posn), 0);
}
/* send component notification */
int ipc_send_comp_notification(struct comp_dev *cdev,
struct sof_ipc_comp_event *event)
{
event->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG |
SOF_IPC_COMP_NOTIFICATION | cdev->comp.id;
event->rhdr.hdr.size = sizeof(*event);
event->src_comp_type = cdev->comp.type;
event->src_comp_id = cdev->comp.id;
return ipc_queue_host_message(_ipc, event->rhdr.hdr.cmd, event,
sizeof(*event), 0);
}
/* send stream position TODO: send compound message */
int ipc_stream_send_xrun(struct comp_dev *cdev,
struct sof_ipc_stream_posn *posn)