1 // SPDX-License-Identifier: BSD-3-Clause
2 /*
3  * Copyright(c) 2023 Intel Corporation. All rights reserved.
4  *
5  * Author: Piotr Makaruk <piotr.makaruk@intel.com>
6  */
7 
8 #include <sof/common.h>
9 #include <stdbool.h>
10 #include <ipc4/notification.h>
11 
12 #if CONFIG_XRUN_NOTIFICATIONS_ENABLE
xrun_notif_msg_init(struct ipc_msg * msg_xrun,uint32_t resource_id,uint32_t event_type)13 void xrun_notif_msg_init(struct ipc_msg *msg_xrun, uint32_t resource_id, uint32_t event_type)
14 {
15 	struct ipc4_resource_event_data_notification *notif_data = msg_xrun->tx_data;
16 	union ipc4_notification_header header;
17 
18 	header.r.notif_type = SOF_IPC4_NOTIFY_RESOURCE_EVENT;
19 	header.r.type = SOF_IPC4_GLB_NOTIFICATION;
20 	header.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST;
21 	header.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG;
22 	msg_xrun->header = header.dat;
23 
24 	notif_data->resource_id = resource_id;
25 	notif_data->event_type = event_type;
26 	notif_data->resource_type = SOF_IPC4_GATEWAY;
27 	memset(&notif_data->event_data, 0, sizeof(notif_data->event_data));
28 }
29 #endif
30