aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2014-11-11 18:33:01 +0000
committerJon Medhurst <tixy@linaro.org>2015-04-22 10:41:46 +0100
commit4f94ec6a84dcb3fc2e553f4133fdee262bc28035 (patch)
treede239b2691c3574716cc7c976f44d7a6265a4410 /drivers
parent054a8aca0624ecaff15dd9ff2a74a18449d7778c (diff)
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 <sudeep.holla@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> (cherry picked from commit 97b0c7bd2e86c6e1e00c6b7178cf953d5f70c71a) Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mailbox/mailbox.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index afcb430508ec..4b4044f47b45 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -76,6 +76,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) {