1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2022 MediaTek Inc.
9 #include <linux/device.h>
10 #include <linux/types.h>
11 #include <linux/mailbox_controller.h>
12 #include <linux/mailbox_client.h>
14 #define MTK_ADSP_IPC_REQ 0
15 #define MTK_ADSP_IPC_RSP 1
16 #define MTK_ADSP_IPC_OP_REQ 0x1
17 #define MTK_ADSP_IPC_OP_RSP 0x2
21 MTK_ADSP_MBOX_REQUEST,
27 struct mtk_adsp_ipc_ops {
28 void (*handle_reply)(struct mtk_adsp_ipc *ipc);
29 void (*handle_request)(struct mtk_adsp_ipc *ipc);
32 struct mtk_adsp_chan {
33 struct mtk_adsp_ipc *ipc;
34 struct mbox_client cl;
41 struct mtk_adsp_chan chans[MTK_ADSP_MBOX_NUM];
43 const struct mtk_adsp_ipc_ops *ops;
47 static inline void mtk_adsp_ipc_set_data(struct mtk_adsp_ipc *ipc, void *data)
49 ipc->private_data = data;
52 static inline void *mtk_adsp_ipc_get_data(struct mtk_adsp_ipc *ipc)
54 return ipc->private_data;
57 int mtk_adsp_ipc_send(struct mtk_adsp_ipc *ipc, unsigned int idx, uint32_t op);
59 #endif /* MTK_ADSP_IPC_H */