GNU Linux-libre 4.14.328-gnu1
[releases.git] / drivers / mailbox / ti-msgmgr.c
1 /*
2  * Texas Instruments' Message Manager Driver
3  *
4  * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
5  *      Nishanth Menon
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12  * kind, whether express or implied; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
16
17 #define pr_fmt(fmt) "%s: " fmt, __func__
18
19 #include <linux/device.h>
20 #include <linux/interrupt.h>
21 #include <linux/io.h>
22 #include <linux/kernel.h>
23 #include <linux/mailbox_controller.h>
24 #include <linux/module.h>
25 #include <linux/of_device.h>
26 #include <linux/of.h>
27 #include <linux/of_irq.h>
28 #include <linux/platform_device.h>
29 #include <linux/soc/ti/ti-msgmgr.h>
30
31 #define Q_DATA_OFFSET(proxy, queue, reg)        \
32                      ((0x10000 * (proxy)) + (0x80 * (queue)) + ((reg) * 4))
33 #define Q_STATE_OFFSET(queue)                   ((queue) * 0x4)
34 #define Q_STATE_ENTRY_COUNT_MASK                (0xFFF000)
35
36 /**
37  * struct ti_msgmgr_valid_queue_desc - SoC valid queues meant for this processor
38  * @queue_id:   Queue Number for this path
39  * @proxy_id:   Proxy ID representing the processor in SoC
40  * @is_tx:      Is this a receive path?
41  */
42 struct ti_msgmgr_valid_queue_desc {
43         u8 queue_id;
44         u8 proxy_id;
45         bool is_tx;
46 };
47
48 /**
49  * struct ti_msgmgr_desc - Description of message manager integration
50  * @queue_count:        Number of Queues
51  * @max_message_size:   Message size in bytes
52  * @max_messages:       Number of messages
53  * @q_slices:           Number of queue engines
54  * @q_proxies:          Number of queue proxies per page
55  * @data_first_reg:     First data register for proxy data region
56  * @data_last_reg:      Last data register for proxy data region
57  * @tx_polled:          Do I need to use polled mechanism for tx
58  * @tx_poll_timeout_ms: Timeout in ms if polled
59  * @valid_queues:       List of Valid queues that the processor can access
60  * @num_valid_queues:   Number of valid queues
61  *
62  * This structure is used in of match data to describe how integration
63  * for a specific compatible SoC is done.
64  */
65 struct ti_msgmgr_desc {
66         u8 queue_count;
67         u8 max_message_size;
68         u8 max_messages;
69         u8 q_slices;
70         u8 q_proxies;
71         u8 data_first_reg;
72         u8 data_last_reg;
73         bool tx_polled;
74         int tx_poll_timeout_ms;
75         const struct ti_msgmgr_valid_queue_desc *valid_queues;
76         int num_valid_queues;
77 };
78
79 /**
80  * struct ti_queue_inst - Description of a queue instance
81  * @name:       Queue Name
82  * @queue_id:   Queue Identifier as mapped on SoC
83  * @proxy_id:   Proxy Identifier as mapped on SoC
84  * @irq:        IRQ for Rx Queue
85  * @is_tx:      'true' if transmit queue, else, 'false'
86  * @queue_buff_start: First register of Data Buffer
87  * @queue_buff_end: Last (or confirmation) register of Data buffer
88  * @queue_state: Queue status register
89  * @chan:       Mailbox channel
90  * @rx_buff:    Receive buffer pointer allocated at probe, max_message_size
91  */
92 struct ti_queue_inst {
93         char name[30];
94         u8 queue_id;
95         u8 proxy_id;
96         int irq;
97         bool is_tx;
98         void __iomem *queue_buff_start;
99         void __iomem *queue_buff_end;
100         void __iomem *queue_state;
101         struct mbox_chan *chan;
102         u32 *rx_buff;
103 };
104
105 /**
106  * struct ti_msgmgr_inst - Description of a Message Manager Instance
107  * @dev:        device pointer corresponding to the Message Manager instance
108  * @desc:       Description of the SoC integration
109  * @queue_proxy_region: Queue proxy region where queue buffers are located
110  * @queue_state_debug_region:   Queue status register regions
111  * @num_valid_queues:   Number of valid queues defined for the processor
112  *              Note: other queues are probably reserved for other processors
113  *              in the SoC.
114  * @qinsts:     Array of valid Queue Instances for the Processor
115  * @mbox:       Mailbox Controller
116  * @chans:      Array for channels corresponding to the Queue Instances.
117  */
118 struct ti_msgmgr_inst {
119         struct device *dev;
120         const struct ti_msgmgr_desc *desc;
121         void __iomem *queue_proxy_region;
122         void __iomem *queue_state_debug_region;
123         u8 num_valid_queues;
124         struct ti_queue_inst *qinsts;
125         struct mbox_controller mbox;
126         struct mbox_chan *chans;
127 };
128
129 /**
130  * ti_msgmgr_queue_get_num_messages() - Get the number of pending messages
131  * @qinst:      Queue instance for which we check the number of pending messages
132  *
133  * Return: number of messages pending in the queue (0 == no pending messages)
134  */
135 static inline int ti_msgmgr_queue_get_num_messages(struct ti_queue_inst *qinst)
136 {
137         u32 val;
138
139         /*
140          * We cannot use relaxed operation here - update may happen
141          * real-time.
142          */
143         val = readl(qinst->queue_state) & Q_STATE_ENTRY_COUNT_MASK;
144         val >>= __ffs(Q_STATE_ENTRY_COUNT_MASK);
145
146         return val;
147 }
148
149 /**
150  * ti_msgmgr_queue_rx_interrupt() - Interrupt handler for receive Queue
151  * @irq:        Interrupt number
152  * @p:          Channel Pointer
153  *
154  * Return: -EINVAL if there is no instance
155  * IRQ_NONE if the interrupt is not ours.
156  * IRQ_HANDLED if the rx interrupt was successfully handled.
157  */
158 static irqreturn_t ti_msgmgr_queue_rx_interrupt(int irq, void *p)
159 {
160         struct mbox_chan *chan = p;
161         struct device *dev = chan->mbox->dev;
162         struct ti_msgmgr_inst *inst = dev_get_drvdata(dev);
163         struct ti_queue_inst *qinst = chan->con_priv;
164         const struct ti_msgmgr_desc *desc;
165         int msg_count, num_words;
166         struct ti_msgmgr_message message;
167         void __iomem *data_reg;
168         u32 *word_data;
169
170         if (WARN_ON(!inst)) {
171                 dev_err(dev, "no platform drv data??\n");
172                 return -EINVAL;
173         }
174
175         /* Do I have an invalid interrupt source? */
176         if (qinst->is_tx) {
177                 dev_err(dev, "Cannot handle rx interrupt on tx channel %s\n",
178                         qinst->name);
179                 return IRQ_NONE;
180         }
181
182         /* Do I actually have messages to read? */
183         msg_count = ti_msgmgr_queue_get_num_messages(qinst);
184         if (!msg_count) {
185                 /* Shared IRQ? */
186                 dev_dbg(dev, "Spurious event - 0 pending data!\n");
187                 return IRQ_NONE;
188         }
189
190         /*
191          * I have no idea about the protocol being used to communicate with the
192          * remote producer - 0 could be valid data, so I wont make a judgement
193          * of how many bytes I should be reading. Let the client figure this
194          * out.. I just read the full message and pass it on..
195          */
196         desc = inst->desc;
197         message.len = desc->max_message_size;
198         message.buf = (u8 *)qinst->rx_buff;
199
200         /*
201          * NOTE about register access involved here:
202          * the hardware block is implemented with 32bit access operations and no
203          * support for data splitting.  We don't want the hardware to misbehave
204          * with sub 32bit access - For example: if the last register read is
205          * split into byte wise access, it can result in the queue getting
206          * stuck or indeterminate behavior. An out of order read operation may
207          * result in weird data results as well.
208          * Hence, we do not use memcpy_fromio or __ioread32_copy here, instead
209          * we depend on readl for the purpose.
210          *
211          * Also note that the final register read automatically marks the
212          * queue message as read.
213          */
214         for (data_reg = qinst->queue_buff_start, word_data = qinst->rx_buff,
215              num_words = (desc->max_message_size / sizeof(u32));
216              num_words; num_words--, data_reg += sizeof(u32), word_data++)
217                 *word_data = readl(data_reg);
218
219         /*
220          * Last register read automatically clears the IRQ if only 1 message
221          * is pending - so send the data up the stack..
222          * NOTE: Client is expected to be as optimal as possible, since
223          * we invoke the handler in IRQ context.
224          */
225         mbox_chan_received_data(chan, (void *)&message);
226
227         return IRQ_HANDLED;
228 }
229
230 /**
231  * ti_msgmgr_queue_peek_data() - Peek to see if there are any rx messages.
232  * @chan:       Channel Pointer
233  *
234  * Return: 'true' if there is pending rx data, 'false' if there is none.
235  */
236 static bool ti_msgmgr_queue_peek_data(struct mbox_chan *chan)
237 {
238         struct ti_queue_inst *qinst = chan->con_priv;
239         int msg_count;
240
241         if (qinst->is_tx)
242                 return false;
243
244         msg_count = ti_msgmgr_queue_get_num_messages(qinst);
245
246         return msg_count ? true : false;
247 }
248
249 /**
250  * ti_msgmgr_last_tx_done() - See if all the tx messages are sent
251  * @chan:       Channel pointer
252  *
253  * Return: 'true' is no pending tx data, 'false' if there are any.
254  */
255 static bool ti_msgmgr_last_tx_done(struct mbox_chan *chan)
256 {
257         struct ti_queue_inst *qinst = chan->con_priv;
258         int msg_count;
259
260         if (!qinst->is_tx)
261                 return false;
262
263         msg_count = ti_msgmgr_queue_get_num_messages(qinst);
264
265         /* if we have any messages pending.. */
266         return msg_count ? false : true;
267 }
268
269 /**
270  * ti_msgmgr_send_data() - Send data
271  * @chan:       Channel Pointer
272  * @data:       ti_msgmgr_message * Message Pointer
273  *
274  * Return: 0 if all goes good, else appropriate error messages.
275  */
276 static int ti_msgmgr_send_data(struct mbox_chan *chan, void *data)
277 {
278         struct device *dev = chan->mbox->dev;
279         struct ti_msgmgr_inst *inst = dev_get_drvdata(dev);
280         const struct ti_msgmgr_desc *desc;
281         struct ti_queue_inst *qinst = chan->con_priv;
282         int num_words, trail_bytes;
283         struct ti_msgmgr_message *message = data;
284         void __iomem *data_reg;
285         u32 *word_data;
286
287         if (WARN_ON(!inst)) {
288                 dev_err(dev, "no platform drv data??\n");
289                 return -EINVAL;
290         }
291         desc = inst->desc;
292
293         if (desc->max_message_size < message->len) {
294                 dev_err(dev, "Queue %s message length %d > max %d\n",
295                         qinst->name, message->len, desc->max_message_size);
296                 return -EINVAL;
297         }
298
299         /* NOTE: Constraints similar to rx path exists here as well */
300         for (data_reg = qinst->queue_buff_start,
301              num_words = message->len / sizeof(u32),
302              word_data = (u32 *)message->buf;
303              num_words; num_words--, data_reg += sizeof(u32), word_data++)
304                 writel(*word_data, data_reg);
305
306         trail_bytes = message->len % sizeof(u32);
307         if (trail_bytes) {
308                 u32 data_trail = *word_data;
309
310                 /* Ensure all unused data is 0 */
311                 data_trail &= 0xFFFFFFFF >> (8 * (sizeof(u32) - trail_bytes));
312                 writel(data_trail, data_reg);
313                 data_reg += sizeof(u32);
314         }
315
316         /*
317          * 'data_reg' indicates next register to write. If we did not already
318          * write on tx complete reg(last reg), we must do so for transmit
319          * In addition, we also need to make sure all intermediate data
320          * registers(if any required), are reset to 0 for TISCI backward
321          * compatibility to be maintained.
322          */
323         while (data_reg <= qinst->queue_buff_end) {
324                 writel(0, data_reg);
325                 data_reg += sizeof(u32);
326         }
327
328         return 0;
329 }
330
331 /**
332  * ti_msgmgr_queue_startup() - Startup queue
333  * @chan:       Channel pointer
334  *
335  * Return: 0 if all goes good, else return corresponding error message
336  */
337 static int ti_msgmgr_queue_startup(struct mbox_chan *chan)
338 {
339         struct ti_queue_inst *qinst = chan->con_priv;
340         struct device *dev = chan->mbox->dev;
341         int ret;
342
343         if (!qinst->is_tx) {
344                 /*
345                  * With the expectation that the IRQ might be shared in SoC
346                  */
347                 ret = request_irq(qinst->irq, ti_msgmgr_queue_rx_interrupt,
348                                   IRQF_SHARED, qinst->name, chan);
349                 if (ret) {
350                         dev_err(dev, "Unable to get IRQ %d on %s(res=%d)\n",
351                                 qinst->irq, qinst->name, ret);
352                         return ret;
353                 }
354         }
355
356         return 0;
357 }
358
359 /**
360  * ti_msgmgr_queue_shutdown() - Shutdown the queue
361  * @chan:       Channel pointer
362  */
363 static void ti_msgmgr_queue_shutdown(struct mbox_chan *chan)
364 {
365         struct ti_queue_inst *qinst = chan->con_priv;
366
367         if (!qinst->is_tx)
368                 free_irq(qinst->irq, chan);
369 }
370
371 /**
372  * ti_msgmgr_of_xlate() - Translation of phandle to queue
373  * @mbox:       Mailbox controller
374  * @p:          phandle pointer
375  *
376  * Return: Mailbox channel corresponding to the queue, else return error
377  * pointer.
378  */
379 static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
380                                             const struct of_phandle_args *p)
381 {
382         struct ti_msgmgr_inst *inst;
383         int req_qid, req_pid;
384         struct ti_queue_inst *qinst;
385         int i;
386
387         inst = container_of(mbox, struct ti_msgmgr_inst, mbox);
388         if (WARN_ON(!inst))
389                 return ERR_PTR(-EINVAL);
390
391         /* #mbox-cells is 2 */
392         if (p->args_count != 2) {
393                 dev_err(inst->dev, "Invalid arguments in dt[%d] instead of 2\n",
394                         p->args_count);
395                 return ERR_PTR(-EINVAL);
396         }
397         req_qid = p->args[0];
398         req_pid = p->args[1];
399
400         for (qinst = inst->qinsts, i = 0; i < inst->num_valid_queues;
401              i++, qinst++) {
402                 if (req_qid == qinst->queue_id && req_pid == qinst->proxy_id)
403                         return qinst->chan;
404         }
405
406         dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %s\n",
407                 req_qid, req_pid, p->np->name);
408         return ERR_PTR(-ENOENT);
409 }
410
411 /**
412  * ti_msgmgr_queue_setup() - Setup data structures for each queue instance
413  * @idx:        index of the queue
414  * @dev:        pointer to the message manager device
415  * @np:         pointer to the of node
416  * @inst:       Queue instance pointer
417  * @d:          Message Manager instance description data
418  * @qd:         Queue description data
419  * @qinst:      Queue instance pointer
420  * @chan:       pointer to mailbox channel
421  *
422  * Return: 0 if all went well, else return corresponding error
423  */
424 static int ti_msgmgr_queue_setup(int idx, struct device *dev,
425                                  struct device_node *np,
426                                  struct ti_msgmgr_inst *inst,
427                                  const struct ti_msgmgr_desc *d,
428                                  const struct ti_msgmgr_valid_queue_desc *qd,
429                                  struct ti_queue_inst *qinst,
430                                  struct mbox_chan *chan)
431 {
432         qinst->proxy_id = qd->proxy_id;
433         qinst->queue_id = qd->queue_id;
434
435         if (qinst->queue_id > d->queue_count) {
436                 dev_err(dev, "Queue Data [idx=%d] queuid %d > %d\n",
437                         idx, qinst->queue_id, d->queue_count);
438                 return -ERANGE;
439         }
440
441         qinst->is_tx = qd->is_tx;
442         snprintf(qinst->name, sizeof(qinst->name), "%s %s_%03d_%03d",
443                  dev_name(dev), qinst->is_tx ? "tx" : "rx", qinst->queue_id,
444                  qinst->proxy_id);
445
446         if (!qinst->is_tx) {
447                 char of_rx_irq_name[7];
448
449                 snprintf(of_rx_irq_name, sizeof(of_rx_irq_name),
450                          "rx_%03d", qinst->queue_id);
451
452                 qinst->irq = of_irq_get_byname(np, of_rx_irq_name);
453                 if (qinst->irq < 0) {
454                         dev_crit(dev,
455                                  "[%d]QID %d PID %d:No IRQ[%s]: %d\n",
456                                  idx, qinst->queue_id, qinst->proxy_id,
457                                  of_rx_irq_name, qinst->irq);
458                         return qinst->irq;
459                 }
460                 /* Allocate usage buffer for rx */
461                 qinst->rx_buff = devm_kzalloc(dev,
462                                               d->max_message_size, GFP_KERNEL);
463                 if (!qinst->rx_buff)
464                         return -ENOMEM;
465         }
466
467         qinst->queue_buff_start = inst->queue_proxy_region +
468             Q_DATA_OFFSET(qinst->proxy_id, qinst->queue_id, d->data_first_reg);
469         qinst->queue_buff_end = inst->queue_proxy_region +
470             Q_DATA_OFFSET(qinst->proxy_id, qinst->queue_id, d->data_last_reg);
471         qinst->queue_state = inst->queue_state_debug_region +
472             Q_STATE_OFFSET(qinst->queue_id);
473         qinst->chan = chan;
474
475         chan->con_priv = qinst;
476
477         dev_dbg(dev, "[%d] qidx=%d pidx=%d irq=%d q_s=%p q_e = %p\n",
478                 idx, qinst->queue_id, qinst->proxy_id, qinst->irq,
479                 qinst->queue_buff_start, qinst->queue_buff_end);
480         return 0;
481 }
482
483 /* Queue operations */
484 static const struct mbox_chan_ops ti_msgmgr_chan_ops = {
485         .startup = ti_msgmgr_queue_startup,
486         .shutdown = ti_msgmgr_queue_shutdown,
487         .peek_data = ti_msgmgr_queue_peek_data,
488         .last_tx_done = ti_msgmgr_last_tx_done,
489         .send_data = ti_msgmgr_send_data,
490 };
491
492 /* Keystone K2G SoC integration details */
493 static const struct ti_msgmgr_valid_queue_desc k2g_valid_queues[] = {
494         {.queue_id = 0, .proxy_id = 0, .is_tx = true,},
495         {.queue_id = 1, .proxy_id = 0, .is_tx = true,},
496         {.queue_id = 2, .proxy_id = 0, .is_tx = true,},
497         {.queue_id = 3, .proxy_id = 0, .is_tx = true,},
498         {.queue_id = 5, .proxy_id = 2, .is_tx = false,},
499         {.queue_id = 56, .proxy_id = 1, .is_tx = true,},
500         {.queue_id = 57, .proxy_id = 2, .is_tx = false,},
501         {.queue_id = 58, .proxy_id = 3, .is_tx = true,},
502         {.queue_id = 59, .proxy_id = 4, .is_tx = true,},
503         {.queue_id = 60, .proxy_id = 5, .is_tx = true,},
504         {.queue_id = 61, .proxy_id = 6, .is_tx = true,},
505 };
506
507 static const struct ti_msgmgr_desc k2g_desc = {
508         .queue_count = 64,
509         .max_message_size = 64,
510         .max_messages = 128,
511         .q_slices = 1,
512         .q_proxies = 1,
513         .data_first_reg = 16,
514         .data_last_reg = 31,
515         .tx_polled = false,
516         .valid_queues = k2g_valid_queues,
517         .num_valid_queues = ARRAY_SIZE(k2g_valid_queues),
518 };
519
520 static const struct of_device_id ti_msgmgr_of_match[] = {
521         {.compatible = "ti,k2g-message-manager", .data = &k2g_desc},
522         { /* Sentinel */ }
523 };
524 MODULE_DEVICE_TABLE(of, ti_msgmgr_of_match);
525
526 static int ti_msgmgr_probe(struct platform_device *pdev)
527 {
528         struct device *dev = &pdev->dev;
529         const struct of_device_id *of_id;
530         struct device_node *np;
531         struct resource *res;
532         const struct ti_msgmgr_desc *desc;
533         struct ti_msgmgr_inst *inst;
534         struct ti_queue_inst *qinst;
535         struct mbox_controller *mbox;
536         struct mbox_chan *chans;
537         int queue_count;
538         int i;
539         int ret = -EINVAL;
540         const struct ti_msgmgr_valid_queue_desc *queue_desc;
541
542         if (!dev->of_node) {
543                 dev_err(dev, "no OF information\n");
544                 return -EINVAL;
545         }
546         np = dev->of_node;
547
548         of_id = of_match_device(ti_msgmgr_of_match, dev);
549         if (!of_id) {
550                 dev_err(dev, "OF data missing\n");
551                 return -EINVAL;
552         }
553         desc = of_id->data;
554
555         inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL);
556         if (!inst)
557                 return -ENOMEM;
558
559         inst->dev = dev;
560         inst->desc = desc;
561
562         res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
563                                            "queue_proxy_region");
564         inst->queue_proxy_region = devm_ioremap_resource(dev, res);
565         if (IS_ERR(inst->queue_proxy_region))
566                 return PTR_ERR(inst->queue_proxy_region);
567
568         res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
569                                            "queue_state_debug_region");
570         inst->queue_state_debug_region = devm_ioremap_resource(dev, res);
571         if (IS_ERR(inst->queue_state_debug_region))
572                 return PTR_ERR(inst->queue_state_debug_region);
573
574         dev_dbg(dev, "proxy region=%p, queue_state=%p\n",
575                 inst->queue_proxy_region, inst->queue_state_debug_region);
576
577         queue_count = desc->num_valid_queues;
578         if (!queue_count || queue_count > desc->queue_count) {
579                 dev_crit(dev, "Invalid Number of queues %d. Max %d\n",
580                          queue_count, desc->queue_count);
581                 return -ERANGE;
582         }
583         inst->num_valid_queues = queue_count;
584
585         qinst = devm_kzalloc(dev, sizeof(*qinst) * queue_count, GFP_KERNEL);
586         if (!qinst)
587                 return -ENOMEM;
588         inst->qinsts = qinst;
589
590         chans = devm_kzalloc(dev, sizeof(*chans) * queue_count, GFP_KERNEL);
591         if (!chans)
592                 return -ENOMEM;
593         inst->chans = chans;
594
595         for (i = 0, queue_desc = desc->valid_queues;
596              i < queue_count; i++, qinst++, chans++, queue_desc++) {
597                 ret = ti_msgmgr_queue_setup(i, dev, np, inst,
598                                             desc, queue_desc, qinst, chans);
599                 if (ret)
600                         return ret;
601         }
602
603         mbox = &inst->mbox;
604         mbox->dev = dev;
605         mbox->ops = &ti_msgmgr_chan_ops;
606         mbox->chans = inst->chans;
607         mbox->num_chans = inst->num_valid_queues;
608         mbox->txdone_irq = false;
609         mbox->txdone_poll = desc->tx_polled;
610         if (desc->tx_polled)
611                 mbox->txpoll_period = desc->tx_poll_timeout_ms;
612         mbox->of_xlate = ti_msgmgr_of_xlate;
613
614         platform_set_drvdata(pdev, inst);
615         ret = mbox_controller_register(mbox);
616         if (ret)
617                 dev_err(dev, "Failed to register mbox_controller(%d)\n", ret);
618
619         return ret;
620 }
621
622 static int ti_msgmgr_remove(struct platform_device *pdev)
623 {
624         struct ti_msgmgr_inst *inst;
625
626         inst = platform_get_drvdata(pdev);
627         mbox_controller_unregister(&inst->mbox);
628
629         return 0;
630 }
631
632 static struct platform_driver ti_msgmgr_driver = {
633         .probe = ti_msgmgr_probe,
634         .remove = ti_msgmgr_remove,
635         .driver = {
636                    .name = "ti-msgmgr",
637                    .of_match_table = of_match_ptr(ti_msgmgr_of_match),
638         },
639 };
640 module_platform_driver(ti_msgmgr_driver);
641
642 MODULE_LICENSE("GPL v2");
643 MODULE_DESCRIPTION("TI message manager driver");
644 MODULE_AUTHOR("Nishanth Menon");
645 MODULE_ALIAS("platform:ti-msgmgr");