Compatibility glamo-drm <---> glamo-fb
authorThomas White <taw@bitwiz.org.uk>
Wed, 1 Jul 2009 18:08:22 +0000 (19:08 +0100)
committerThomas White <taw@bitwiz.org.uk>
Wed, 1 Jul 2009 18:08:22 +0000 (19:08 +0100)
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/glamo-core.c
drivers/mfd/glamo/glamo-drm-drv.c
drivers/mfd/glamo/glamo-fb.c

index 9e690b5..d8ebf40 100644 (file)
@@ -202,7 +202,7 @@ static struct resource glamo_graphics_resources[] = {
 };
 
 static struct platform_device glamo_graphics_dev = {
-       .name           = "glamo-graphics",
+       .name           = "glamo-fb",
        .resource       = glamo_graphics_resources,
        .num_resources  = ARRAY_SIZE(glamo_graphics_resources),
 };
@@ -1244,7 +1244,7 @@ static int __init glamo_probe(struct platform_device *pdev)
 
        /* Command queue device (for DRM) */
        glamo_graphics_dev.dev.parent = &pdev->dev;
-       glamo_graphics_dev.dev.platform_data = glamo;
+       glamo_graphics_dev.dev.platform_data = glamo->pdata;
        mangle_mem_resources(glamo_graphics_dev.resource,
                             glamo_graphics_dev.num_resources, glamo->mem);
        platform_device_register(&glamo_graphics_dev);
index 2421f10..97d058f 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <drm/drmP.h>
 #include <drm/glamo_drm.h>
+#include <linux/glamofb.h>
 
 #include "glamo-core.h"
 #include "glamo-cmdq.h"
@@ -198,6 +199,7 @@ static int glamodrm_probe(struct platform_device *pdev)
 {
        int rc;
        struct glamodrm_handle *gdrm;
+       struct glamofb_platform_data *mach_info;
 
        printk(KERN_CRIT "[glamo-drm] SMedia Glamo Direct Rendering Support\n");
 
@@ -205,7 +207,8 @@ static int glamodrm_probe(struct platform_device *pdev)
        if ( !gdrm )
                return -ENOMEM;
        platform_set_drvdata(pdev, gdrm);
-       gdrm->glamo_core = pdev->dev.platform_data;
+       mach_info = pdev->dev.platform_data;
+       gdrm->glamo_core = mach_info->glamo;
        gdrm->dev = &pdev->dev;
 
        /* Find the command queue registers */
@@ -370,7 +373,7 @@ static struct platform_driver glamodrm_driver = {
        .suspend        = glamodrm_suspend,
        .resume         = glamodrm_resume,
        .driver         = {
-               .name   = "glamo-graphics",
+               .name   = "glamo-fb",
                .owner  = THIS_MODULE,
        },
 };
index d9a610e..95d40d2 100644 (file)
@@ -996,6 +996,14 @@ static int __init glamofb_probe(struct platform_device *pdev)
                goto out_free;
        }
 
+       glamofb->fb_res = request_mem_region(glamofb->fb_res->start,
+                                            mach_info->fb_mem_size,
+                                            pdev->name);
+       if (!glamofb->fb_res) {
+               dev_err(&pdev->dev, "failed to request vram region\n");
+               goto out_release_reg;
+       }
+
        /* we want to remap only the registers required for this core
         * driver. */
        glamofb->base = ioremap(glamofb->reg->start, RESSIZE(glamofb->reg));