Skip to content

Commit 13485fe

Browse files
committed
ipc4: notification: Separate resource_notif_header_init function
Separate common resource event notification initialization code to a new resource_notif_header_init function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 7b71819 commit 13485fe

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/ipc/ipc4/notification.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@
99
#include <stdbool.h>
1010
#include <ipc4/notification.h>
1111

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)
1413
{
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;
1615
union ipc4_notification_header header;
1716

1817
header.r.notif_type = SOF_IPC4_NOTIFY_RESOURCE_EVENT;
1918
header.r.type = SOF_IPC4_GLB_NOTIFICATION;
2019
header.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST;
2120
header.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG;
22-
msg_xrun->header = header.dat;
21+
msg->header = header.dat;
22+
memset(&notif_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);
2330

2431
notif_data->resource_id = resource_id;
2532
notif_data->event_type = event_type;
2633
notif_data->resource_type = SOF_IPC4_GATEWAY;
27-
memset(&notif_data->event_data, 0, sizeof(notif_data->event_data));
2834
}
2935
#endif

0 commit comments

Comments
 (0)