Build fixes
authorThomas White <taw@bitwiz.org.uk>
Tue, 28 Apr 2009 00:24:38 +0000 (01:24 +0100)
committerThomas White <taw@bitwiz.org.uk>
Tue, 28 Apr 2009 00:24:38 +0000 (01:24 +0100)
This fixes up the Makefile so that the build actually works.

Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/Makefile
drivers/mfd/glamo/glamo-drm-drv.c [new file with mode: 0644]
drivers/mfd/glamo/glamo-drm.c [deleted file]

index 3806602..ed5ac57 100644 (file)
@@ -2,7 +2,6 @@
 # Makefile for the Smedia Glamo driver(s)
 #
 
-glamo-drm-y    :=  glamo-cmdq.o
 
 obj-$(CONFIG_MFD_GLAMO)                        += glamo-core.o glamo-gpio.o
 obj-$(CONFIG_MFD_GLAMO_SPI)            += glamo-spi.o
@@ -12,3 +11,5 @@ obj-$(CONFIG_MFD_GLAMO_FB)            += glamo-fb.o
 obj-$(CONFIG_MFD_GLAMO_SPI_FB)         += glamo-lcm-spi.o
 obj-$(CONFIG_MFD_GLAMO_MCI)            += glamo-mci.o
 obj-$(CONFIG_MFD_GLAMO_DRM)            += glamo-drm.o
