xlnx-event-manager.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _FIRMWARE_XLNX_EVENT_MANAGER_H_
  3. #define _FIRMWARE_XLNX_EVENT_MANAGER_H_
  4. #include <linux/firmware/xlnx-zynqmp.h>
  5. #define CB_MAX_PAYLOAD_SIZE (4U) /*In payload maximum 32bytes */
  6. /************************** Exported Function *****************************/
  7. typedef void (*event_cb_func_t)(const u32 *payload, void *data);
  8. #if IS_REACHABLE(CONFIG_XLNX_EVENT_MANAGER)
  9. int xlnx_register_event(const enum pm_api_cb_id cb_type, const u32 node_id,
  10. const u32 event, const bool wake,
  11. event_cb_func_t cb_fun, void *data);
  12. int xlnx_unregister_event(const enum pm_api_cb_id cb_type, const u32 node_id,
  13. const u32 event, event_cb_func_t cb_fun, void *data);
  14. #else
  15. static inline int xlnx_register_event(const enum pm_api_cb_id cb_type, const u32 node_id,
  16. const u32 event, const bool wake,
  17. event_cb_func_t cb_fun, void *data)
  18. {
  19. return -ENODEV;
  20. }
  21. static inline int xlnx_unregister_event(const enum pm_api_cb_id cb_type, const u32 node_id,
  22. const u32 event, event_cb_func_t cb_fun, void *data)
  23. {
  24. return -ENODEV;
  25. }
  26. #endif
  27. #endif /* _FIRMWARE_XLNX_EVENT_MANAGER_H_ */