0001
0002
0003
0004
0005
0006
0007 #ifndef __MAILBOX_CLIENT_H
0008 #define __MAILBOX_CLIENT_H
0009
0010 #include <linux/of.h>
0011 #include <linux/device.h>
0012
0013 struct mbox_chan;
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 struct mbox_client {
0030 struct device *dev;
0031 bool tx_block;
0032 unsigned long tx_tout;
0033 bool knows_txdone;
0034
0035 void (*rx_callback)(struct mbox_client *cl, void *mssg);
0036 void (*tx_prepare)(struct mbox_client *cl, void *mssg);
0037 void (*tx_done)(struct mbox_client *cl, void *mssg, int r);
0038 };
0039
0040 struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
0041 const char *name);
0042 struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index);
0043 int mbox_send_message(struct mbox_chan *chan, void *mssg);
0044 int mbox_flush(struct mbox_chan *chan, unsigned long timeout);
0045 void mbox_client_txdone(struct mbox_chan *chan, int r);
0046 bool mbox_client_peek_data(struct mbox_chan *chan);
0047 void mbox_free_channel(struct mbox_chan *chan);
0048
0049 #endif