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