+
+glamo-drm-objs :=  glamo-drm-drv.o glamo-cmdq.o
diff --git a/drivers/mfd/glamo/glamo-drm-drv.c b/drivers/mfd/glamo/glamo-drm-drv.c
new file mode 100644 (file)
index 0000000..1e910e3
--- /dev/null
@@ -0,0 +1,382 @@
+/* Smedia Glamo 336x/337x driver
+ *
+ * Copyright (C) 2009 Openmoko, Inc. Jorge Luis Zapata <turran@openmoko.com>
+ * Copyright (C) 2008-2009 Thomas White <taw@bitwiz.org.uk>
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <drm/drmP.h>
+#include <drm/glamo_drm.h>
+
+#include "glamo-core.h"
+#include "glamo-cmdq.h"
+#include "glamo-drm-private.h"
+
+#define DRIVER_AUTHOR           "Openmoko, Inc."
+#define DRIVER_NAME             "glamo-drm"
+#define DRIVER_DESC             "SMedia Glamo 3362"
+#define DRIVER_DATE             "20090426"
+
+#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)
+
+
+static int glamo_ioctl_swap(struct drm_device *dev, void *data,
+                           struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_swap\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_info(struct drm_device *dev, void *data,
+                               struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_info\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_create(struct drm_device *dev, void *data,
+                                 struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_create\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_mmap(struct drm_device *dev, void *data,
+                               struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_mmap\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_pin(struct drm_device *dev, void *data,
+                              struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_pin\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_unpin(struct drm_device *dev, void *data,
+                                struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_unpin\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_pread(struct drm_device *dev, void *data,
+                                struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_pread\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_pwrite(struct drm_device *dev, void *data,
+                                 struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_pwrite\n");
+       return 0;
+}
+
+static int glamo_ioctl_gem_wait_rendering(struct drm_device *dev, void *data,
+                                         struct drm_file *file_priv)
+{
+       printk(KERN_INFO "glamo_ioctl_gem_wait_rendering\n");
+       return 0;
+}
+
+struct drm_ioctl_desc glamo_ioctls[] = {
+       DRM_IOCTL_DEF(DRM_GLAMO_CMDBUF, glamo_ioctl_cmdbuf, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_SWAP, glamo_ioctl_swap, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_INFO, glamo_ioctl_gem_info, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_CREATE, glamo_ioctl_gem_create, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_MMAP, glamo_ioctl_gem_mmap, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PIN, glamo_ioctl_gem_pin, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_UNPIN, glamo_ioctl_gem_unpin, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PREAD, glamo_ioctl_gem_pread, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PWRITE, glamo_ioctl_gem_pwrite, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_GLAMO_GEM_WAIT_RENDERING,
+                               glamo_ioctl_gem_wait_rendering, DRM_AUTH),
+};
+
+static int glamodrm_firstopen(struct drm_device *dev)
+{
+       DRM_DEBUG("\n");
+       return 0;
+}
+
+static int glamodrm_open(struct drm_device *dev, struct drm_file *fh)
+{
+       DRM_DEBUG("\n");
+       return 0;
+}
+
+static void glamodrm_preclose(struct drm_device *dev, struct drm_file *fh)
+{
+       DRM_DEBUG("\n");
+}
+
+static void glamodrm_postclose(struct drm_device *dev, struct drm_file *fh)
+{
+       DRM_DEBUG("\n");
+}
+
+static void glamodrm_lastclose(struct drm_device *dev)
+{
+       DRM_DEBUG("\n");
+}
+
+static int glamodrm_master_create(struct drm_device *dev,
+                                 struct drm_master *master)
+{
+       DRM_DEBUG("\n");
+
+        return 0;
+}
+
+static void glamodrm_master_destroy(struct drm_device *dev,
+                                   struct drm_master *master)
+{
+       DRM_DEBUG("\n");
+}
+
+static int glamodrm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+       return VM_FAULT_SIGBUS;
+}
+
+static int glamodrm_gem_init_object(struct drm_gem_object *obj)
+{
+       return 0;
+}
+
+static void glamodrm_gem_free_object(struct drm_gem_object *obj)
+{
+}
+
+
+static struct vm_operations_struct glamodrm_gem_vm_ops = {
+       .fault = glamodrm_gem_fault,
+};
+
+static struct drm_driver glamodrm_drm_driver = {
+       .driver_features = DRIVER_IS_PLATFORM | DRIVER_GEM,
+       .firstopen = glamodrm_firstopen,
+       .open = glamodrm_open,
+       .preclose = glamodrm_preclose,
+       .postclose = glamodrm_postclose,
+       .lastclose = glamodrm_lastclose,
+       .reclaim_buffers = drm_core_reclaim_buffers,
+       .get_map_ofs = drm_core_get_map_ofs,
+       .get_reg_ofs = drm_core_get_reg_ofs,
+       .master_create = glamodrm_master_create,
+       .master_destroy = glamodrm_master_destroy,
+       .gem_init_object = glamodrm_gem_init_object,
+       .gem_free_object = glamodrm_gem_free_object,
+       .gem_vm_ops = &glamodrm_gem_vm_ops,
+       .ioctls = glamo_ioctls,
+       .fops = {
+               .owner = THIS_MODULE,
+               .open = drm_open,
+               .release = drm_release,
+               .ioctl = drm_ioctl,
+               .mmap = drm_mmap,
+               .poll = drm_poll,
+               .fasync = drm_fasync,
+       },
+       .major = 0,
+       .minor = 1,
+       .patchlevel = 0,
+       .name = DRIVER_NAME,
+       .desc = DRIVER_DESC,
+       .date = DRIVER_DATE,
+};
+
+
+static int glamodrm_probe(struct platform_device *pdev)
+{
+       int rc;
+       struct glamodrm_handle *glamodrm;
+
+       printk(KERN_INFO "[glamo-drm] SMedia Glamo Direct Rendering Support\n");
+
+       glamodrm = kmalloc(sizeof(*glamodrm), GFP_KERNEL);
+       if ( !glamodrm )
+               return -ENOMEM;
+       platform_set_drvdata(pdev, glamodrm);
+       glamodrm->glamo_core = pdev->dev.platform_data;
+
+       /* Find the command queue registers */
+       glamodrm->reg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if ( !glamodrm->reg ) {
+               dev_err(&pdev->dev, "Unable to find cmdq registers.\n");
+               rc = -ENOENT;
+               goto out_free;
+       }
+       glamodrm->reg = request_mem_region(glamodrm->reg->start,
+                                         RESSIZE(glamodrm->reg), pdev->name);
+       if ( !glamodrm->reg ) {
+               dev_err(&pdev->dev, "failed to request MMIO region\n");
+               rc = -ENOENT;
+               goto out_free;
+       }
+       glamodrm->reg_base = ioremap(glamodrm->reg->start,
+                                    RESSIZE(glamodrm->reg));
+       if ( !glamodrm->reg_base ) {
+               dev_err(&pdev->dev, "failed to ioremap() MMIO registers\n");
+               rc = -ENOENT;
+               goto out_release_regs;
+       }
+
+       /* Find the working VRAM */
+       glamodrm->vram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+       if ( !glamodrm->vram ) {
+               dev_err(&pdev->dev, "Unable to find work VRAM.\n");
+               rc = -ENOENT;
+               goto out_unmap_regs;
+       }
+       glamodrm->vram = request_mem_region(glamodrm->vram->start,
+                                         RESSIZE(glamodrm->vram), pdev->name);
+       if ( !glamodrm->vram ) {
+               dev_err(&pdev->dev, "failed to request VRAM region\n");
+               rc = -ENOENT;
+               goto out_unmap_regs;
+       }
+       glamodrm->vram_base = ioremap(glamodrm->vram->start,
+                                               RESSIZE(glamodrm->vram));
+       if ( !glamodrm->vram_base ) {
+               dev_err(&pdev->dev, "failed to ioremap() VRAM\n");
+               rc = -ENOENT;
+               goto out_release_vram;
+       }
+
+       glamodrm->vram_size = GLAMO_WORK_SIZE;
+       printk(KERN_INFO "[glamo-drm] %lli bytes of Glamo RAM to work with\n",
+                                       (long long int)glamodrm->vram_size);
+
+       /* Find the command queue itself */
+       glamodrm->cmdq = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+       if ( !glamodrm->cmdq ) {
+               dev_err(&pdev->dev, "Unable to find command queue.\n");
+               rc = -ENOENT;
+               goto out_unmap_vram;
+       }
+       glamodrm->cmdq = request_mem_region(glamodrm->cmdq->start,
+                                         RESSIZE(glamodrm->cmdq), pdev->name);
+       if ( !glamodrm->cmdq ) {
+               dev_err(&pdev->dev, "failed to request command queue region\n");
+               rc = -ENOENT;
+               goto out_unmap_vram;
+       }
+       glamodrm->cmdq_base = ioremap(glamodrm->cmdq->start,
+                                               RESSIZE(glamodrm->cmdq));
+       if ( !glamodrm->cmdq_base ) {
+               dev_err(&pdev->dev, "failed to ioremap() command queue\n");
+               rc = -ENOENT;
+               goto out_release_cmdq;
+       }
+
+       /* Initialise DRM */
+       drm_platform_init(&glamodrm_drm_driver, pdev, (void *)glamodrm_handle);
+
+       /* Enable 2D and 3D */
+       glamo_engine_enable(glamodrm->glamo_core, GLAMO_ENGINE_3D);
+       glamo_engine_reset(glamodrm->glamo_core, GLAMO_ENGINE_3D);
+       msleep(5);
+       glamo_engine_enable(glamodrm->glamo_core, GLAMO_ENGINE_2D);
+       glamo_engine_reset(glamodrm->glamo_core, GLAMO_ENGINE_2D);
+       msleep(5);
+
+       glamo_cmdq_init(glamodrm->glamo_core);
+
+       return 0;
+
+out_release_cmdq:
+       release_mem_region(glamodrm->cmdq->start, RESSIZE(glamodrm->cmdq));
+out_unmap_vram:
+       iounmap(glamodrm->vram);
+out_release_vram:
+       release_mem_region(glamodrm->vram->start, RESSIZE(glamodrm->vram));
+out_unmap_regs:
+       iounmap(glamodrm->reg_base);
+out_release_regs:
+       release_mem_region(glamodrm->reg->start, RESSIZE(glamodrm->reg));
+out_free:
+       kfree(glamodrm);
+       pdev->dev.driver_data = NULL;
+       return rc;
+}
+
+
+static int glamodrm_remove(struct platform_device *pdev)
+{
+       struct glamodrm_handle *glamodrm = platform_get_drvdata(pdev);
+       struct glamo_core *glamocore = pdev->dev.platform_data;
+
+       glamo_engine_disable(glamocore, GLAMO_ENGINE_2D);
+       glamo_engine_disable(glamocore, GLAMO_ENGINE_3D);
+
+       drm_exit(&glamodrm_drm_driver);
+
+       platform_set_drvdata(pdev, NULL);
+
+       /* Release registers */
+       iounmap(glamodrm->reg_base);
+       release_mem_region(glamodrm->reg->start, RESSIZE(glamodrm->reg));
+
+       /* Release VRAM */
+       iounmap(glamodrm->vram_base);
+       release_mem_region(glamodrm->vram->start, RESSIZE(glamodrm->vram));
+
+       /* Release command queue  */
+       iounmap(glamodrm->cmdq_base);
+       release_mem_region(glamodrm->cmdq->start, RESSIZE(glamodrm->cmdq));
+
+       kfree(glamodrm);
+
+       return 0;
+}
+
+static struct platform_driver glamodrm_driver = {
+       .probe          = glamodrm_probe,
+       .remove         = glamodrm_remove,
+       .driver         = {
+               .name   = "glamo-cmdq",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __devinit glamodrm_init(void)
+{
+       glamodrm_drm_driver.num_ioctls = DRM_ARRAY_SIZE(glamo_ioctls);
+       return platform_driver_register(&glamodrm_driver);
+}
+
+static void __exit glamodrm_exit(void)
+{
+       platform_driver_unregister(&glamodrm_driver);
+}
+
+module_init(glamodrm_init);
+module_exit(glamodrm_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/glamo/glamo-drm.c b/drivers/mfd/glamo/glamo-drm.c
deleted file mode 100644 (file)
index 1e910e3..0000000
+++ /dev/null
@@ -1,382 +0,0 @@
-/* Smedia Glamo 336x/337x driver
- *
- * Copyright (C) 2009 Openmoko, Inc. Jorge Luis Zapata <turran@openmoko.com>
- * Copyright (C) 2008-2009 Thomas White <taw@bitwiz.org.uk>
- *
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <drm/drmP.h>
-#include <drm/glamo_drm.h>
-
-#include "glamo-core.h"
-#include "glamo-cmdq.h"
-#include "glamo-drm-private.h"
-
-#define DRIVER_AUTHOR           "Openmoko, Inc."
-#define DRIVER_NAME             "glamo-drm"
-#define DRIVER_DESC             "SMedia Glamo 3362"
-#define DRIVER_DATE             "20090426"
-
-#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)
-
-
-static int glamo_ioctl_swap(struct drm_device *dev, void *data,
-                           struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_swap\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_info(struct drm_device *dev, void *data,
-                               struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_info\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_create(struct drm_device *dev, void *data,
-                                 struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_create\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_mmap(struct drm_device *dev, void *data,
-                               struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_mmap\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_pin(struct drm_device *dev, void *data,
-                              struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_pin\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_unpin(struct drm_device *dev, void *data,
-                                struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_unpin\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_pread(struct drm_device *dev, void *data,
-                                struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_pread\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_pwrite(struct drm_device *dev, void *data,
-                                 struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_pwrite\n");
-       return 0;
-}
-
-static int glamo_ioctl_gem_wait_rendering(struct drm_device *dev, void *data,
-                                         struct drm_file *file_priv)
-{
-       printk(KERN_INFO "glamo_ioctl_gem_wait_rendering\n");
-       return 0;
-}
-
-struct drm_ioctl_desc glamo_ioctls[] = {
-       DRM_IOCTL_DEF(DRM_GLAMO_CMDBUF, glamo_ioctl_cmdbuf, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_SWAP, glamo_ioctl_swap, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_INFO, glamo_ioctl_gem_info, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_CREATE, glamo_ioctl_gem_create, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_MMAP, glamo_ioctl_gem_mmap, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PIN, glamo_ioctl_gem_pin, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_UNPIN, glamo_ioctl_gem_unpin, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PREAD, glamo_ioctl_gem_pread, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_PWRITE, glamo_ioctl_gem_pwrite, DRM_AUTH),
-       DRM_IOCTL_DEF(DRM_GLAMO_GEM_WAIT_RENDERING,
-                               glamo_ioctl_gem_wait_rendering, DRM_AUTH),
-};
-
-static int glamodrm_firstopen(struct drm_device *dev)
-{
-       DRM_DEBUG("\n");
-       return 0;
-}
-
-static int glamodrm_open(struct drm_device *dev, struct drm_file *fh)
-{
-       DRM_DEBUG("\n");
-       return 0;
-}
-
-static void glamodrm_preclose(struct drm_device *dev, struct drm_file *fh)
-{
-       DRM_DEBUG("\n");
-}
-
-static void glamodrm_postclose(struct drm_device *dev, struct drm_file *fh)
-{
-       DRM_DEBUG("\n");
-}
-
-static void glamodrm_lastclose(struct drm_device *dev)
-{
-       DRM_DEBUG("\n");
-}
-
-static int glamodrm_master_create(struct drm_device *dev,
-                                 struct drm_master *master)
-{
-       DRM_DEBUG("\n");
-
-        return 0;
-}
-
-static void glamodrm_master_destroy(struct drm_device *dev,
-                                   struct drm_master *master)
-{
-       DRM_DEBUG("\n");
-}
-
-static int glamodrm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-{
-       return VM_FAULT_SIGBUS;
-}
-
-static int glamodrm_gem_init_object(struct drm_gem_object *obj)
-{
-       return 0;
-}
-
-static void glamodrm_gem_free_object(struct drm_gem_object *obj)
-{
-}
-
-
-static struct vm_operations_struct glamodrm_gem_vm_ops = {
-       .fault = glamodrm_gem_fault,
-};
-
-static struct drm_driver glamodrm_drm_driver = {
-       .driver_features = DRIVER_IS_PLATFORM | DRIVER_GEM,
-       .firstopen = glamodrm_firstopen,
-       .open = glamodrm_open,
-       .preclose = glamodrm_preclose,
-       .postclose = glamodrm_postclose,
-       .lastclose = glamodrm_lastclose,
-       .reclaim_buffers = drm_core_reclaim_buffers,
-       .get_map_ofs = drm_core_get_map_ofs,
-       .get_reg_ofs = drm_core_get_reg_ofs,
-       .master_create = glamodrm_master_create,
-       .master_destroy = glamodrm_master_destroy,
-       .gem_init_object = glamodrm_gem_init_object,
-       .gem_free_object = glamodrm_gem_free_object,
-       .gem_vm_ops = &glamodrm_gem_vm_ops,
-       .ioctls = glamo_ioctls,
-       .fops = {
-               .owner = THIS_MODULE,
-               .open = drm_open,
-               .release = drm_release,
-               .ioctl = drm_ioctl,
-               .mmap = drm_mmap,
-               .poll = drm_poll,
-               .fasync = drm_fasync,
-       },
-       .major = 0,
-       .minor = 1,
-       .patchlevel = 0,
-       .name = DRIVER_NAME,
-       .desc = DRIVER_DESC,
-       .date = DRIVER_DATE,
-};
-
-
-static int glamodrm_probe(struct platform_device *pdev)
-{
-       int rc;
-       struct glamodrm_handle *glamodrm;
-
-       printk(KERN_INFO "[glamo-drm] SMedia Glamo Direct Rendering Support\n");
-
-       glamodrm = kmalloc(sizeof(*glamodrm), GFP_KERNEL);
-       if ( !glamodrm )
-               return -ENOMEM;
-       platform_set_drvdata(pdev, glamodrm);
-       glamodrm->glamo_core = pdev->dev.platform_data;
-
-       /* Find the command queue registers */
-       glamodrm->reg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if ( !glamodrm->reg ) {
-               dev_err(&pdev->dev, "Unable to find cmdq registers.\n");
-               rc = -ENOENT;
-               goto out_free;
-       }
-       glamodrm->reg = request_mem_region(glamodrm->reg->start,
-                                         RESSIZE(glamodrm->reg), pdev->name);
-       if ( !glamodrm->reg ) {
-               dev_err(&pdev->dev, "failed to request MMIO region\n");
-               rc = -ENOENT;
-               goto out_free;
-       }
-       glamodrm->reg_base = ioremap(glamodrm->reg->start,
-                                    RESSIZE(glamodrm->reg));
-       if ( !glamodrm->reg_base ) {
-               dev_err(&pdev->dev, "failed to ioremap() MMIO registers\n");
-               rc = -ENOENT;
-               goto out_release_regs;
-       }
-
-       /* Find the working VRAM */
-       glamodrm->vram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       if ( !glamodrm->vram ) {
-               dev_err(&pdev->dev, "Unable to find work VRAM.\n");
-               rc = -ENOENT;
-               goto out_unmap_regs;
-       }
-       glamodrm->vram = request_mem_region(glamodrm->vram->start,
-                                         RESSIZE(glamodrm->vram), pdev->name);
-       if ( !glamodrm->vram ) {
-               dev_err(&pdev->dev, "failed to request VRAM region\n");
-               rc = -ENOENT;
-               goto out_unmap_regs;
-       }
-       glamodrm->vram_base = ioremap(glamodrm->vram->start,
-                                               RESSIZE(glamodrm->vram));
-       if ( !glamodrm->vram_base ) {
-               dev_err(&pdev->dev, "failed to ioremap() VRAM\n");
-               rc = -ENOENT;
-               goto out_release_vram;
-       }
-
-       glamodrm->vram_size = GLAMO_WORK_SIZE;
-       printk(KERN_INFO "[glamo-drm] %lli bytes of Glamo RAM to work with\n",
-                                       (long long int)glamodrm->vram_size);
-
-       /* Find the command queue itself */
-       glamodrm->cmdq = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-       if ( !glamodrm->cmdq ) {
-               dev_err(&pdev->dev, "Unable to find command queue.\n");
-               rc = -ENOENT;
-               goto out_unmap_vram;
-       }
-       glamodrm->cmdq = request_mem_region(glamodrm->cmdq->start,
-                                         RESSIZE(glamodrm->cmdq), pdev->name);
-       if ( !glamodrm->cmdq ) {
-               dev_err(&pdev->dev, "failed to request command queue region\n");
-               rc = -ENOENT;
-               goto out_unmap_vram;
-       }
-       glamodrm->cmdq_base = ioremap(glamodrm->cmdq->start,
-                                               RESSIZE(glamodrm->cmdq));
-       if ( !glamodrm->cmdq_base ) {
-               dev_err(&pdev->dev, "failed to ioremap() command queue\n");
-               rc = -ENOENT;
-               goto out_release_cmdq;
-       }
-
-       /* Initialise DRM */
-       drm_platform_init(&glamodrm_drm_driver, pdev, (void *)glamodrm_handle);
-
-       /* Enable 2D and 3D */
-       glamo_engine_enable(glamodrm->glamo_core, GLAMO_ENGINE_3D);
-       glamo_engine_reset(glamodrm->glamo_core, GLAMO_ENGINE_3D);
-       msleep(5);
-       glamo_engine_enable(glamodrm->glamo_core, GLAMO_ENGINE_2D);
-       glamo_engine_reset(glamodrm->glamo_core, GLAMO_ENGINE_2D);
-       msleep(5);
-
-       glamo_cmdq_init(glamodrm->glamo_core);
-
-       return 0;
-
-out_release_cmdq:
-       release_mem_region(glamodrm->cmdq->start, RESSIZE(glamodrm->cmdq));
-out_unmap_vram:
-       iounmap(glamodrm->vram);
-out_release_vram:
-       release_mem_region(glamodrm->vram->start, RESSIZE(glamodrm->vram));
-out_unmap_regs:
-       iounmap(glamodrm->reg_base);
-out_release_regs:
-       release_mem_region(glamodrm->reg->start, RESSIZE(glamodrm->reg));
-out_free:
-       kfree(glamodrm);
-       pdev->dev.driver_data = NULL;
-       return rc;
-}
-
-
-static int glamodrm_remove(struct platform_device *pdev)
-{
-       struct glamodrm_handle *glamodrm = platform_get_drvdata(pdev);
-       struct glamo_core *glamocore = pdev->dev.platform_data;
-
-       glamo_engine_disable(glamocore, GLAMO_ENGINE_2D);
-       glamo_engine_disable(glamocore, GLAMO_ENGINE_3D);
-
-       drm_exit(&glamodrm_drm_driver);
-
-       platform_set_drvdata(pdev, NULL);
-
-       /* Release registers */
-       iounmap(glamodrm->reg_base);
-       release_mem_region(glamodrm->reg->start, RESSIZE(glamodrm->reg));
-
-       /* Release VRAM */
-       iounmap(glamodrm->vram_base);
-       release_mem_region(glamodrm->vram->start, RESSIZE(glamodrm->vram));
-
-       /* Release command queue  */
-       iounmap(glamodrm->cmdq_base);
-       release_mem_region(glamodrm->cmdq->start, RESSIZE(glamodrm->cmdq));
-
-       kfree(glamodrm);
-
-       return 0;
-}
-
-static struct platform_driver glamodrm_driver = {
-       .probe          = glamodrm_probe,
-       .remove         = glamodrm_remove,
-       .driver         = {
-               .name   = "glamo-cmdq",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __devinit glamodrm_init(void)
-{
-       glamodrm_drm_driver.num_ioctls = DRM_ARRAY_SIZE(glamo_ioctls);
-       return platform_driver_register(&glamodrm_driver);
-}
-
-static void __exit glamodrm_exit(void)
-{
-       platform_driver_unregister(&glamodrm_driver);
-}
-
-module_init(glamodrm_init);
-module_exit(glamodrm_exit);
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");