]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
omap2+: add drm device
authorAndy Gross <andy.gross@ti.com>
Wed, 23 May 2012 20:08:10 +0000 (15:08 -0500)
committerTony Lindgren <tony@atomide.com>
Mon, 2 Jul 2012 11:05:57 +0000 (04:05 -0700)
Register OMAP DRM/KMS platform device.  DMM is split into a
separate device using hwmod.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob.clark@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/drm.c [new file with mode: 0644]
drivers/staging/omapdrm/omap_drv.h
include/linux/platform_data/omap_drm.h [moved from drivers/staging/omapdrm/omap_priv.h with 81% similarity]

index fa742f3c262947313f23df2b65e8b36521cf71d9..a636cdc08876daf0f5f1eaa4f13b7a18316a118f 100644 (file)
@@ -189,6 +189,10 @@ endif
 # OMAP2420 MSDI controller integration support ("MMC")
 obj-$(CONFIG_SOC_OMAP2420)             += msdi.o
 
+ifneq ($(CONFIG_DRM_OMAP),)
+obj-y                                  += drm.o
+endif
+
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
new file mode 100644 (file)
index 0000000..72e0f01
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * DRM/KMS device registration for TI OMAP platforms
+ *
+ * Copyright (C) 2012 Texas Instruments
+ * Author: Rob Clark <rob.clark@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <plat/omap_device.h>
+#include <plat/omap_hwmod.h>
+
+#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
+
+static struct platform_device omap_drm_device = {
+       .dev = {
+               .coherent_dma_mask = DMA_BIT_MASK(32),
+       },
+       .name = "omapdrm",
+       .id = 0,
+};
+
+static int __init omap_init_drm(void)
+{
+       struct omap_hwmod *oh = NULL;
+       struct platform_device *pdev;
+
+       /* lookup and populate the DMM information, if present - OMAP4+ */
+       oh = omap_hwmod_lookup("dmm");
+
+       if (oh) {
+               pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0,
+                                       false);
+               WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
+                       oh->name);
+       }
+
+       return platform_device_register(&omap_drm_device);
+
+}
+
+arch_initcall(omap_init_drm);
+
+#endif
index f238d574da0c80546700e0d96fffca42a9c20d51..2092a9167d2925e86c19a728ac7ce6131bf795ba 100644 (file)
@@ -25,8 +25,8 @@
 #include <linux/types.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <linux/platform_data/omap_drm.h>
 #include "omap_drm.h"
-#include "omap_priv.h"
 
 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
 #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
similarity index 81%
rename from drivers/staging/omapdrm/omap_priv.h
rename to include/linux/platform_data/omap_drm.h
index ef6441447147399650399b39523dd31a0ab75b50..3da73bdc2031afcc32553bacb5d39cca22288008 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * include/drm/omap_priv.h
+ * DRM/KMS platform data for TI OMAP platforms
  *
- * Copyright (C) 2011 Texas Instruments
- * Author: Rob Clark <rob@ti.com>
+ * Copyright (C) 2012 Texas Instruments
+ * Author: Rob Clark <rob.clark@linaro.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published by
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __OMAP_PRIV_H__
-#define __OMAP_PRIV_H__
+#ifndef __PLATFORM_DATA_OMAP_DRM_H__
+#define __PLATFORM_DATA_OMAP_DRM_H__
 
-/* Non-userspace facing APIs
- */
-
-/* optional platform data to configure the default configuration of which
+/*
+ * Optional platform data to configure the default configuration of which
  * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
  * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
  * one manager, with priority given to managers that are connected to
@@ -49,7 +47,6 @@ struct omap_kms_platform_data {
 
 struct omap_drm_platform_data {
        struct omap_kms_platform_data *kms_pdata;
-       struct omap_dmm_platform_data *dmm_pdata;
 };
 
-#endif /* __OMAP_DRM_H__ */
+#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */