blob: d2fafb892f7fb9cc1ffe400de2f7fe5d948fd26b [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
Hiroshi DOYU340a6142006-12-07 15:43:59 -080024#include <linux/interrupt.h>
Felipe Contrerasb3e69142010-06-11 15:51:49 +000025#include <linux/spinlock.h>
26#include <linux/mutex.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080027#include <linux/delay.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090028#include <linux/slab.h>
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000029#include <linux/kfifo.h>
30#include <linux/err.h>
Hiroshi DOYU8dff0fa2009-03-23 18:07:32 -070031
Tony Lindgrence491cf2009-10-20 09:40:47 -070032#include <plat/mailbox.h>
Hiroshi DOYU340a6142006-12-07 15:43:59 -080033
Rob Clark8250a5c2010-01-04 19:22:03 +053034static struct workqueue_struct *mboxd;
Felipe Contreras9c80c8c2010-06-11 15:51:46 +000035static struct omap_mbox **mboxes;
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -060036static bool rq_full;
Hiroshi DOYU340a6142006-12-07 15:43:59 -080037
C A Subramaniam5f00ec62009-11-22 10:11:22 -080038static int mbox_configured;
Hiroshi DOYU72b917e2010-02-18 00:48:55 -060039static DEFINE_MUTEX(mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -080040
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000041static unsigned int mbox_kfifo_size = CONFIG_OMAP_MBOX_KFIFO_SIZE;
42module_param(mbox_kfifo_size, uint, S_IRUGO);
43MODULE_PARM_DESC(mbox_kfifo_size, "Size of omap's mailbox kfifo (bytes)");
44
Hiroshi DOYU9ae0ee02009-03-23 18:07:26 -070045/* Mailbox FIFO handle functions */
46static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
47{
48 return mbox->ops->fifo_read(mbox);
49}
50static inline void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
51{
52 mbox->ops->fifo_write(mbox, msg);
53}
54static inline int mbox_fifo_empty(struct omap_mbox *mbox)
55{
56 return mbox->ops->fifo_empty(mbox);
57}
58static inline int mbox_fifo_full(struct omap_mbox *mbox)
59{
60 return mbox->ops->fifo_full(mbox);
61}
62
63/* Mailbox IRQ handle functions */
Hiroshi DOYU9ae0ee02009-03-23 18:07:26 -070064static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
65{
66 if (mbox->ops->ack_irq)
67 mbox->ops->ack_irq(mbox, irq);
68}
69static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
70{
71 return mbox->ops->is_irq(mbox, irq);
72}
73
Hiroshi DOYU340a6142006-12-07 15:43:59 -080074/*
75 * message sender
76 */
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000077static int __mbox_poll_for_space(struct omap_mbox *mbox)
Hiroshi DOYU340a6142006-12-07 15:43:59 -080078{
79 int ret = 0, i = 1000;
80
81 while (mbox_fifo_full(mbox)) {
82 if (mbox->ops->type == OMAP_MBOX_TYPE2)
83 return -1;
84 if (--i == 0)
85 return -1;
86 udelay(1);
87 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -080088 return ret;
89}
90
C A Subramaniamb2b63622009-11-22 10:11:20 -080091int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
Hiroshi DOYU340a6142006-12-07 15:43:59 -080092{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000093 struct omap_mbox_queue *mq = mbox->txq;
94 int ret = 0, len;
C A Subramaniam5ed8d322009-11-22 10:11:24 -080095
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000096 spin_lock(&mq->lock);
Tejun Heoec247512009-04-23 11:05:20 +090097
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +000098 if (kfifo_avail(&mq->fifo) < sizeof(msg)) {
99 ret = -ENOMEM;
100 goto out;
101 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800102
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000103 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
104 WARN_ON(len != sizeof(msg));
105
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800106 tasklet_schedule(&mbox->txq->tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800107
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000108out:
109 spin_unlock(&mq->lock);
110 return ret;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800111}
112EXPORT_SYMBOL(omap_mbox_msg_send);
113
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800114static void mbox_tx_tasklet(unsigned long tx_data)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800115{
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800116 struct omap_mbox *mbox = (struct omap_mbox *)tx_data;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000117 struct omap_mbox_queue *mq = mbox->txq;
118 mbox_msg_t msg;
119 int ret;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800120
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000121 while (kfifo_len(&mq->fifo)) {
122 if (__mbox_poll_for_space(mbox)) {
Hiroshi DOYUeb188582009-11-22 10:11:22 -0800123 omap_mbox_enable_irq(mbox, IRQ_TX);
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000124 break;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800125 }
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000126
127 ret = kfifo_out(&mq->fifo, (unsigned char *)&msg,
128 sizeof(msg));
129 WARN_ON(ret != sizeof(msg));
130
131 mbox_fifo_write(mbox, msg);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800132 }
133}
134
135/*
136 * Message receiver(workqueue)
137 */
138static void mbox_rx_work(struct work_struct *work)
139{
140 struct omap_mbox_queue *mq =
141 container_of(work, struct omap_mbox_queue, work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800142 mbox_msg_t msg;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000143 int len;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800144
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000145 while (kfifo_len(&mq->fifo) >= sizeof(msg)) {
146 len = kfifo_out(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
147 WARN_ON(len != sizeof(msg));
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800148
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000149 if (mq->callback)
150 mq->callback((void *)msg);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800151 }
152}
153
154/*
155 * Mailbox interrupt handler
156 */
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800157static void __mbox_tx_interrupt(struct omap_mbox *mbox)
158{
Hiroshi DOYUeb188582009-11-22 10:11:22 -0800159 omap_mbox_disable_irq(mbox, IRQ_TX);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800160 ack_mbox_irq(mbox, IRQ_TX);
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800161 tasklet_schedule(&mbox->txq->tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800162}
163
164static void __mbox_rx_interrupt(struct omap_mbox *mbox)
165{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000166 struct omap_mbox_queue *mq = mbox->rxq;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800167 mbox_msg_t msg;
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000168 int len;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800169
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800170 while (!mbox_fifo_empty(mbox)) {
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000171 if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -0600172 omap_mbox_disable_irq(mbox, IRQ_RX);
173 rq_full = true;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800174 goto nomem;
Fernando Guzman Lugo1ea5d6d2010-02-08 13:35:40 -0600175 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800176
177 msg = mbox_fifo_read(mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800178
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000179 len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
180 WARN_ON(len != sizeof(msg));
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800181
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800182 if (mbox->ops->type == OMAP_MBOX_TYPE1)
183 break;
184 }
185
186 /* no more messages in the fifo. clear IRQ source. */
187 ack_mbox_irq(mbox, IRQ_RX);
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700188nomem:
Rob Clark8250a5c2010-01-04 19:22:03 +0530189 queue_work(mboxd, &mbox->rxq->work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800190}
191
192static irqreturn_t mbox_interrupt(int irq, void *p)
193{
Jeff Garzik2a7057e2007-10-26 05:40:22 -0400194 struct omap_mbox *mbox = p;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800195
196 if (is_mbox_irq(mbox, IRQ_TX))
197 __mbox_tx_interrupt(mbox);
198
199 if (is_mbox_irq(mbox, IRQ_RX))
200 __mbox_rx_interrupt(mbox);
201
202 return IRQ_HANDLED;
203}
204
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800205static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800206 void (*work) (struct work_struct *),
207 void (*tasklet)(unsigned long))
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800208{
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800209 struct omap_mbox_queue *mq;
210
211 mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL);
212 if (!mq)
213 return NULL;
214
215 spin_lock_init(&mq->lock);
216
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000217 if (kfifo_alloc(&mq->fifo, mbox_kfifo_size, GFP_KERNEL))
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800218 goto error;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800219
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800220 if (work)
221 INIT_WORK(&mq->work, work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800222
C A Subramaniam5ed8d322009-11-22 10:11:24 -0800223 if (tasklet)
224 tasklet_init(&mq->tasklet, tasklet, (unsigned long)mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800225 return mq;
226error:
227 kfree(mq);
228 return NULL;
229}
230
231static void mbox_queue_free(struct omap_mbox_queue *q)
232{
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000233 kfifo_free(&q->fifo);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800234 kfree(q);
235}
236
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800237static int omap_mbox_startup(struct omap_mbox *mbox)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800238{
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800239 int ret = 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800240 struct omap_mbox_queue *mq;
241
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000242 if (mbox->ops->startup) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600243 mutex_lock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800244 if (!mbox_configured)
245 ret = mbox->ops->startup(mbox);
246
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000247 if (ret) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600248 mutex_unlock(&mbox_configured_lock);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800249 return ret;
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800250 }
251 mbox_configured++;
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600252 mutex_unlock(&mbox_configured_lock);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800253 }
254
C A Subramaniam5e683822009-11-22 10:11:23 -0800255 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800256 mbox->name, mbox);
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000257 if (ret) {
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800258 printk(KERN_ERR
259 "failed to register mailbox interrupt:%d\n", ret);
260 goto fail_request_irq;
261 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800262
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000263 mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800264 if (!mq) {
265 ret = -ENOMEM;
266 goto fail_alloc_txq;
267 }
268 mbox->txq = mq;
269
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000270 mq = mbox_queue_alloc(mbox, mbox_rx_work, NULL);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800271 if (!mq) {
272 ret = -ENOMEM;
273 goto fail_alloc_rxq;
274 }
275 mbox->rxq = mq;
276
277 return 0;
278
279 fail_alloc_rxq:
280 mbox_queue_free(mbox->txq);
281 fail_alloc_txq:
282 free_irq(mbox->irq, mbox);
283 fail_request_irq:
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000284 if (mbox->ops->shutdown)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800285 mbox->ops->shutdown(mbox);
286
287 return ret;
288}
289
290static void omap_mbox_fini(struct omap_mbox *mbox)
291{
Fernando Guzman Lugoad6d9622010-02-12 19:02:32 -0600292 free_irq(mbox->irq, mbox);
Fernando Guzman Lugo0e828e82010-02-12 19:07:14 -0600293 tasklet_kill(&mbox->txq->tasklet);
294 flush_work(&mbox->rxq->work);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800295 mbox_queue_free(mbox->txq);
296 mbox_queue_free(mbox->rxq);
297
Ohad Ben-Cohen01072d82010-05-05 15:33:08 +0000298 if (mbox->ops->shutdown) {
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600299 mutex_lock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800300 if (mbox_configured > 0)
301 mbox_configured--;
302 if (!mbox_configured)
303 mbox->ops->shutdown(mbox);
Hiroshi DOYU72b917e2010-02-18 00:48:55 -0600304 mutex_unlock(&mbox_configured_lock);
C A Subramaniam5f00ec62009-11-22 10:11:22 -0800305 }
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800306}
307
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800308struct omap_mbox *omap_mbox_get(const char *name)
309{
310 struct omap_mbox *mbox;
311 int ret;
312
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000313 if (!mboxes)
314 return ERR_PTR(-EINVAL);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800315
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000316 for (mbox = *mboxes; mbox; mbox++)
317 if (!strcmp(mbox->name, name))
318 break;
319
320 if (!mbox)
321 return ERR_PTR(-ENOENT);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800322
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800323 ret = omap_mbox_startup(mbox);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800324 if (ret)
325 return ERR_PTR(-ENODEV);
326
327 return mbox;
328}
329EXPORT_SYMBOL(omap_mbox_get);
330
331void omap_mbox_put(struct omap_mbox *mbox)
332{
333 omap_mbox_fini(mbox);
334}
335EXPORT_SYMBOL(omap_mbox_put);
336
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300337static struct class omap_mbox_class = { .name = "mbox", };
338
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000339int omap_mbox_register(struct device *parent, struct omap_mbox **list)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800340{
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000341 int ret;
342 int i;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800343
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000344 mboxes = list;
345 if (!mboxes)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800346 return -EINVAL;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800347
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000348 for (i = 0; mboxes[i]; i++) {
349 struct omap_mbox *mbox = mboxes[i];
350 mbox->dev = device_create(&omap_mbox_class,
351 parent, 0, mbox, "%s", mbox->name);
352 if (IS_ERR(mbox->dev)) {
353 ret = PTR_ERR(mbox->dev);
354 goto err_out;
355 }
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700356 }
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700357 return 0;
358
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000359err_out:
360 while (i--)
361 device_unregister(mboxes[i]->dev);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800362 return ret;
363}
364EXPORT_SYMBOL(omap_mbox_register);
365
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000366int omap_mbox_unregister(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800367{
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000368 int i;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800369
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000370 if (!mboxes)
371 return -EINVAL;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800372
Felipe Contreras9c80c8c2010-06-11 15:51:46 +0000373 for (i = 0; mboxes[i]; i++)
374 device_unregister(mboxes[i]->dev);
375 mboxes = NULL;
376 return 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800377}
378EXPORT_SYMBOL(omap_mbox_unregister);
379
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800380static int __init omap_mbox_init(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800381{
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300382 int err;
383
384 err = class_register(&omap_mbox_class);
385 if (err)
386 return err;
387
Rob Clark8250a5c2010-01-04 19:22:03 +0530388 mboxd = create_workqueue("mboxd");
389 if (!mboxd)
390 return -ENOMEM;
391
Ohad Ben-Cohenb5bebe42010-05-05 15:33:09 +0000392 /* kfifo size sanity check: alignment and minimal size */
393 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
394 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t));
395
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800396 return 0;
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800397}
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300398subsys_initcall(omap_mbox_init);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800399
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800400static void __exit omap_mbox_exit(void)
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800401{
Rob Clark8250a5c2010-01-04 19:22:03 +0530402 destroy_workqueue(mboxd);
Hiroshi DOYU6b233982010-05-18 16:15:32 +0300403 class_unregister(&omap_mbox_class);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800404}
Hiroshi DOYUc7c158e2009-11-22 10:11:19 -0800405module_exit(omap_mbox_exit);
Hiroshi DOYU340a6142006-12-07 15:43:59 -0800406
Hiroshi DOYUf48cca82009-03-23 18:07:24 -0700407MODULE_LICENSE("GPL v2");
408MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging");
Ohad Ben-Cohenf3753252010-05-05 15:33:07 +0000409MODULE_AUTHOR("Toshihiro Kobayashi");
410MODULE_AUTHOR("Hiroshi DOYU");