hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/mailbox_controller.h
....@@ -1,8 +1,4 @@
1
-/*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License version 2 as
4
- * published by the Free Software Foundation.
5
- */
1
+/* SPDX-License-Identifier: GPL-2.0-only */
62
73 #ifndef __MAILBOX_CONTROLLER_H
84 #define __MAILBOX_CONTROLLER_H
....@@ -24,6 +20,9 @@
2420 * transmission of data is reported by the controller via
2521 * mbox_chan_txdone (if it has some TX ACK irq). It must not
2622 * sleep.
23
+ * @flush: Called when a client requests transmissions to be blocking but
24
+ * the context doesn't allow sleeping. Typically the controller
25
+ * will implement a busy loop waiting for the data to flush out.
2726 * @startup: Called when a client requests the chan. The controller
2827 * could ask clients for additional parameters of communication
2928 * to be provided via client's chan_data. This call may
....@@ -46,6 +45,7 @@
4645 */
4746 struct mbox_chan_ops {
4847 int (*send_data)(struct mbox_chan *chan, void *data);
48
+ int (*flush)(struct mbox_chan *chan, unsigned long timeout);
4949 int (*startup)(struct mbox_chan *chan);
5050 void (*shutdown)(struct mbox_chan *chan);
5151 bool (*last_tx_done)(struct mbox_chan *chan);
....@@ -131,4 +131,9 @@
131131 void mbox_chan_received_data(struct mbox_chan *chan, void *data); /* atomic */
132132 void mbox_chan_txdone(struct mbox_chan *chan, int r); /* atomic */
133133
134
+int devm_mbox_controller_register(struct device *dev,
135
+ struct mbox_controller *mbox);
136
+void devm_mbox_controller_unregister(struct device *dev,
137
+ struct mbox_controller *mbox);
138
+
134139 #endif /* __MAILBOX_CONTROLLER_H */