Skip to content

Commit 37cf7a8

Browse files
ujfalusiplbossart
authored andcommitted
ASoC: SOF: ipc4: Add data struct for module notification message from firmware
With the module notification message the information about the notification is provided via the mailbox with the sof_ipc4_notify_module_data struct. It contains the module and instance id of the sender of the notification, the event_id and optionally additional data which is module and event specific. At the same time add definitions to identify ALSA kcontrol change notification. These notifications use standardized event_id, modules must follow this if they support such notifications: upper 16 bit: 0xA15A as a magic identification value lower 16 bit: param_id of the changed control Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 7b66d0a commit 37cf7a8

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

include/sound/sof/ipc4/header.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,35 @@ struct sof_ipc4_notify_resource_data {
532532
#define SOF_IPC4_DEBUG_SLOT_TELEMETRY 0x4c455400
533533
#define SOF_IPC4_DEBUG_SLOT_BROKEN 0x44414544
534534

535+
/**
536+
* struct sof_ipc4_notify_module_data - payload for module notification
537+
* @instance_id: instance ID of the originator module of the notification
538+
* @module_id: module ID of the originator of the notification
539+
* @event_id: module specific event id
540+
* @event_data_size: Size of the @event_data (if any) in bytes
541+
* @event_data: Optional notification data, module and notification dependent
542+
*/
543+
struct sof_ipc4_notify_module_data {
544+
uint16_t instance_id;
545+
uint16_t module_id;
546+
uint32_t event_id;
547+
uint32_t event_data_size;
548+
uint8_t event_data[];
549+
} __packed __aligned(4);
550+
551+
/*
552+
* ALSA kcontrol change notification
553+
*
554+
* The event_id of struct sof_ipc4_notify_module_data is divided into two u16:
555+
* upper u16: magic number for ALSA kcontrol types: 0xA15A
556+
* lower u16: param_id of the control, which is the type of the control
557+
* The event_data contains the struct sof_ipc4_control_msg_payload of the control
558+
* which sent the notification.
559+
*/
560+
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_MASK GENMASK(31, 16)
561+
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL 0xA15A0000
562+
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_PARAMID_MASK GENMASK(15, 0)
563+
535564
/** @}*/
536565

537566
#endif

0 commit comments

Comments
 (0)