diff options
author | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2009-03-23 21:07:26 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-03-23 21:07:26 -0400 |
commit | c75ee7520b4ad48a6948f51ca43b2e46ebd3696a (patch) | |
tree | b3807d91e6bb892db8f35c4e18fd78293926df88 /arch/arm/plat-omap | |
parent | da8cfe03a461fe759041e7f130f96913b262aa6b (diff) |
omap mailbox: add save_/restore_ctx() for PM
To preserve the registers during off-mode
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/mach/mailbox.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h b/arch/arm/plat-omap/include/mach/mailbox.h index 577db6852f43..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 { |
@@ -70,4 +73,24 @@ void omap_mbox_put(struct omap_mbox *); | |||
70 | int omap_mbox_register(struct device *parent, 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 */ |