|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | #include <sof/common.h> |
| 9 | +#include <sof/ipc/msg.h> |
9 | 10 | #include <stdbool.h> |
10 | 11 | #include <ipc4/notification.h> |
11 | 12 |
|
12 | | -#if CONFIG_XRUN_NOTIFICATIONS_ENABLE |
13 | | -void xrun_notif_msg_init(struct ipc_msg *msg_xrun, uint32_t resource_id, uint32_t event_type) |
| 13 | +static void resource_notif_header_init(struct ipc_msg *msg) |
14 | 14 | { |
15 | | - struct ipc4_resource_event_data_notification *notif_data = msg_xrun->tx_data; |
| 15 | + struct ipc4_resource_event_data_notification *notif_data = msg->tx_data; |
16 | 16 | union ipc4_notification_header header; |
17 | 17 |
|
18 | 18 | header.r.notif_type = SOF_IPC4_NOTIFY_RESOURCE_EVENT; |
19 | 19 | header.r.type = SOF_IPC4_GLB_NOTIFICATION; |
20 | 20 | header.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; |
21 | 21 | header.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; |
22 | | - msg_xrun->header = header.dat; |
| 22 | + msg->header = header.dat; |
| 23 | + memset(¬if_data->event_data, 0, sizeof(notif_data->event_data)); |
| 24 | +} |
| 25 | + |
| 26 | +#if CONFIG_XRUN_NOTIFICATIONS_ENABLE |
| 27 | +void xrun_notif_msg_init(struct ipc_msg *msg_xrun, uint32_t resource_id, uint32_t event_type) |
| 28 | +{ |
| 29 | + struct ipc4_resource_event_data_notification *notif_data = msg_xrun->tx_data; |
| 30 | + resource_notif_header_init(msg_xrun); |
23 | 31 |
|
24 | 32 | notif_data->resource_id = resource_id; |
25 | 33 | notif_data->event_type = event_type; |
26 | 34 | notif_data->resource_type = SOF_IPC4_GATEWAY; |
27 | | - memset(¬if_data->event_data, 0, sizeof(notif_data->event_data)); |
28 | 35 | } |
29 | 36 | #endif |
0 commit comments