2 * omap-mbox.h: OMAP mailbox internal definitions
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
12 #include <linux/device.h>
13 #include <linux/interrupt.h>
14 #include <linux/kfifo.h>
15 #include <linux/spinlock.h>
16 #include <linux/workqueue.h>
17 #include <linux/omap-mailbox.h>
19 typedef int __bitwise omap_mbox_type_t;
20 #define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1)
21 #define OMAP_MBOX_TYPE2 ((__force omap_mbox_type_t) 2)
23 struct omap_mbox_ops {
24 omap_mbox_type_t type;
25 int (*startup)(struct omap_mbox *mbox);
26 void (*shutdown)(struct omap_mbox *mbox);
28 mbox_msg_t (*fifo_read)(struct omap_mbox *mbox);
29 void (*fifo_write)(struct omap_mbox *mbox, mbox_msg_t msg);
30 int (*fifo_empty)(struct omap_mbox *mbox);
31 int (*fifo_full)(struct omap_mbox *mbox);
33 void (*enable_irq)(struct omap_mbox *mbox,
35 void (*disable_irq)(struct omap_mbox *mbox,
37 void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
38 int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
40 void (*save_ctx)(struct omap_mbox *mbox);
41 void (*restore_ctx)(struct omap_mbox *mbox);
44 struct omap_mbox_queue {
47 struct work_struct work;
48 struct tasklet_struct tasklet;
49 struct omap_mbox *mbox;
56 struct omap_mbox_queue *txq, *rxq;
57 struct omap_mbox_ops *ops;
61 struct blocking_notifier_head notifier;
64 int omap_mbox_register(struct device *parent, struct omap_mbox **);
65 int omap_mbox_unregister(void);
67 #endif /* OMAP_MBOX_H */