|
@@ -372,3 +372,59 @@ static int omap2_mbox_probe(struct platform_device *pdev)
|
|
|
#if defined(CONFIG_ARCH_OMAP4)
|
|
|
else if (cpu_is_omap44xx()) {
|
|
|
list = omap4_mboxes;
|
|
|
+
|
|
|
+ list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ else {
|
|
|
+ pr_err("%s: platform not supported\n", __func__);
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
+ mbox_base = ioremap(mem->start, resource_size(mem));
|
|
|
+ if (!mbox_base)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ ret = omap_mbox_register(&pdev->dev, list);
|
|
|
+ if (ret) {
|
|
|
+ iounmap(mbox_base);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int omap2_mbox_remove(struct platform_device *pdev)
|
|
|
+{
|
|
|
+ omap_mbox_unregister();
|
|
|
+ iounmap(mbox_base);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct platform_driver omap2_mbox_driver = {
|
|
|
+ .probe = omap2_mbox_probe,
|
|
|
+ .remove = omap2_mbox_remove,
|
|
|
+ .driver = {
|
|
|
+ .name = "omap-mailbox",
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static int __init omap2_mbox_init(void)
|
|
|
+{
|
|
|
+ return platform_driver_register(&omap2_mbox_driver);
|
|
|
+}
|
|
|
+
|
|
|
+static void __exit omap2_mbox_exit(void)
|
|
|
+{
|
|
|
+ platform_driver_unregister(&omap2_mbox_driver);
|
|
|
+}
|
|
|
+
|
|
|
+module_init(omap2_mbox_init);
|
|
|
+module_exit(omap2_mbox_exit);
|
|
|
+
|
|
|
+MODULE_LICENSE("GPL v2");
|
|
|
+MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
|
|
|
+MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
|
|
|
+MODULE_AUTHOR("Paul Mundt");
|
|
|
+MODULE_ALIAS("platform:omap2-mailbox");
|