diff options
Diffstat (limited to 'arch/arm/plat-omap/include/mach/mailbox.h')
-rw-r--r-- | arch/arm/plat-omap/include/mach/mailbox.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h b/arch/arm/plat-omap/include/mach/mailbox.h index 7cbed9332e16..b7a6991814ec 100644 --- a/arch/arm/plat-omap/include/mach/mailbox.h +++ b/arch/arm/plat-omap/include/mach/mailbox.h | |||
@@ -33,6 +33,9 @@ struct omap_mbox_ops { | |||
33 | void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 33 | void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); |
34 | void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 34 | void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); |
35 | int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 35 | int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); |
36 | /* ctx */ | ||
37 | void (*save_ctx)(struct omap_mbox *mbox); | ||
38 | void (*restore_ctx)(struct omap_mbox *mbox); | ||
36 | }; | 39 | }; |
37 | 40 | ||
38 | struct omap_mbox_queue { | 41 | struct omap_mbox_queue { |
@@ -53,7 +56,7 @@ struct omap_mbox { | |||
53 | 56 | ||
54 | mbox_msg_t seq_snd, seq_rcv; | 57 | mbox_msg_t seq_snd, seq_rcv; |
55 | 58 | ||
56 | struct device dev; | 59 | struct device *dev; |
57 | 60 | ||
58 | struct omap_mbox *next; | 61 | struct omap_mbox *next; |
59 | void *priv; | 62 | void *priv; |
@@ -67,7 +70,27 @@ void omap_mbox_init_seq(struct omap_mbox *); | |||
67 | struct omap_mbox *omap_mbox_get(const char *); | 70 | struct omap_mbox *omap_mbox_get(const char *); |
68 | void omap_mbox_put(struct omap_mbox *); | 71 | void omap_mbox_put(struct omap_mbox *); |
69 | 72 | ||
70 | int omap_mbox_register(struct omap_mbox *); | 73 | int omap_mbox_register(struct device *parent, struct omap_mbox *); |
71 | int omap_mbox_unregister(struct omap_mbox *); | 74 | int omap_mbox_unregister(struct omap_mbox *); |
72 | 75 | ||
76 | static inline void omap_mbox_save_ctx(struct omap_mbox *mbox) | ||
77 | { | ||
78 | if (!mbox->ops->save_ctx) { | ||
79 | dev_err(mbox->dev, "%s:\tno save\n", __func__); | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | mbox->ops->save_ctx(mbox); | ||
84 | } | ||
85 | |||
86 | static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox) | ||
87 | { | ||
88 | if (!mbox->ops->restore_ctx) { | ||
89 | dev_err(mbox->dev, "%s:\tno restore\n", __func__); | ||
90 | return; | ||
91 | } | ||
92 | |||
93 | mbox->ops->restore_ctx(mbox); | ||
94 | } | ||
95 | |||
73 | #endif /* MAILBOX_H */ | 96 | #endif /* MAILBOX_H */ |