| .. | .. |
|---|
| 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 */ |
|---|
| 6 | 2 | |
|---|
| 7 | 3 | #ifndef __MAILBOX_CONTROLLER_H |
|---|
| 8 | 4 | #define __MAILBOX_CONTROLLER_H |
|---|
| .. | .. |
|---|
| 24 | 20 | * transmission of data is reported by the controller via |
|---|
| 25 | 21 | * mbox_chan_txdone (if it has some TX ACK irq). It must not |
|---|
| 26 | 22 | * 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. |
|---|
| 27 | 26 | * @startup: Called when a client requests the chan. The controller |
|---|
| 28 | 27 | * could ask clients for additional parameters of communication |
|---|
| 29 | 28 | * to be provided via client's chan_data. This call may |
|---|
| .. | .. |
|---|
| 46 | 45 | */ |
|---|
| 47 | 46 | struct mbox_chan_ops { |
|---|
| 48 | 47 | int (*send_data)(struct mbox_chan *chan, void *data); |
|---|
| 48 | + int (*flush)(struct mbox_chan *chan, unsigned long timeout); |
|---|
| 49 | 49 | int (*startup)(struct mbox_chan *chan); |
|---|
| 50 | 50 | void (*shutdown)(struct mbox_chan *chan); |
|---|
| 51 | 51 | bool (*last_tx_done)(struct mbox_chan *chan); |
|---|
| .. | .. |
|---|
| 131 | 131 | void mbox_chan_received_data(struct mbox_chan *chan, void *data); /* atomic */ |
|---|
| 132 | 132 | void mbox_chan_txdone(struct mbox_chan *chan, int r); /* atomic */ |
|---|
| 133 | 133 | |
|---|
| 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 | + |
|---|
| 134 | 139 | #endif /* __MAILBOX_CONTROLLER_H */ |
|---|