xref: /OK3568_Linux_fs/kernel/include/soc/rockchip/rockchip-mailbox.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2022 Rockchip Electronics Co., Ltd
4  */
5 
6 #ifndef __SOC_ROCKCHIP_MAILBOX_H__
7 #define __SOC_ROCKCHIP_MAILBOX_H__
8 
9 #include <linux/errno.h>
10 #include <linux/types.h>
11 
12 struct mbox_chan;
13 
14 struct rockchip_mbox_msg {
15 	u32 cmd;
16 	u32 data;
17 };
18 
19 #if IS_REACHABLE(CONFIG_ROCKCHIP_MBOX)
20 int rockchip_mbox_read_msg(struct mbox_chan *chan,
21 			   struct rockchip_mbox_msg *msg);
22 #else
rockchip_mbox_read_msg(struct mbox_chan * chan,struct rockchip_mbox_msg * msg)23 static inline int rockchip_mbox_read_msg(struct mbox_chan *chan,
24 					 struct rockchip_mbox_msg *msg)
25 {
26 	return -EOPNOTSUPP;
27 }
28 #endif
29 
30 #endif /* __SOC_ROCKCHIP_MAILBOX_H__ */
31