Skip to content

Commit

Permalink
ipc: initial host notification support
Browse files Browse the repository at this point in the history
Provides ipc_send_comp_notification function for
sending custom notifications to the host.

Signed-off-by: Slawomir Blauciak <[email protected]>
  • Loading branch information
slawblauciak authored and lgirdwood committed Apr 18, 2019
1 parent 06c030d commit 0bcc7a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/sof/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
14 changes: 14 additions & 0 deletions src/ipc/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0bcc7a5

Please sign in to comment.