blob: fe0882130852031cdaf371dc18273604988bef59 [file] [log] [blame]
Hiroshi DOYU340a6142006-12-07 15:43:59 -08001/*
2 * OMAP mailbox driver
3 *
Hiroshi DOYUf48cca82009-03-23 18:07:24 -07004 * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved.
Hiroshi DOYU340a6142006-12-07 15:43:59 -08005 *
Hiroshi DOYUf48cca82009-03-23 18:07:24 -07006 * Contact: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Hiroshi DOYU340a6142006-12-07 15:43:59 -08007 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000024#include <linux/kernel.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080025#include <linux/module.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080026#include <linux/interrupt.h>
27#include <linux/device.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080028#include <linux/delay.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090029#include <linux/slab.h>
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000030#include <linux/kfifo.h>
31#include <linux/err.h>
Hiroshi DOYU8dff0fa2009-03-23 18:07:32 -070032
Tony Lindgrence491cf2009-10-20 09:40:47 -070033#include <plat/mailbox.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080034
Rob Clark8250a5c2010-01-04 19:22:03 +053035static struct workqueue_struct *mboxd;
Felipe Contreras9c80c8c2010-06-11 15:51:46 +000036static struct omap_mbox **mboxes;
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -060037static bool rq_full;
Hiroshi DOYU340a6142006-12-07 15:43:59 -080038
C A Subramaniam5f00ec62009-11-22 10:11:22 -080039static int mbox_configured;
Hiroshi DOYU72b917e2010-02-18 00:48:55 -060040static DEFINE_MUTEX(mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -080041
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000042static unsigned int mbox_kfifo_size = CONFIG_OMAP_MBOX_KFIFO_SIZE;
43module_param(mbox_kfifo_size, uint, S_IRUGO);
44MODULE_PARM_DESC(mbox_kfifo_size, "Size of omap's mailbox kfifo (bytes)");
45
Hiroshi DOYU9ae0ee02009-03-23 18:07:26 -070046/* Mailbox FIFO handle functions */
47static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
48{
49 return mbox->ops->fifo_read(mbox);
50}
51static inline void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
52{
53 mbox->ops->fifo_write(mbox, msg);
54}
55static inline int mbox_fifo_empty(struct omap_mbox *mbox)
56{
57 return mbox->ops->fifo_empty(mbox);
58}
59static inline int mbox_fifo_full(struct omap_mbox *mbox)
60{
61 return mbox->ops->fifo_full(mbox);
62}
63
64/* Mailbox IRQ handle functions */
Hiroshi DOYU9ae0ee02009-03-23 18:07:26 -070065static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
66{
67 if (mbox->ops->ack_irq)
68 mbox->ops->ack_irq(mbox, irq);
69}
70static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
71{
72 return mbox->ops->is_irq(mbox, irq);
73}
74
Hiroshi DOYU340a6142006-12-07 15:43:59 -080075/*
76 * message sender
77 */
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000078static int __mbox_poll_for_space(struct omap_mbox *mbox)
Hiroshi DOYU340a6142006-12-07 15:43:59 -080079{
80 int ret = 0, i = 1000;
81
82 while (mbox_fifo_full(mbox)) {
83 if (mbox->ops->type == OMAP_MBOX_TYPE2)
84 return -1;
85 if (--i == 0)
86 return -1;
87 udelay(1);
88 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -080089 return ret;
90}
91
C A Subramaniamb2b63622009-11-22 10:11:20 -080092int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
Hiroshi DOYU340a6142006-12-07 15:43:59 -080093{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000094 struct omap_mbox_queue *mq = mbox->txq;
95 int ret = 0, len;
C A Subramaniam5ed8d322009-11-22 10:11:24 -080096
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000097 spin_lock(&mq->lock);
Tejun Heoec247512009-04-23 11:05:20 +090098
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000099 if (kfifo_avail(&mq->fifo) < sizeof(msg)) {
100 ret = -ENOMEM;
101 goto out;
102 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800103
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000104 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
105 WARN_ON(len != sizeof(msg));
106
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800107 tasklet_schedule(&mbox->txq->tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800108
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000109out:
110 spin_unlock(&mq->lock);
111 return ret;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800112}
113EXPORT_SYMBOL(omap_mbox_msg_send);
114
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800115static void mbox_tx_tasklet(unsigned long tx_data)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800116{
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800117 struct omap_mbox *mbox = (struct omap_mbox *)tx_data;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000118 struct omap_mbox_queue *mq = mbox->txq;
119 mbox_msg_t msg;
120 int ret;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800121
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000122 while (kfifo_len(&mq->fifo)) {
123 if (__mbox_poll_for_space(mbox)) {
Hiroshi DOYUeb188582009-11-22 10:11:22 -0800124 omap_mbox_enable_irq(mbox, IRQ_TX);
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000125 break;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800126 }
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000127
128 ret = kfifo_out(&mq->fifo, (unsigned char *)&msg,
129 sizeof(msg));
130 WARN_ON(ret != sizeof(msg));
131
132 mbox_fifo_write(mbox, msg);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800133 }
134}
135
136/*
137 * Message receiver(workqueue)
138 */
139static void mbox_rx_work(struct work_struct *work)
140{
141 struct omap_mbox_queue *mq =
142 container_of(work, struct omap_mbox_queue, work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800143 mbox_msg_t msg;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000144 int len;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800145
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000146 while (kfifo_len(&mq->fifo) >= sizeof(msg)) {
147 len = kfifo_out(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
148 WARN_ON(len != sizeof(msg));
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800149
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000150 if (mq->callback)
151 mq->callback((void *)msg);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800152 }
153}
154
155/*
156 * Mailbox interrupt handler
157 */
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800158static void __mbox_tx_interrupt(struct omap_mbox *mbox)
159{
Hiroshi DOYUeb188582009-11-22 10:11:22 -0800160 omap_mbox_disable_irq(mbox, IRQ_TX);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800161 ack_mbox_irq(mbox, IRQ_TX);
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800162 tasklet_schedule(&mbox->txq->tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800163}
164
165static void __mbox_rx_interrupt(struct omap_mbox *mbox)
166{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000167 struct omap_mbox_queue *mq = mbox->rxq;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800168 mbox_msg_t msg;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000169 int len;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800170
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800171 while (!mbox_fifo_empty(mbox)) {
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000172 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -0600173 omap_mbox_disable_irq(mbox, IRQ_RX);
174 rq_full = true;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800175 goto nomem;
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -0600176 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800177
178 msg = mbox_fifo_read(mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800179
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000180 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
181 WARN_ON(len != sizeof(msg));
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800182
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800183 if (mbox->ops->type == OMAP_MBOX_TYPE1)
184 break;
185 }
186
187 /* no more messages in the fifo. clear IRQ source. */
188 ack_mbox_irq(mbox, IRQ_RX);
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700189nomem:
Rob Clark8250a5c2010-01-04 19:22:03 +0530190 queue_work(mboxd, &mbox->rxq->work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800191}
192
193static irqreturn_t mbox_interrupt(int irq, void *p)
194{
Jeff Garzik2a7057e2007-10-26 05:40:22 -0400195 struct omap_mbox *mbox = p;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800196
197 if (is_mbox_irq(mbox, IRQ_TX))
198 __mbox_tx_interrupt(mbox);
199
200 if (is_mbox_irq(mbox, IRQ_RX))
201 __mbox_rx_interrupt(mbox);
202
203 return IRQ_HANDLED;
204}
205
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800206static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800207 void (*work) (struct work_struct *),
208 void (*tasklet)(unsigned long))
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800209{
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800210 struct omap_mbox_queue *mq;
211
212 mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL);
213 if (!mq)
214 return NULL;
215
216 spin_lock_init(&mq->lock);
217
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000218 if (kfifo_alloc(&mq->fifo, mbox_kfifo_size, GFP_KERNEL))
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800219 goto error;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800220
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800221 if (work)
222 INIT_WORK(&mq->work, work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800223
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800224 if (tasklet)
225 tasklet_init(&mq->tasklet, tasklet, (unsigned long)mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800226 return mq;
227error:
228 kfree(mq);
229 return NULL;
230}
231
232static void mbox_queue_free(struct omap_mbox_queue *q)
233{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000234 kfifo_free(&q->fifo);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800235 kfree(q);
236}
237
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800238static int omap_mbox_startup(struct omap_mbox *mbox)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800239{
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800240 int ret = 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800241 struct omap_mbox_queue *mq;
242
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000243 if (mbox->ops->startup) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600244 mutex_lock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800245 if (!mbox_configured)
246 ret = mbox->ops->startup(mbox);
247
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000248 if (ret) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600249 mutex_unlock(&mbox_configured_lock);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800250 return ret;
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800251 }
252 mbox_configured++;
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600253 mutex_unlock(&mbox_configured_lock);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800254 }
255
C A Subramaniam5e683822009-11-22 10:11:23 -0800256 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800257 mbox->name, mbox);
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000258 if (ret) {
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800259 printk(KERN_ERR
260 "failed to register mailbox interrupt:%d\n", ret);
261 goto fail_request_irq;
262 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800263
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000264 mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800265 if (!mq) {
266 ret = -ENOMEM;
267 goto fail_alloc_txq;
268 }
269 mbox->txq = mq;
270
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000271 mq = mbox_queue_alloc(mbox, mbox_rx_work, NULL);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800272 if (!mq) {
273 ret = -ENOMEM;
274 goto fail_alloc_rxq;
275 }
276 mbox->rxq = mq;
277
278 return 0;
279
280 fail_alloc_rxq:
281 mbox_queue_free(mbox->txq);
282 fail_alloc_txq:
283 free_irq(mbox->irq, mbox);
284 fail_request_irq:
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000285 if (mbox->ops->shutdown)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800286 mbox->ops->shutdown(mbox);
287
288 return ret;
289}
290
291static void omap_mbox_fini(struct omap_mbox *mbox)
292{
Fernando Guzman Lugoad6d9622010-02-12 19:02:32 -0600293 free_irq(mbox->irq, mbox);
Fernando Guzman Lugo0e828e82010-02-12 19:07:14 -0600294 tasklet_kill(&mbox->txq->tasklet);
295 flush_work(&mbox->rxq->work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800296 mbox_queue_free(mbox->txq);
297 mbox_queue_free(mbox->rxq);
298
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000299 if (mbox->ops->shutdown) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600300 mutex_lock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800301 if (mbox_configured > 0)
302 mbox_configured--;
303 if (!mbox_configured)
304 mbox->ops->shutdown(mbox);
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600305 mutex_unlock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800306 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800307}
308
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800309struct omap_mbox *omap_mbox_get(const char *name)
310{
311 struct omap_mbox *mbox;
312 int ret;
313
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000314 if (!mboxes)
315 return ERR_PTR(-EINVAL);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800316
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000317 for (mbox = *mboxes; mbox; mbox++)
318 if (!strcmp(mbox->name, name))
319 break;
320
321 if (!mbox)
322 return ERR_PTR(-ENOENT);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800323
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800324 ret = omap_mbox_startup(mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800325 if (ret)
326 return ERR_PTR(-ENODEV);
327
328 return mbox;
329}
330EXPORT_SYMBOL(omap_mbox_get);
331
332void omap_mbox_put(struct omap_mbox *mbox)
333{
334 omap_mbox_fini(mbox);
335}
336EXPORT_SYMBOL(omap_mbox_put);
337
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300338static struct class omap_mbox_class = { .name = "mbox", };
339
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000340int omap_mbox_register(struct device *parent, struct omap_mbox **list)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800341{
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000342 int ret;
343 int i;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800344
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000345 mboxes = list;
346 if (!mboxes)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800347 return -EINVAL;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800348
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000349 for (i = 0; mboxes[i]; i++) {
350 struct omap_mbox *mbox = mboxes[i];
351 mbox->dev = device_create(&omap_mbox_class,
352 parent, 0, mbox, "%s", mbox->name);
353 if (IS_ERR(mbox->dev)) {
354 ret = PTR_ERR(mbox->dev);
355 goto err_out;
356 }
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700357 }
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700358 return 0;
359
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000360err_out:
361 while (i--)
362 device_unregister(mboxes[i]->dev);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800363 return ret;
364}
365EXPORT_SYMBOL(omap_mbox_register);
366
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000367int omap_mbox_unregister(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800368{
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000369 int i;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800370
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000371 if (!mboxes)
372 return -EINVAL;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800373
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000374 for (i = 0; mboxes[i]; i++)
375 device_unregister(mboxes[i]->dev);
376 mboxes = NULL;
377 return 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800378}
379EXPORT_SYMBOL(omap_mbox_unregister);
380
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800381static int __init omap_mbox_init(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800382{
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300383 int err;
384
385 err = class_register(&omap_mbox_class);
386 if (err)
387 return err;
388
Rob Clark8250a5c2010-01-04 19:22:03 +0530389 mboxd = create_workqueue("mboxd");
390 if (!mboxd)
391 return -ENOMEM;
392
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000393 /* kfifo size sanity check: alignment and minimal size */
394 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
395 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t));
396
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800397 return 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800398}
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300399subsys_initcall(omap_mbox_init);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800400
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800401static void __exit omap_mbox_exit(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800402{
Rob Clark8250a5c2010-01-04 19:22:03 +0530403 destroy_workqueue(mboxd);
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300404 class_unregister(&omap_mbox_class);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800405}
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800406module_exit(omap_mbox_exit);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800407
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700408MODULE_LICENSE("GPL v2");
409MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging");
Ohad Ben-Cohenf3753252010-05-05 15:33:07 +0000410MODULE_AUTHOR("Toshihiro Kobayashi");
411MODULE_AUTHOR("Hiroshi DOYU");