From 97b0c7bd2e86c6e1e00c6b7178cf953d5f70c71a Mon Sep 17 00:00:00 2001 From: Sudeep Holla Date: Tue, 11 Nov 2014 18:33:01 +0000 Subject: mailbox: add tx_prepare client callback If the mailbox controller expects the payload is in place before initiating the transmit, then it's impossible to reuse the list maintained by core mailbox code currently. Maintaining another list for sending the message in the controller seems totally unnecessary as core mailbox library already provides that feature. This patch introduces tx_prepare callback in mbox_client which can be used by the core mailbox library before initiating the transaction through mbox->ops->send_data. The client driver can implement this callback to ensure the payload is copied to the shared memory. Signed-off-by: Sudeep Holla Cc: Arnd Bergmann Signed-off-by: Jassi Brar --- drivers/mailbox/mailbox.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/mailbox') diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index c281e55..58789b0 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -78,6 +78,8 @@ static void msg_submit(struct mbox_chan *chan) data = chan->msg_data[idx]; + if (chan->cl->tx_prepare) + chan->cl->tx_prepare(chan->cl, data); /* Try to submit a message to the MBOX controller */ err = chan->mbox->ops->send_data(chan, data); if (!err) { -- cgit v1.1