Use the
xlnx_register_event()
API to
register handler for the event(s). You can register a single handler for multiple events
by using the OR operator on multiple event
masks.int xlnx_register_event(const enum pm_api_cb_id cb_type, const u32 node_id, const u32 event, const bool wake, event_cb_func_t cb_fun, void *data)
where,
- cb_type
- Type of callback from
pm_api_cb_id
-
PM_NOTIFY_CB
for error events. -
PM_INIT_SUSPEND_CB
for suspend callbacks.
-
- node_id
- The node ID related to the event.
- event
- The event mask for the error event.
- wake
- Flag specifying whether the subsystem should be woken upon event notification.
- cb_fun
- Function pointer to store the callback function.
- data
- Pointer for the driver instance.
For example, register and unregister for the EVENT_ERROR_PMC_ERR1 bit(0)
and bit(1)
errors:
ret = xlnx_register_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1 , (0x1 | 0x2), false, pmc_err1_handler, (void *) data);
ret = xlnx_unregister_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1 , (0x1 | 0x2), pmc_err1_handler);
For a complete list of the available error events, refer to the Versal ACAP Technical Reference Manual (AM011).