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