Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 1 | /* |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 2 | * Mailbox reservation modules for OMAP2/3 |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 3 | * |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 4 | * Copyright (C) 2006-2009 Nokia Corporation |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 5 | * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 6 | * and Paul Mundt |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 7 | * |
| 8 | * This file is subject to the terms and conditions of the GNU General Public |
| 9 | * License. See the file "COPYING" in the main directory of this archive |
| 10 | * for more details. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/clk.h> |
| 15 | #include <linux/err.h> |
| 16 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 17 | #include <linux/io.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 18 | #include <mach/mailbox.h> |
| 19 | #include <mach/irqs.h> |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 20 | |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 21 | #define MAILBOX_REVISION 0x000 |
| 22 | #define MAILBOX_SYSCONFIG 0x010 |
| 23 | #define MAILBOX_SYSSTATUS 0x014 |
| 24 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) |
| 25 | #define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) |
| 26 | #define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) |
| 27 | #define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u)) |
| 28 | #define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u)) |
| 29 | |
| 30 | #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) |
| 31 | #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 32 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 33 | static void __iomem *mbox_base; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 34 | |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 35 | struct omap_mbox2_fifo { |
| 36 | unsigned long msg; |
| 37 | unsigned long fifo_stat; |
| 38 | unsigned long msg_stat; |
| 39 | }; |
| 40 | |
| 41 | struct omap_mbox2_priv { |
| 42 | struct omap_mbox2_fifo tx_fifo; |
| 43 | struct omap_mbox2_fifo rx_fifo; |
| 44 | unsigned long irqenable; |
| 45 | unsigned long irqstatus; |
| 46 | u32 newmsg_bit; |
| 47 | u32 notfull_bit; |
| 48 | }; |
| 49 | |
| 50 | static struct clk *mbox_ick_handle; |
| 51 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 52 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, |
| 53 | omap_mbox_type_t irq); |
| 54 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 55 | static inline unsigned int mbox_read_reg(size_t ofs) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 56 | { |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 57 | return __raw_readl(mbox_base + ofs); |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 58 | } |
| 59 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 60 | static inline void mbox_write_reg(u32 val, size_t ofs) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 61 | { |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 62 | __raw_writel(val, mbox_base + ofs); |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | /* Mailbox H/W preparations */ |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 66 | static int omap2_mbox_startup(struct omap_mbox *mbox) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 67 | { |
| 68 | unsigned int l; |
| 69 | |
| 70 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); |
| 71 | if (IS_ERR(mbox_ick_handle)) { |
| 72 | printk("Could not get mailboxes_ick\n"); |
| 73 | return -ENODEV; |
| 74 | } |
| 75 | clk_enable(mbox_ick_handle); |
| 76 | |
Hiroshi DOYU | 94fc58c | 2009-03-23 18:07:24 -0700 | [diff] [blame] | 77 | l = mbox_read_reg(MAILBOX_REVISION); |
| 78 | pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); |
| 79 | |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 80 | /* set smart-idle & autoidle */ |
| 81 | l = mbox_read_reg(MAILBOX_SYSCONFIG); |
| 82 | l |= 0x00000011; |
| 83 | mbox_write_reg(l, MAILBOX_SYSCONFIG); |
| 84 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 85 | omap2_mbox_enable_irq(mbox, IRQ_RX); |
| 86 | |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 87 | return 0; |
| 88 | } |
| 89 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 90 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 91 | { |
| 92 | clk_disable(mbox_ick_handle); |
| 93 | clk_put(mbox_ick_handle); |
| 94 | } |
| 95 | |
| 96 | /* Mailbox FIFO handle functions */ |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 97 | static mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 98 | { |
| 99 | struct omap_mbox2_fifo *fifo = |
| 100 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; |
| 101 | return (mbox_msg_t) mbox_read_reg(fifo->msg); |
| 102 | } |
| 103 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 104 | static void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 105 | { |
| 106 | struct omap_mbox2_fifo *fifo = |
| 107 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; |
| 108 | mbox_write_reg(msg, fifo->msg); |
| 109 | } |
| 110 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 111 | static int omap2_mbox_fifo_empty(struct omap_mbox *mbox) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 112 | { |
| 113 | struct omap_mbox2_fifo *fifo = |
| 114 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; |
| 115 | return (mbox_read_reg(fifo->msg_stat) == 0); |
| 116 | } |
| 117 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 118 | static int omap2_mbox_fifo_full(struct omap_mbox *mbox) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 119 | { |
| 120 | struct omap_mbox2_fifo *fifo = |
| 121 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; |
| 122 | return (mbox_read_reg(fifo->fifo_stat)); |
| 123 | } |
| 124 | |
| 125 | /* Mailbox IRQ handle functions */ |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 126 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 127 | omap_mbox_type_t irq) |
| 128 | { |
| 129 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
| 130 | u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; |
| 131 | |
| 132 | l = mbox_read_reg(p->irqenable); |
| 133 | l |= bit; |
| 134 | mbox_write_reg(l, p->irqenable); |
| 135 | } |
| 136 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 137 | static void omap2_mbox_disable_irq(struct omap_mbox *mbox, |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 138 | omap_mbox_type_t irq) |
| 139 | { |
| 140 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
| 141 | u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; |
| 142 | |
| 143 | l = mbox_read_reg(p->irqenable); |
| 144 | l &= ~bit; |
| 145 | mbox_write_reg(l, p->irqenable); |
| 146 | } |
| 147 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 148 | static void omap2_mbox_ack_irq(struct omap_mbox *mbox, |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 149 | omap_mbox_type_t irq) |
| 150 | { |
| 151 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
| 152 | u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; |
| 153 | |
| 154 | mbox_write_reg(bit, p->irqstatus); |
| 155 | } |
| 156 | |
Hiroshi DOYU | bfbdcf8 | 2007-07-30 14:04:04 +0300 | [diff] [blame] | 157 | static int omap2_mbox_is_irq(struct omap_mbox *mbox, |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 158 | omap_mbox_type_t irq) |
| 159 | { |
| 160 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
| 161 | u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; |
| 162 | u32 enable = mbox_read_reg(p->irqenable); |
| 163 | u32 status = mbox_read_reg(p->irqstatus); |
| 164 | |
| 165 | return (enable & status & bit); |
| 166 | } |
| 167 | |
| 168 | static struct omap_mbox_ops omap2_mbox_ops = { |
| 169 | .type = OMAP_MBOX_TYPE2, |
| 170 | .startup = omap2_mbox_startup, |
| 171 | .shutdown = omap2_mbox_shutdown, |
| 172 | .fifo_read = omap2_mbox_fifo_read, |
| 173 | .fifo_write = omap2_mbox_fifo_write, |
| 174 | .fifo_empty = omap2_mbox_fifo_empty, |
| 175 | .fifo_full = omap2_mbox_fifo_full, |
| 176 | .enable_irq = omap2_mbox_enable_irq, |
| 177 | .disable_irq = omap2_mbox_disable_irq, |
| 178 | .ack_irq = omap2_mbox_ack_irq, |
| 179 | .is_irq = omap2_mbox_is_irq, |
| 180 | }; |
| 181 | |
| 182 | /* |
| 183 | * MAILBOX 0: ARM -> DSP, |
| 184 | * MAILBOX 1: ARM <- DSP. |
| 185 | * MAILBOX 2: ARM -> IVA, |
| 186 | * MAILBOX 3: ARM <- IVA. |
| 187 | */ |
| 188 | |
| 189 | /* FIXME: the following structs should be filled automatically by the user id */ |
| 190 | |
| 191 | /* DSP */ |
| 192 | static struct omap_mbox2_priv omap2_mbox_dsp_priv = { |
| 193 | .tx_fifo = { |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 194 | .msg = MAILBOX_MESSAGE(0), |
| 195 | .fifo_stat = MAILBOX_FIFOSTATUS(0), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 196 | }, |
| 197 | .rx_fifo = { |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 198 | .msg = MAILBOX_MESSAGE(1), |
| 199 | .msg_stat = MAILBOX_MSGSTATUS(1), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 200 | }, |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 201 | .irqenable = MAILBOX_IRQENABLE(0), |
| 202 | .irqstatus = MAILBOX_IRQSTATUS(0), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 203 | .notfull_bit = MAILBOX_IRQ_NOTFULL(0), |
| 204 | .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), |
| 205 | }; |
| 206 | |
| 207 | struct omap_mbox mbox_dsp_info = { |
| 208 | .name = "dsp", |
| 209 | .ops = &omap2_mbox_ops, |
| 210 | .priv = &omap2_mbox_dsp_priv, |
| 211 | }; |
| 212 | EXPORT_SYMBOL(mbox_dsp_info); |
| 213 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 214 | #if defined(CONFIG_ARCH_OMAP2420) /* IVA */ |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 215 | static struct omap_mbox2_priv omap2_mbox_iva_priv = { |
| 216 | .tx_fifo = { |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 217 | .msg = MAILBOX_MESSAGE(2), |
| 218 | .fifo_stat = MAILBOX_FIFOSTATUS(2), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 219 | }, |
| 220 | .rx_fifo = { |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 221 | .msg = MAILBOX_MESSAGE(3), |
| 222 | .msg_stat = MAILBOX_MSGSTATUS(3), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 223 | }, |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 224 | .irqenable = MAILBOX_IRQENABLE(3), |
| 225 | .irqstatus = MAILBOX_IRQSTATUS(3), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 226 | .notfull_bit = MAILBOX_IRQ_NOTFULL(2), |
| 227 | .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), |
| 228 | }; |
| 229 | |
| 230 | static struct omap_mbox mbox_iva_info = { |
| 231 | .name = "iva", |
| 232 | .ops = &omap2_mbox_ops, |
| 233 | .priv = &omap2_mbox_iva_priv, |
| 234 | }; |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 235 | #endif |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 236 | |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 237 | static int __devinit omap2_mbox_probe(struct platform_device *pdev) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 238 | { |
| 239 | struct resource *res; |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 240 | int ret; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 241 | |
| 242 | /* MBOX base */ |
| 243 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 244 | if (unlikely(!res)) { |
| 245 | dev_err(&pdev->dev, "invalid mem resource\n"); |
| 246 | return -ENODEV; |
| 247 | } |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 248 | mbox_base = ioremap(res->start, res->end - res->start); |
| 249 | if (!mbox_base) |
| 250 | return -ENOMEM; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 251 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 252 | /* DSP or IVA2 IRQ */ |
| 253 | mbox_dsp_info.irq = platform_get_irq(pdev, 0); |
| 254 | if (mbox_dsp_info.irq < 0) { |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 255 | dev_err(&pdev->dev, "invalid irq resource\n"); |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 256 | ret = -ENODEV; |
| 257 | goto err_dsp; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 258 | } |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 259 | |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 260 | ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 261 | if (ret) |
| 262 | goto err_dsp; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 263 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 264 | #if defined(CONFIG_ARCH_OMAP2420) /* IVA */ |
| 265 | if (cpu_is_omap2420()) { |
| 266 | /* IVA IRQ */ |
| 267 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); |
| 268 | if (unlikely(!res)) { |
| 269 | dev_err(&pdev->dev, "invalid irq resource\n"); |
| 270 | ret = -ENODEV; |
| 271 | goto err_iva1; |
| 272 | } |
| 273 | mbox_iva_info.irq = res->start; |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 274 | ret = omap_mbox_register(&pdev->dev, &mbox_iva_info); |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 275 | if (ret) |
| 276 | goto err_iva1; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 277 | } |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 278 | #endif |
| 279 | return 0; |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 280 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 281 | err_iva1: |
| 282 | omap_mbox_unregister(&mbox_dsp_info); |
| 283 | err_dsp: |
| 284 | iounmap(mbox_base); |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 285 | return ret; |
| 286 | } |
| 287 | |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 288 | static int __devexit omap2_mbox_remove(struct platform_device *pdev) |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 289 | { |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 290 | #if defined(CONFIG_ARCH_OMAP2420) |
| 291 | omap_mbox_unregister(&mbox_iva_info); |
| 292 | #endif |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 293 | omap_mbox_unregister(&mbox_dsp_info); |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 294 | iounmap(mbox_base); |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 295 | return 0; |
| 296 | } |
| 297 | |
| 298 | static struct platform_driver omap2_mbox_driver = { |
| 299 | .probe = omap2_mbox_probe, |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 300 | .remove = __devexit_p(omap2_mbox_remove), |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 301 | .driver = { |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 302 | .name = "omap2-mailbox", |
Hiroshi DOYU | 340a614a | 2006-12-07 15:43:59 -0800 | [diff] [blame] | 303 | }, |
| 304 | }; |
| 305 | |
| 306 | static int __init omap2_mbox_init(void) |
| 307 | { |
| 308 | return platform_driver_register(&omap2_mbox_driver); |
| 309 | } |
| 310 | |
| 311 | static void __exit omap2_mbox_exit(void) |
| 312 | { |
| 313 | platform_driver_unregister(&omap2_mbox_driver); |
| 314 | } |
| 315 | |
| 316 | module_init(omap2_mbox_init); |
| 317 | module_exit(omap2_mbox_exit); |
| 318 | |
Hiroshi DOYU | 733ecc5 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 319 | MODULE_LICENSE("GPL v2"); |
| 320 | MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions"); |
| 321 | MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt"); |
Hiroshi DOYU | da8cfe0 | 2009-03-23 18:07:25 -0700 | [diff] [blame^] | 322 | MODULE_ALIAS("platform:omap2-mailbox"); |