aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mailbox/mailbox.c2
-rw-r--r--include/linux/mailbox_client.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index c281e5562876..58789b027708 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -78,6 +78,8 @@ static void msg_submit(struct mbox_chan *chan)
78 78
79 data = chan->msg_data[idx]; 79 data = chan->msg_data[idx];
80 80
81 if (chan->cl->tx_prepare)
82 chan->cl->tx_prepare(chan->cl, data);
81 /* Try to submit a message to the MBOX controller */ 83 /* Try to submit a message to the MBOX controller */
82 err = chan->mbox->ops->send_data(chan, data); 84 err = chan->mbox->ops->send_data(chan, data);
83 if (!err) { 85 if (!err) {
diff --git a/include/linux/mailbox_client.h b/include/linux/mailbox_client.h
index 307d9cab2026..1726ccbd8009 100644
--- a/include/linux/mailbox_client.h
+++ b/include/linux/mailbox_client.h
@@ -25,6 +25,8 @@ struct mbox_chan;
25 * if the client receives some ACK packet for transmission. 25 * if the client receives some ACK packet for transmission.
26 * Unused if the controller already has TX_Done/RTR IRQ. 26 * Unused if the controller already has TX_Done/RTR IRQ.
27 * @rx_callback: Atomic callback to provide client the data received 27 * @rx_callback: Atomic callback to provide client the data received
28 * @tx_prepare: Atomic callback to ask client to prepare the payload
29 * before initiating the transmission if required.
28 * @tx_done: Atomic callback to tell client of data transmission 30 * @tx_done: Atomic callback to tell client of data transmission
29 */ 31 */
30struct mbox_client { 32struct mbox_client {
@@ -34,6 +36,7 @@ struct mbox_client {
34 bool knows_txdone; 36 bool knows_txdone;
35 37
36 void (*rx_callback)(struct mbox_client *cl, void *mssg); 38 void (*rx_callback)(struct mbox_client *cl, void *mssg);
39 void (*tx_prepare)(struct mbox_client *cl, void *mssg);
37 void (*tx_done)(struct mbox_client *cl, void *mssg, int r); 40 void (*tx_done)(struct mbox_client *cl, void *mssg, int r);
38}; 41};
39 42