Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 #ifndef _FIRMWARE_XLNX_EVENT_MANAGER_H_
0004 #define _FIRMWARE_XLNX_EVENT_MANAGER_H_
0005 
0006 #include <linux/firmware/xlnx-zynqmp.h>
0007 
0008 #define CB_MAX_PAYLOAD_SIZE (4U) /*In payload maximum 32bytes */
0009 
0010 /************************** Exported Function *****************************/
0011 
0012 typedef void (*event_cb_func_t)(const u32 *payload, void *data);
0013 
0014 #if IS_REACHABLE(CONFIG_XLNX_EVENT_MANAGER)
0015 int xlnx_register_event(const enum pm_api_cb_id cb_type, const u32 node_id,
0016             const u32 event, const bool wake,
0017             event_cb_func_t cb_fun, void *data);
0018 
0019 int xlnx_unregister_event(const enum pm_api_cb_id cb_type, const u32 node_id,
0020               const u32 event, event_cb_func_t cb_fun, void *data);
0021 #else
0022 static inline int xlnx_register_event(const enum pm_api_cb_id cb_type, const u32 node_id,
0023                       const u32 event, const bool wake,
0024                       event_cb_func_t cb_fun, void *data)
0025 {
0026     return -ENODEV;
0027 }
0028 
0029 static inline int xlnx_unregister_event(const enum pm_api_cb_id cb_type, const u32 node_id,
0030                     const u32 event, event_cb_func_t cb_fun, void *data)
0031 {
0032     return -ENODEV;
0033 }
0034 #endif
0035 
0036 #endif /* _FIRMWARE_XLNX_EVENT_MANAGER_H_ */