diff options
author | Tony Lindgren <tony@atomide.com> | 2009-10-20 12:40:47 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-10-20 12:40:47 -0400 |
commit | ce491cf85466c3377228c5a852ea627ec5136956 (patch) | |
tree | 3396aa3dc80ac30de662b59218d3bf788d105996 /arch/arm/plat-omap/include/plat/mailbox.h | |
parent | 3eff851b9dc1e84aa0822772e0be9afb0c973585 (diff) |
omap: headers: Move remaining headers from include/mach to include/plat
Move the remaining headers under plat-omap/include/mach
to plat-omap/include/plat. Also search and replace the
files using these headers to include using the right path.
This was done with:
#!/bin/bash
mach_dir_old="arch/arm/plat-omap/include/mach"
plat_dir_new="arch/arm/plat-omap/include/plat"
headers=$(cd $mach_dir_old && ls *.h)
omap_dirs="arch/arm/*omap*/ \
drivers/video/omap \
sound/soc/omap"
other_files="drivers/leds/leds-ams-delta.c \
drivers/mfd/menelaus.c \
drivers/mfd/twl4030-core.c \
drivers/mtd/nand/ams-delta.c"
for header in $headers; do
old="#include <mach\/$header"
new="#include <plat\/$header"
for dir in $omap_dirs; do
find $dir -type f -name \*.[chS] | \
xargs sed -i "s/$old/$new/"
done
find drivers/ -type f -name \*omap*.[chS] | \
xargs sed -i "s/$old/$new/"
for file in $other_files; do
sed -i "s/$old/$new/" $file
done
done
for header in $(ls $mach_dir_old/*.h); do
git mv $header $plat_dir_new/
done
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/mailbox.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/mailbox.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h new file mode 100644 index 00000000000..b7a6991814e --- /dev/null +++ b/arch/arm/plat-omap/include/plat/mailbox.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* mailbox.h */ | ||
2 | |||
3 | #ifndef MAILBOX_H | ||
4 | #define MAILBOX_H | ||
5 | |||
6 | #include <linux/wait.h> | ||
7 | #include <linux/workqueue.h> | ||
8 | #include <linux/blkdev.h> | ||
9 | |||
10 | typedef u32 mbox_msg_t; | ||
11 | typedef void (mbox_receiver_t)(mbox_msg_t msg); | ||
12 | struct omap_mbox; | ||
13 | |||
14 | typedef int __bitwise omap_mbox_irq_t; | ||
15 | #define IRQ_TX ((__force omap_mbox_irq_t) 1) | ||
16 | #define IRQ_RX ((__force omap_mbox_irq_t) 2) | ||
17 | |||
18 | typedef int __bitwise omap_mbox_type_t; | ||
19 | #define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1) | ||
20 | #define OMAP_MBOX_TYPE2 ((__force omap_mbox_type_t) 2) | ||
21 | |||
22 | struct omap_mbox_ops { | ||
23 | omap_mbox_type_t type; | ||
24 | int (*startup)(struct omap_mbox *mbox); | ||
25 | void (*shutdown)(struct omap_mbox *mbox); | ||
26 | /* fifo */ | ||
27 | mbox_msg_t (*fifo_read)(struct omap_mbox *mbox); | ||
28 | void (*fifo_write)(struct omap_mbox *mbox, mbox_msg_t msg); | ||
29 | int (*fifo_empty)(struct omap_mbox *mbox); | ||
30 | int (*fifo_full)(struct omap_mbox *mbox); | ||
31 | /* irq */ | ||
32 | void (*enable_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); | ||
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); | ||
39 | }; | ||
40 | |||
41 | struct omap_mbox_queue { | ||
42 | spinlock_t lock; | ||
43 | struct request_queue *queue; | ||
44 | struct work_struct work; | ||
45 | int (*callback)(void *); | ||
46 | struct omap_mbox *mbox; | ||
47 | }; | ||
48 | |||
49 | struct omap_mbox { | ||
50 | char *name; | ||
51 | unsigned int irq; | ||
52 | |||
53 | struct omap_mbox_queue *txq, *rxq; | ||
54 | |||
55 | struct omap_mbox_ops *ops; | ||
56 | |||
57 | mbox_msg_t seq_snd, seq_rcv; | ||
58 | |||
59 | struct device *dev; | ||
60 | |||
61 | struct omap_mbox *next; | ||
62 | void *priv; | ||
63 | |||
64 | void (*err_notify)(void); | ||
65 | }; | ||
66 | |||
67 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg, void *); | ||
68 | void omap_mbox_init_seq(struct omap_mbox *); | ||
69 | |||
70 | struct omap_mbox *omap_mbox_get(const char *); | ||
71 | void omap_mbox_put(struct omap_mbox *); | ||
72 | |||
73 | int omap_mbox_register(struct device *parent, struct omap_mbox *); | ||
74 | int omap_mbox_unregister(struct omap_mbox *); | ||
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 | |||
96 | #endif /* MAILBOX_H */ | ||