]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: drm/omap: add support for ARCH_MULTIPLATFORM
authorRob Clark <rob@ti.com>
Mon, 29 Oct 2012 08:31:12 +0000 (09:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Oct 2012 18:10:00 +0000 (11:10 -0700)
Remove usage of plat/cpu.h and get information from platform data
instead.  This enables omapdrm to be built with ARCH_MULTIPLATFORM.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-omap2/drm.c
drivers/staging/omapdrm/Kconfig
drivers/staging/omapdrm/omap_dmm_tiler.h
drivers/staging/omapdrm/omap_drv.c
drivers/staging/omapdrm/omap_drv.h
include/linux/platform_data/omap_drm.h

index 72e0f01b715cb221fd18df7587fdd73ce0304551..49a7ffb716a520f1c7bb12938c3559e45dc088c7 100644 (file)
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/platform_data/omap_drm.h>
 
 #include <plat/omap_device.h>
 #include <plat/omap_hwmod.h>
+#include <plat/cpu.h>
 
 #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
 
+static struct omap_drm_platform_data platform_data;
+
 static struct platform_device omap_drm_device = {
        .dev = {
                .coherent_dma_mask = DMA_BIT_MASK(32),
+               .platform_data = &platform_data,
        },
        .name = "omapdrm",
        .id = 0,
@@ -52,6 +57,8 @@ static int __init omap_init_drm(void)
                        oh->name);
        }
 
+       platform_data.omaprev = GET_OMAP_REVISION();
+
        return platform_device_register(&omap_drm_device);
 
 }
index 81a7cba4a0c57a88effd74c336f4c3f24948bdd8..b724a41314359053d598176e7ac871ba3a63704e 100644 (file)
@@ -2,7 +2,7 @@
 config DRM_OMAP
        tristate "OMAP DRM"
        depends on DRM && !CONFIG_FB_OMAP2
-       depends on ARCH_OMAP2PLUS
+       depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM
        select DRM_KMS_HELPER
        select OMAP2_DSS
        select FB_SYS_FILLRECT
index c0271a2ac877d458e540230816992d5a81ef3d2d..4fdd61e54bd28abce8aef29c03e62c6596d31aab 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef OMAP_DMM_TILER_H
 #define OMAP_DMM_TILER_H
 
-#include <plat/cpu.h>
 #include "omap_drv.h"
 #include "tcm.h"
 
index 09653b88e0ecce06e3ea2541fa6ce7ffff3361c3..6ae2f763b27adcf89d1ebea2e70a3f0b7c80dbb7 100644 (file)
@@ -417,13 +417,14 @@ static void omap_modeset_free(struct drm_device *dev)
 static int ioctl_get_param(struct drm_device *dev, void *data,
                struct drm_file *file_priv)
 {
+       struct omap_drm_private *priv = dev->dev_private;
        struct drm_omap_param *args = data;
 
        DBG("%p: param=%llu", dev, args->param);
 
        switch (args->param) {
        case OMAP_PARAM_CHIPSET_ID:
-               args->value = GET_OMAP_TYPE;
+               args->value = priv->omaprev;
                break;
        default:
                DBG("unknown parameter %lld", args->param);
@@ -555,6 +556,7 @@ struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = {
  */
 static int dev_load(struct drm_device *dev, unsigned long flags)
 {
+       struct omap_drm_platform_data *pdata = dev->dev->platform_data;
        struct omap_drm_private *priv;
        int ret;
 
@@ -566,6 +568,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
                return -ENOMEM;
        }
 
+       priv->omaprev = pdata->omaprev;
+
        dev->dev_private = priv;
 
        priv->wq = alloc_ordered_workqueue("omapdrm", 0);
index 9dc72d143ff3fd70c7bfcf95721eff42fbe09986..8f7c447930fa4162d0ca291e623b8d0191efe68c 100644 (file)
@@ -40,6 +40,8 @@
 #define MAX_MAPPERS 2
 
 struct omap_drm_private {
+       uint32_t omaprev;
+
        unsigned int num_crtcs;
        struct drm_crtc *crtcs[8];
 
index 3da73bdc2031afcc32553bacb5d39cca22288008..f4e4a237ebd2626afffd955768083029eff02d45 100644 (file)
@@ -46,6 +46,7 @@ struct omap_kms_platform_data {
 };
 
 struct omap_drm_platform_data {
+       uint32_t omaprev;
        struct omap_kms_platform_data *kms_pdata;
 };