1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
3 * Apple mailbox message format
5 * Copyright The Asahi Linux Contributors
8 #ifndef _APPLE_MAILBOX_H_
9 #define _APPLE_MAILBOX_H_
11 #include <linux/device.h>
12 #include <linux/types.h>
14 /* encodes a single 96bit message sent over the single channel */
15 struct apple_mbox_msg {
23 const struct apple_mbox_hw *hw;
26 int irq_recv_not_empty;
32 struct completion tx_empty;
34 /** Receive callback for incoming messages */
35 void (*rx)(struct apple_mbox *mbox, struct apple_mbox_msg msg, void *cookie);
39 struct apple_mbox *apple_mbox_get(struct device *dev, int index);
40 struct apple_mbox *apple_mbox_get_byname(struct device *dev, const char *name);
42 int apple_mbox_start(struct apple_mbox *mbox);
43 void apple_mbox_stop(struct apple_mbox *mbox);
44 int apple_mbox_poll(struct apple_mbox *mbox);
45 int apple_mbox_send(struct apple_mbox *mbox, struct apple_mbox_msg msg,